diff --git a/cli/asc.js b/cli/asc.js index 1697f459..40a02a20 100644 --- a/cli/asc.js +++ b/cli/asc.js @@ -22,6 +22,8 @@ const optionsUtil = require("./util/options"); const mkdirp = require("./util/mkdirp"); const EOL = process.platform === "win32" ? "\r\n" : "\n"; +// global.Binaryen = require("../lib/binaryen"); + // Emscripten adds an `uncaughtException` listener to Binaryen that results in an additional // useless code fragment on top of an actual error. suppress this: if (process.removeAllListeners) process.removeAllListeners("uncaughtException"); @@ -228,30 +230,18 @@ exports.main = function main(argv, options, callback) { var parser = null; // Include library files - if (!args.noLib) { - Object.keys(exports.libraryFiles).forEach(libPath => { - if (libPath.indexOf("/") >= 0) return; // in sub-directory: imported on demand - stats.parseCount++; - stats.parseTime += measure(() => { - parser = assemblyscript.parseFile( - exports.libraryFiles[libPath], - exports.libraryPrefix + libPath + ".ts", - false, - parser - ); - }); - }); - } else { // always include builtins + Object.keys(exports.libraryFiles).forEach(libPath => { + if (libPath.indexOf("/") >= 0) return; // in sub-directory: imported on demand stats.parseCount++; stats.parseTime += measure(() => { parser = assemblyscript.parseFile( - exports.libraryFiles["builtins"], - exports.libraryPrefix + "builtins.ts", + exports.libraryFiles[libPath], + exports.libraryPrefix + libPath + ".ts", false, parser ); }); - } + }); const customLibDirs = []; if (args.lib) { let lib = args.lib; @@ -450,13 +440,11 @@ exports.main = function main(argv, options, callback) { assemblyscript.setSourceMap(compilerOptions, args.sourceMap != null); assemblyscript.setOptimizeLevelHints(compilerOptions, optimizeLevel, shrinkLevel); - if (!args.noLib) { - // Initialize default aliases - assemblyscript.setGlobalAlias(compilerOptions, "Math", "NativeMath"); - assemblyscript.setGlobalAlias(compilerOptions, "Mathf", "NativeMathf"); - assemblyscript.setGlobalAlias(compilerOptions, "abort", "~lib/builtins/abort"); - assemblyscript.setGlobalAlias(compilerOptions, "trace", "~lib/builtins/trace"); - } + // Initialize default aliases + assemblyscript.setGlobalAlias(compilerOptions, "Math", "NativeMath"); + assemblyscript.setGlobalAlias(compilerOptions, "Mathf", "NativeMathf"); + assemblyscript.setGlobalAlias(compilerOptions, "abort", "~lib/builtins/abort"); + assemblyscript.setGlobalAlias(compilerOptions, "trace", "~lib/builtins/trace"); // Add or override aliases if specified if (args.use) { diff --git a/cli/asc.json b/cli/asc.json index 169b2fba..485aec57 100644 --- a/cli/asc.json +++ b/cli/asc.json @@ -129,11 +129,6 @@ "type": "b", "default": false }, - "noLib": { - "description": "Does not include the shipped standard library.", - "type": "b", - "default": false - }, "lib": { "description": [ "Adds one or multiple paths to custom library components and", diff --git a/package-lock.json b/package-lock.json index 756fa25b..b9eddd1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -567,9 +567,9 @@ "dev": true }, "binaryen": { - "version": "77.0.0-nightly.20190407", - "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-77.0.0-nightly.20190407.tgz", - "integrity": "sha512-1mxYNvQ0xywMe582K7V6Vo2zzhZZxMTeGHH8aE/+/AND8f64D8Q1GThVY3RVRwGY/4p+p95ccw9Xbw2ovFXRIg==" + "version": "84.0.0-nightly.20190518", + "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-84.0.0-nightly.20190518.tgz", + "integrity": "sha512-/AhfZd3bd/yifsaCxM3WRSwT8zg9zl+G7lVWkJtr+JHqUijDoi8RHV7gOkNrOw+CAAGrm8l12KhDmkit1/crWA==" }, "bluebird": { "version": "3.5.3", diff --git a/package.json b/package.json index 0ae80d43..ce9f2b52 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@protobufjs/utf8": "^1.1.0", - "binaryen": "77.0.0-nightly.20190407", + "binaryen": "84.0.0-nightly.20190518", "glob": "^7.1.3", "long": "^4.0.0", "opencollective-postinstall": "^2.0.0", diff --git a/src/builtins.ts b/src/builtins.ts index 6fea4bd1..d104a7a7 100644 --- a/src/builtins.ts +++ b/src/builtins.ts @@ -5,8 +5,7 @@ import { Compiler, - ConversionKind, - WrapMode + ContextualFlags } from "./compiler"; import { @@ -47,7 +46,9 @@ import { getConstValueI64Low, getConstValueI32, getConstValueF32, - getConstValueF64 + getConstValueF64, + Relooper, + RelooperBlockRef } from "./module"; import { @@ -56,7 +57,8 @@ import { Field, Global, DecoratorFlags, - Program + Program, + Element } from "./program"; import { @@ -644,7 +646,7 @@ export function compileCall( checkTypeAbsent(typeArguments, reportNode, prototype) | checkArgsRequired(operands, 1, reportNode, compiler) ) return module.createUnreachable(); - let expr = compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE); + let expr = compiler.compileExpressionRetainType(operands[0], Type.i32); compiler.currentType = Type.bool; return module.createI32(getExpressionId(expr) == ExpressionId.Const ? 1 : 0); } @@ -778,8 +780,8 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) return module.createUnreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpression(operands[0], Type.i32, ContextualFlags.WRAP); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( @@ -869,8 +871,8 @@ export function compileCall( checkArgsRequired(operands, 2, reportNode, compiler) ) return module.createUnreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpression(operands[0], Type.i32, ContextualFlags.WRAP); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( @@ -879,7 +881,7 @@ export function compileCall( ); return module.createUnreachable(); } - let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT); let expr: ExpressionRef; switch (type.kind) { case TypeKind.I8: @@ -930,8 +932,8 @@ export function compileCall( checkArgsRequired(operands, 2, reportNode, compiler) ) return module.createUnreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpression(operands[0], Type.i32, ContextualFlags.WRAP); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( @@ -940,7 +942,7 @@ export function compileCall( ); return module.createUnreachable(); } - let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT); let expr: ExpressionRef; switch (type.kind) { case TypeKind.I8: @@ -991,8 +993,8 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) return module.createUnreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.WRAP); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( @@ -1116,8 +1118,8 @@ export function compileCall( checkArgsRequired(operands, 2, reportNode, compiler) ) return module.createUnreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.WRAP); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( @@ -1126,7 +1128,7 @@ export function compileCall( ); return module.createUnreachable(); } - let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.WRAP); + let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT | ContextualFlags.WRAP); let op: BinaryOp; switch (type.kind) { case TypeKind.I8: @@ -1184,8 +1186,8 @@ export function compileCall( checkArgsRequired(operands, 2, reportNode, compiler) ) return module.createUnreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.WRAP); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( @@ -1194,7 +1196,7 @@ export function compileCall( ); return module.createUnreachable(); } - let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.WRAP); + let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT | ContextualFlags.WRAP); let op: BinaryOp; switch (type.kind) { case TypeKind.I8: @@ -1253,8 +1255,8 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) return module.createUnreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( @@ -1304,8 +1306,8 @@ export function compileCall( checkArgsRequired(operands, 2, reportNode, compiler) ) return module.createUnreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( @@ -1314,7 +1316,7 @@ export function compileCall( ); return module.createUnreachable(); } - let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT); let op: BinaryOp; switch (type.kind) { // TODO: does an integer version make sense? @@ -1336,8 +1338,8 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) return module.createUnreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( @@ -1399,25 +1401,23 @@ export function compileCall( switch (type.kind) { case TypeKind.I32: case TypeKind.U32: { - let arg0 = compiler.compileExpression(operands[0], Type.f32, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.f32, ContextualFlags.IMPLICIT); expr = module.createUnary(UnaryOp.ReinterpretF32, arg0); break; } case TypeKind.I64: case TypeKind.U64: { - let arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.f64, ContextualFlags.IMPLICIT); expr = module.createUnary(UnaryOp.ReinterpretF64, arg0); break; } case TypeKind.ISIZE: case TypeKind.USIZE: { - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.isWasm64 ? Type.f64 : Type.f32, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); expr = module.createUnary( compiler.options.isWasm64 @@ -1428,12 +1428,12 @@ export function compileCall( break; } case TypeKind.F32: { - let arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.i32, ContextualFlags.IMPLICIT); expr = module.createUnary(UnaryOp.ReinterpretI32, arg0); break; } case TypeKind.F64: { - let arg0 = compiler.compileExpression(operands[0], Type.i64, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.i64, ContextualFlags.IMPLICIT); expr = module.createUnary(UnaryOp.ReinterpretI64, arg0); break; } @@ -1455,8 +1455,8 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) return module.createUnreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.currentType = type; @@ -1493,8 +1493,8 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) return module.createUnreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( @@ -1553,11 +1553,9 @@ export function compileCall( contextualType.is(TypeFlags.INTEGER) && contextualType.size > type.size ) ? contextualType : type; - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); let numOperands = operands.length; let immOffset = numOperands >= 2 ? evaluateImmediateOffset(operands[1], compiler) : 0; // reports @@ -1609,26 +1607,21 @@ export function compileCall( checkArgsOptional(operands, 2, 4, reportNode, compiler) ) return module.createUnreachable(); let type = typeArguments![0]; - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); let arg1 = isAsm - ? compiler.compileExpression( - operands[1], + ? compiler.compileExpression(operands[1], contextualType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ) : compiler.compileExpression( operands[1], type, type.is(TypeFlags.INTEGER) - ? ConversionKind.NONE // no need to convert to small int (but now might result in a float) - : ConversionKind.IMPLICIT, - WrapMode.NONE + ? ContextualFlags.NONE // no need to convert to small int (but now might result in a float) + : ContextualFlags.IMPLICIT ); let inType = compiler.currentType; if ( @@ -1638,11 +1631,9 @@ export function compileCall( inType.size < type.size // int to larger int (clear garbage bits) ) ) { - arg1 = compiler.convertExpression( - arg1, + arg1 = compiler.convertExpression(arg1, inType, type, - ConversionKind.IMPLICIT, - WrapMode.NONE, // still clears garbage bits + false, false, // still clears garbage bits when not wrapping operands[1] ); inType = type; @@ -1705,11 +1696,9 @@ export function compileCall( compiler.currentType = outType; return module.createUnreachable(); } - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); let immOffset = operands.length == 2 ? evaluateImmediateOffset(operands[1], compiler) : 0; // reports if (immOffset < 0) { @@ -1739,26 +1728,22 @@ export function compileCall( ); return module.createUnreachable(); } - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); let arg1 = isAsm ? compiler.compileExpression( operands[1], contextualType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ) : compiler.compileExpression( operands[1], type, type.is(TypeFlags.INTEGER) - ? ConversionKind.NONE // no need to convert to small int (but now might result in a float) - : ConversionKind.IMPLICIT, - WrapMode.NONE + ? ContextualFlags.NONE // no need to convert to small int (but now might result in a float) + : ContextualFlags.IMPLICIT ); let inType = compiler.currentType; if ( @@ -1768,11 +1753,9 @@ export function compileCall( inType.size < type.size // int to larger int (clear garbage bits) ) ) { - arg1 = compiler.convertExpression( - arg1, + arg1 = compiler.convertExpression(arg1, inType, type, - ConversionKind.IMPLICIT, - WrapMode.NONE, // still clears garbage bits + false, false, // still clears garbage bits when not wrapping operands[1] ); inType = type; @@ -1804,26 +1787,21 @@ export function compileCall( ); return module.createUnreachable(); } - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); let arg1 = isAsm - ? compiler.compileExpression( - operands[1], + ? compiler.compileExpression(operands[1], contextualType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ) : compiler.compileExpression( operands[1], type, type.is(TypeFlags.INTEGER) - ? ConversionKind.NONE // no need to convert to small int (but now might result in a float) - : ConversionKind.IMPLICIT, - WrapMode.NONE + ? ContextualFlags.NONE // no need to convert to small int (but now might result in a float) + : ContextualFlags.IMPLICIT ); let inType = compiler.currentType; if ( @@ -1833,11 +1811,9 @@ export function compileCall( inType.size < type.size // int to larger int (clear garbage bits) ) ) { - arg1 = compiler.convertExpression( - arg1, + arg1 = compiler.convertExpression(arg1, inType, type, - ConversionKind.IMPLICIT, - WrapMode.NONE, // still clears garbage bits + false, false, // still clears garbage bits when not wrapping operands[1] ); inType = type; @@ -1876,33 +1852,26 @@ export function compileCall( ); return module.createUnreachable(); } - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); let arg1 = isAsm - ? compiler.compileExpression( - operands[1], + ? compiler.compileExpression(operands[1], contextualType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ) : compiler.compileExpression( operands[1], type, type.is(TypeFlags.INTEGER) - ? ConversionKind.NONE // no need to convert to small int (but now might result in a float) - : ConversionKind.IMPLICIT, - WrapMode.NONE + ? ContextualFlags.NONE // no need to convert to small int (but now might result in a float) + : ContextualFlags.IMPLICIT ); let inType = compiler.currentType; - let arg2 = compiler.compileExpression( - operands[2], + let arg2 = compiler.compileExpression(operands[2], inType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); if ( type.is(TypeFlags.INTEGER) && @@ -1911,18 +1880,14 @@ export function compileCall( inType.size < type.size // int to larger int (clear garbage bits) ) ) { - arg1 = compiler.convertExpression( - arg1, + arg1 = compiler.convertExpression(arg1, inType, type, - ConversionKind.IMPLICIT, - WrapMode.NONE, // still clears garbage bits + false, false, // still clears garbage bits when not wrapping operands[1] ); - arg2 = compiler.convertExpression( - arg2, + arg2 = compiler.convertExpression(arg2, inType, type, - ConversionKind.IMPLICIT, - WrapMode.NONE, // still clears garbage bits + false, false, // still clears garbage bits when not wrapping operands[2] ); inType = type; @@ -1952,23 +1917,16 @@ export function compileCall( ); return module.createUnreachable(); } - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); - let arg1 = compiler.compileExpression( - operands[1], - type, - ConversionKind.IMPLICIT, - WrapMode.NONE + let arg1 = compiler.compileExpression(operands[1], type, + ContextualFlags.IMPLICIT ); - let arg2 = compiler.compileExpression( - operands[2], + let arg2 = compiler.compileExpression(operands[2], Type.i64, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); compiler.currentType = Type.i32; return module.createAtomicWait(arg0, arg1, arg2, type.toNativeType()); @@ -1980,17 +1938,13 @@ export function compileCall( checkTypeAbsent(typeArguments, reportNode, prototype) | checkArgsRequired(operands, 2, reportNode, compiler) ) return module.createUnreachable(); - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); - let arg1 = compiler.compileExpression( - operands[1], + let arg1 = compiler.compileExpression(operands[1], Type.i32, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); compiler.currentType = Type.i32; return module.createAtomicNotify(arg0, arg1); @@ -2004,8 +1958,8 @@ export function compileCall( checkArgsRequired(operands, 3, reportNode, compiler) ) return module.createUnreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE) - : compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT) + : compiler.compileExpressionRetainType(operands[0], Type.i32); let type = compiler.currentType; if (!type.isAny(TypeFlags.VALUE | TypeFlags.REFERENCE)) { compiler.error( @@ -2014,9 +1968,9 @@ export function compileCall( ); return module.createUnreachable(); } - let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT); let arg2 = compiler.makeIsTrueish( - compiler.compileExpressionRetainType(operands[2], Type.bool, WrapMode.NONE), + compiler.compileExpressionRetainType(operands[2], Type.bool), compiler.currentType // ^ ); compiler.currentType = type; @@ -2050,7 +2004,7 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) return module.createUnreachable(); return module.createHost(HostOp.GrowMemory, null, [ - compiler.compileExpression(operands[0], Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE) + compiler.compileExpression(operands[0], Type.i32, ContextualFlags.IMPLICIT) ]); } case BuiltinSymbols.memory_copy: { // memory.copy(dest: usize, src: usize: n: usize) -> void @@ -2066,24 +2020,9 @@ export function compileCall( return compiler.compileCallDirect(instance, operands, reportNode); } let usizeType = compiler.options.usizeType; - let arg0 = compiler.compileExpression( - operands[0], - usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); - let arg1 = compiler.compileExpression( - operands[1], - usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); - let arg2 = compiler.compileExpression( - operands[2], - usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); + let arg0 = compiler.compileExpression(operands[0], usizeType, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], usizeType, ContextualFlags.IMPLICIT); + let arg2 = compiler.compileExpression(operands[2], usizeType, ContextualFlags.IMPLICIT); compiler.currentType = Type.void; return module.createMemoryCopy(arg0, arg1, arg2); } @@ -2100,24 +2039,9 @@ export function compileCall( return compiler.compileCallDirect(instance, operands, reportNode); } let usizeType = compiler.options.usizeType; - let arg0 = compiler.compileExpression( - operands[0], - usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); - let arg1 = compiler.compileExpression( - operands[1], - Type.u8, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); - let arg2 = compiler.compileExpression( - operands[2], - usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); + let arg0 = compiler.compileExpression(operands[0], usizeType, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.u8, ContextualFlags.IMPLICIT); + let arg2 = compiler.compileExpression(operands[2], usizeType, ContextualFlags.IMPLICIT); compiler.currentType = Type.void; return module.createMemoryFill(arg0, arg1, arg2); } @@ -2130,11 +2054,7 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) return module.createUnreachable(); let toType = typeArguments![0]; - let arg0 = compiler.compileExpressionRetainType( - operands[0], - toType, - WrapMode.NONE - ); + let arg0 = compiler.compileExpressionRetainType(operands[0], toType); let fromType = compiler.currentType; compiler.currentType = toType; if (fromType.size != toType.size) { @@ -2158,8 +2078,8 @@ export function compileCall( return module.createUnreachable(); } let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpressionRetainType(operands[0], Type.bool, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpressionRetainType(operands[0], Type.bool, ContextualFlags.WRAP); let type = compiler.currentType; compiler.currentType = type.nonNullableType; @@ -2333,7 +2253,7 @@ export function compileCall( let alreadyUnchecked = flow.is(FlowFlags.UNCHECKED_CONTEXT); flow.set(FlowFlags.UNCHECKED_CONTEXT); // eliminate unnecessary tees by preferring contextualType(=void): - let expr = compiler.compileExpression(operands[0], contextualType, ConversionKind.NONE, WrapMode.NONE); + let expr = compiler.compileExpression(operands[0], contextualType); if (!alreadyUnchecked) flow.unset(FlowFlags.UNCHECKED_CONTEXT); return expr; } @@ -2344,7 +2264,7 @@ export function compileCall( checkArgsOptional(operands, 1, i32.MAX_VALUE, reportNode, compiler) ) return module.createUnreachable(); let returnType = typeArguments ? typeArguments[0] : contextualType; - let arg0 = compiler.compileExpressionRetainType(operands[0], Type.u32, WrapMode.NONE); + let arg0 = compiler.compileExpressionRetainType(operands[0], Type.u32); let arg0Type = compiler.currentType; if (!( arg0Type == Type.u32 || // either plain index @@ -2362,7 +2282,7 @@ export function compileCall( let parameterTypes = new Array(numOperands); let nativeParamTypes = new Array(numOperands); for (let i = 0; i < numOperands; ++i) { - operandExprs[i] = compiler.compileExpressionRetainType(operands[1 + i], Type.i32, WrapMode.NONE); + operandExprs[i] = compiler.compileExpressionRetainType(operands[1 + i], Type.i32); let operandType = compiler.currentType; parameterTypes[i] = operandType; nativeParamTypes[i] = operandType.toNativeType(); @@ -2404,7 +2324,7 @@ export function compileCall( return module.createUnreachable(); } compiler.currentType = classInstance.type; - return compiler.compileInstantiate(classInstance, operands, reportNode); + return compiler.compileInstantiate(classInstance, operands, ContextualFlags.NONE, reportNode); } // === User-defined diagnostics =============================================================== @@ -2444,7 +2364,7 @@ export function compileCall( compiler.currentType = Type.i8; return module.createUnreachable(); } - return compiler.compileExpression(operands[0], Type.i8, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.i8, ContextualFlags.EXPLICIT); } case BuiltinSymbols.i16: { if ( @@ -2454,7 +2374,7 @@ export function compileCall( compiler.currentType = Type.i16; return module.createUnreachable(); } - return compiler.compileExpression(operands[0], Type.i16, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.i16, ContextualFlags.EXPLICIT); } case BuiltinSymbols.i32: { if ( @@ -2464,7 +2384,7 @@ export function compileCall( compiler.currentType = Type.i32; return module.createUnreachable(); } - return compiler.compileExpression(operands[0], Type.i32, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.i32, ContextualFlags.EXPLICIT); } case BuiltinSymbols.i64: { if ( @@ -2474,7 +2394,7 @@ export function compileCall( compiler.currentType = Type.i64; return module.createUnreachable(); } - return compiler.compileExpression(operands[0], Type.i64, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.i64, ContextualFlags.EXPLICIT); } case BuiltinSymbols.isize: { let isizeType = compiler.options.isizeType; @@ -2485,7 +2405,7 @@ export function compileCall( compiler.currentType = isizeType; return module.createUnreachable(); } - return compiler.compileExpression(operands[0], isizeType, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], isizeType, ContextualFlags.EXPLICIT); } case BuiltinSymbols.u8: { if ( @@ -2495,7 +2415,7 @@ export function compileCall( compiler.currentType = Type.u8; return module.createUnreachable(); } - return compiler.compileExpression(operands[0], Type.u8, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.u8, ContextualFlags.EXPLICIT); } case BuiltinSymbols.u16: { if ( @@ -2505,7 +2425,7 @@ export function compileCall( compiler.currentType = Type.u16; return module.createUnreachable(); } - return compiler.compileExpression(operands[0], Type.u16, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.u16, ContextualFlags.EXPLICIT); } case BuiltinSymbols.u32: { if ( @@ -2515,7 +2435,7 @@ export function compileCall( compiler.currentType = Type.u32; return module.createUnreachable(); } - return compiler.compileExpression(operands[0], Type.u32, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.u32, ContextualFlags.EXPLICIT); } case BuiltinSymbols.u64: { if ( @@ -2525,7 +2445,7 @@ export function compileCall( compiler.currentType = Type.u64; return module.createUnreachable(); } - return compiler.compileExpression(operands[0], Type.u64, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.u64, ContextualFlags.EXPLICIT); } case BuiltinSymbols.usize: { let usizeType = compiler.options.usizeType; @@ -2536,7 +2456,7 @@ export function compileCall( compiler.currentType = usizeType; return module.createUnreachable(); } - return compiler.compileExpression(operands[0], usizeType, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], usizeType, ContextualFlags.EXPLICIT); } case BuiltinSymbols.bool: { if ( @@ -2546,7 +2466,7 @@ export function compileCall( compiler.currentType = Type.bool; return module.createUnreachable(); } - return compiler.compileExpression(operands[0], Type.bool, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.bool, ContextualFlags.EXPLICIT); } case BuiltinSymbols.f32: { if ( @@ -2556,7 +2476,7 @@ export function compileCall( compiler.currentType = Type.f32; return module.createUnreachable(); } - return compiler.compileExpression(operands[0], Type.f32, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.f32, ContextualFlags.EXPLICIT); } case BuiltinSymbols.f64: { if ( @@ -2566,7 +2486,7 @@ export function compileCall( compiler.currentType = Type.f64; return module.createUnreachable(); } - return compiler.compileExpression(operands[0], Type.f64, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.f64, ContextualFlags.EXPLICIT); } // === SIMD =================================================================================== @@ -2585,9 +2505,7 @@ export function compileCall( for (let i = 0; i < 16; ++i) { let value = operands[i]; if (value) { - let expr = module.precomputeExpression( - compiler.compileExpression(value, Type.i8, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let expr = compiler.precomputeExpression(value, Type.i8, ContextualFlags.IMPLICIT); if (getExpressionId(expr) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, @@ -2616,9 +2534,7 @@ export function compileCall( for (let i = 0; i < 8; ++i) { let value = operands[i]; if (value) { - let expr = module.precomputeExpression( - compiler.compileExpression(value, Type.i16, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let expr = compiler.precomputeExpression(value, Type.i16, ContextualFlags.IMPLICIT); if (getExpressionId(expr) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, @@ -2647,9 +2563,7 @@ export function compileCall( for (let i = 0; i < 4; ++i) { let value = operands[i]; if (value) { - let expr = module.precomputeExpression( - compiler.compileExpression(value, Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let expr = compiler.precomputeExpression(value, Type.i32, ContextualFlags.IMPLICIT); if (getExpressionId(expr) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, @@ -2678,9 +2592,7 @@ export function compileCall( for (let i = 0; i < 2; ++i) { let value = operands[i]; if (value) { - let expr = module.precomputeExpression( - compiler.compileExpression(value, Type.i64, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let expr = compiler.precomputeExpression(value, Type.i64, ContextualFlags.IMPLICIT); if (getExpressionId(expr) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, @@ -2711,9 +2623,7 @@ export function compileCall( for (let i = 0; i < 4; ++i) { let value = operands[i]; if (value) { - let expr = module.precomputeExpression( - compiler.compileExpression(value, Type.f32, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let expr = compiler.precomputeExpression(value, Type.f32, ContextualFlags.IMPLICIT); if (getExpressionId(expr) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, @@ -2742,9 +2652,7 @@ export function compileCall( for (let i = 0; i < 2; ++i) { let value = operands[i]; if (value) { - let expr = module.precomputeExpression( - compiler.compileExpression(value, Type.f64, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let expr = compiler.precomputeExpression(value, Type.f64, ContextualFlags.IMPLICIT); if (getExpressionId(expr) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, @@ -2806,7 +2714,7 @@ export function compileCall( return module.createUnreachable(); } } - let arg0 = compiler.compileExpression(operands[0], type, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], type, ContextualFlags.IMPLICIT); compiler.currentType = Type.v128; return module.createUnary(op, arg0); } @@ -2853,10 +2761,8 @@ export function compileCall( return module.createUnreachable(); } } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = module.precomputeExpression( - compiler.compileExpression(operands[1], Type.u8, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.precomputeExpression(operands[1], Type.u8, ContextualFlags.IMPLICIT); compiler.currentType = type; if (getExpressionId(arg1) != ExpressionId.Const) { compiler.error( @@ -2923,10 +2829,8 @@ export function compileCall( return module.createUnreachable(); } } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = module.precomputeExpression( - compiler.compileExpression(operands[1], Type.u8, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.precomputeExpression(operands[1], Type.u8, ContextualFlags.IMPLICIT); if (getExpressionId(arg1) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, @@ -2945,7 +2849,7 @@ export function compileCall( ); return module.createUnreachable(); } - let arg2 = compiler.compileExpression(operands[2], type, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg2 = compiler.compileExpression(operands[2], type, ContextualFlags.IMPLICIT); compiler.currentType = Type.v128; return module.createSIMDReplace(op, arg0, idx, arg2); } @@ -2997,15 +2901,13 @@ export function compileCall( return module.createUnreachable(); } } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = compiler.compileExpression(operands[1], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.v128, ContextualFlags.IMPLICIT); let mask = new Uint8Array(16); let maxIdx = (laneCount << 1) - 1; for (let i = 0; i < laneCount; ++i) { let operand = operands[2 + i]; - let argN = module.precomputeExpression( - compiler.compileExpression(operand, Type.u8, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let argN = compiler.precomputeExpression(operand, Type.u8, ContextualFlags.IMPLICIT); if (getExpressionId(argN) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, @@ -3331,8 +3233,8 @@ export function compileCall( compiler.currentType = Type.v128; return module.createUnreachable(); } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = compiler.compileExpression(operands[1], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.v128, ContextualFlags.IMPLICIT); compiler.currentType = Type.v128; return module.createBinary(op, arg0, arg1); } @@ -3423,7 +3325,7 @@ export function compileCall( compiler.currentType = Type.v128; return module.createUnreachable(); } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); compiler.currentType = Type.v128; return module.createUnary(op, arg0); } @@ -3502,8 +3404,8 @@ export function compileCall( compiler.currentType = Type.v128; return module.createUnreachable(); } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = compiler.compileExpression(operands[1], Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.i32, ContextualFlags.IMPLICIT); compiler.currentType = Type.v128; return module.createSIMDShift(op, arg0, arg1); } @@ -3525,8 +3427,8 @@ export function compileCall( case BuiltinSymbols.v128_or: { op = BinaryOp.OrVec128; break; } case BuiltinSymbols.v128_xor: { op = BinaryOp.XorVec128; break; } } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = compiler.compileExpression(operands[1], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.v128, ContextualFlags.IMPLICIT); return module.createBinary(op, arg0, arg1); } case BuiltinSymbols.v128_not: { // any_bitwise_unary(a: v128) -> v128 @@ -3538,7 +3440,7 @@ export function compileCall( compiler.currentType = Type.v128; return module.createUnreachable(); } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); return module.createUnary(UnaryOp.NotVec128, arg0); } case BuiltinSymbols.v128_bitselect: { // bitselect(v1: v128, v2: v128, c: v128) -> v128 @@ -3550,9 +3452,9 @@ export function compileCall( compiler.currentType = Type.v128; return module.createUnreachable(); } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = compiler.compileExpression(operands[1], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg2 = compiler.compileExpression(operands[2], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.v128, ContextualFlags.IMPLICIT); + let arg2 = compiler.compileExpression(operands[2], Type.v128, ContextualFlags.IMPLICIT); return module.createSIMDBitselect(arg0, arg1, arg2); } case BuiltinSymbols.v128_any_true: // any_test(a: v128) -> bool @@ -3625,7 +3527,7 @@ export function compileCall( compiler.currentType = Type.bool; return module.createUnreachable(); } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); compiler.currentType = Type.bool; return module.createUnary(op, arg0); } @@ -3654,7 +3556,7 @@ export function compileCall( compiler.currentType = Type.void; return module.createUnreachable(); } - let arg0 = compiler.compileExpression(operands[0], Type.u32, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.u32, ContextualFlags.IMPLICIT); compiler.needsVisitGlobals = true; compiler.currentType = Type.void; return module.createCall(BuiltinSymbols.visit_globals, [ arg0 ], NativeType.None); @@ -3667,8 +3569,8 @@ export function compileCall( compiler.currentType = Type.void; return module.createUnreachable(); } - let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = compiler.compileExpression(operands[1], Type.u32, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.u32, ContextualFlags.IMPLICIT); compiler.needsVisitMembers = true; compiler.currentType = Type.void; return module.createCall(BuiltinSymbols.visit_members, [ arg0, arg1 ], NativeType.None); @@ -4034,7 +3936,7 @@ export function compileAbort( if (!(abortInstance && compiler.compileFunction(abortInstance))) return module.createUnreachable(); var messageArg = message != null - ? compiler.compileExpression(message, stringInstance.type, ConversionKind.IMPLICIT, WrapMode.NONE) + ? compiler.compileExpression(message, stringInstance.type, ContextualFlags.IMPLICIT) : stringInstance.type.toNativeZero(module); var filenameArg = compiler.ensureStaticString(reportNode.range.source.normalizedPath); @@ -4116,39 +4018,78 @@ export function compileVisitMembers(compiler: Compiler): void { var ftype = compiler.ensureFunctionType([ usizeType, Type.i32 ], Type.void); // ref, cookie var managedClasses = program.managedClasses; var visitInstance = assert(program.visitInstance); - var names: string[] = [ "invalid" ]; // classId=0 is invalid (TODO: make this ArrayBuffer?) - var blocks = new Array(); + var blocks = new Array(); var lastId = 0; + var relooper = Relooper.create(module); + + var outer = relooper.addBlockWithSwitch( + module.createNop(), + module.createLoad(nativeSizeSize, false, + nativeSizeType == NativeType.I64 + ? module.createBinary(BinaryOp.SubI64, + module.createGetLocal(0, nativeSizeType), + module.createI64(8) + ) + : module.createBinary(BinaryOp.SubI32, + module.createGetLocal(0, nativeSizeType), + module.createI32(8) // rtId is at -8 + ), + NativeType.I32, + 0 + ) + ); + + blocks.push( + relooper.addBlock( + module.createUnreachable() + ) + ); + + relooper.addBranchForSwitch(outer, blocks[0], []); for (let [id, instance] of managedClasses) { assert(instance.type.isManaged); assert(id == ++lastId); - names.push(instance.internalName); - let traverseImpl = instance.lookupInSelf("__traverse"); + let visitImpl: Element | null; // if a library element, check if it implements a custom traversal function - if (instance.isDeclaredInLibrary && traverseImpl) { - assert(traverseImpl.kind == ElementKind.FUNCTION_PROTOTYPE); - let traverseFunc = program.resolver.resolveFunction(traverseImpl, null); - if (!traverseFunc || !compiler.compileFunction(traverseFunc)) { - blocks.push([ + if (instance.isDeclaredInLibrary && (visitImpl = instance.lookupInSelf("__visit_impl"))) { + assert(visitImpl.kind == ElementKind.FUNCTION_PROTOTYPE); + let visitFunc = program.resolver.resolveFunction(visitImpl, null); + let block: RelooperBlockRef; + if (!visitFunc || !compiler.compileFunction(visitFunc)) { + block = relooper.addBlock( module.createUnreachable() - ]); - continue; - } - blocks.push([ - module.createCall(traverseFunc.internalName, [ + ); + } else { + let visitSig = visitFunc.signature; + assert( + visitSig.parameterTypes.length == 1 && + visitSig.parameterTypes[0] == Type.u32 && + visitSig.returnType == Type.void && + visitSig.thisType == instance.type + ); + let callExpr = module.createCall(visitFunc.internalName, [ module.createGetLocal(0, nativeSizeType), // ref module.createGetLocal(1, NativeType.I32) // cookie - ], NativeType.None), - module.createReturn() - ]); + ], NativeType.None); + block = relooper.addBlock( + instance.base + ? callExpr // branch will be added later + : module.createBlock(null, [ + callExpr, + module.createReturn() + ]) + ); + } + relooper.addBranchForSwitch(outer, block, [ id ]); + blocks.push(block); // otherwise generate one } else { // traverse references assigned to own fields - let block = new Array(); + let code = new Array(); let members = instance.members; if (members) { for (let member of members.values()) { @@ -4158,7 +4099,7 @@ export function compileVisitMembers(compiler: Compiler): void { if (fieldType.isManaged) { let fieldOffset = (member).memoryOffset; assert(fieldOffset >= 0); - block.push( + code.push( // if ($2 = value) FIELDCLASS~traverse($2) module.createIf( module.createTeeLocal(2, @@ -4167,16 +4108,10 @@ export function compileVisitMembers(compiler: Compiler): void { nativeSizeType, fieldOffset ) ), - module.createBlock(null, [ - module.createCall(visitInstance.internalName, [ - module.createGetLocal(2, nativeSizeType), // ref - module.createGetLocal(1, NativeType.I32) // cookie - ], NativeType.None), - module.createCall(BuiltinSymbols.visit_members, [ - module.createGetLocal(2, nativeSizeType), // ref - module.createGetLocal(1, NativeType.I32) // cookie - ], NativeType.None) - ]) + module.createCall(visitInstance.internalName, [ + module.createGetLocal(2, nativeSizeType), // ref + module.createGetLocal(1, NativeType.I32) // cookie + ], NativeType.None) ) ); } @@ -4184,46 +4119,20 @@ export function compileVisitMembers(compiler: Compiler): void { } } } - block.push(module.createReturn()); + if (!instance.base) code.push(module.createReturn()); + let block = relooper.addBlock(module.createBlock(null, code)); // TODO: flatten? + relooper.addBranchForSwitch(outer, block, [ id ]); blocks.push(block); } } - - var current: ExpressionRef; - if (blocks.length) { - // create a big switch mapping runtime ids to traversal functions - current = module.createBlock(names[1], [ - module.createSwitch(names, "invalid", - module.createLoad(nativeSizeSize, false, - nativeSizeType == NativeType.I64 - ? module.createBinary(BinaryOp.SubI64, - module.createGetLocal(0, nativeSizeType), - module.createI64(8) - ) - : module.createBinary(BinaryOp.SubI32, - module.createGetLocal(0, nativeSizeType), - module.createI32(8) // rtId is at -8 - ), - NativeType.I32, - 0 - ) - ) - ]); - for (let i = 0, k = blocks.length; i < k; ++i) { - blocks[i].unshift(current); - current = module.createBlock(i == k - 1 ? "invalid" : names[i + 2], blocks[i]); + for (let [id, instance] of managedClasses) { + let base = instance.base; + if (base) { + relooper.addBranch(blocks[id], blocks[base.id]); } - compiler.compileFunction(visitInstance); - // wrap the function with a terminating unreachable - current = module.createBlock(null, [ - current, - module.createUnreachable() - ]); - } else { - // simplify - current = module.createUnreachable(); } - module.addFunction(BuiltinSymbols.visit_members, ftype, [ nativeSizeType ], current); + compiler.compileFunction(visitInstance); + module.addFunction(BuiltinSymbols.visit_members, ftype, [ nativeSizeType ], relooper.renderAndDispose(outer, 2)); } function typeToRuntimeFlags(type: Type): RTTIFlags { @@ -4305,7 +4214,7 @@ function evaluateConstantType( if (operands.length == 1) { // optional type argument if (typeArguments) { if (typeArguments.length == 1) { - compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE); + compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT); } else { if (typeArguments.length) { compiler.error( @@ -4314,10 +4223,10 @@ function evaluateConstantType( ); return null; } - compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE); + compiler.compileExpressionRetainType(operands[0], Type.i32); } } else { - compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE); + compiler.compileExpressionRetainType(operands[0], Type.i32); } return compiler.currentType; } @@ -4339,7 +4248,7 @@ function evaluateImmediateOffset(expression: Expression, compiler: Compiler): i3 var expr: ExpressionRef; var value: i32; if (compiler.options.isWasm64) { - expr = compiler.precomputeExpression(expression, Type.usize64, ConversionKind.IMPLICIT, WrapMode.NONE); + expr = compiler.precomputeExpression(expression, Type.usize64, ContextualFlags.IMPLICIT); if ( getExpressionId(expr) != ExpressionId.Const || getExpressionType(expr) != NativeType.I64 || @@ -4353,7 +4262,7 @@ function evaluateImmediateOffset(expression: Expression, compiler: Compiler): i3 value = -1; } } else { - expr = compiler.precomputeExpression(expression, Type.usize32, ConversionKind.IMPLICIT, WrapMode.NONE); + expr = compiler.precomputeExpression(expression, Type.usize32, ContextualFlags.IMPLICIT); if ( getExpressionId(expr) != ExpressionId.Const || getExpressionType(expr) != NativeType.I32 || diff --git a/src/compiler.ts b/src/compiler.ts index 6d991b62..95b8ab26 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -39,7 +39,10 @@ import { getBlockChild, getBlockName, needsExplicitUnreachable, - getGetLocalIndex + getGetLocalIndex, + FeatureFlags, + isTeeLocal, + getSetLocalIndex } from "./module"; import { @@ -75,8 +78,7 @@ import { DecoratorFlags, PropertyPrototype, File, - mangleInternalName, - CollectorKind + mangleInternalName } from "./program"; import { @@ -161,7 +163,6 @@ import { TypeKind, TypeFlags, Signature, - typesToNativeTypes } from "./types"; @@ -228,22 +229,25 @@ export class Options { } } -/** Indicates the desired kind of a conversion. */ -export const enum ConversionKind { - /** No conversion. */ - NONE, - /** Implicit conversion. */ - IMPLICIT, - /** Explicit conversion. */ - EXPLICIT -} +/** Requests or indicates compilation conditions of statements and expressions. */ +export const enum ContextualFlags { + NONE = 0, -/** Indicates the desired wrap mode of a conversion. */ -export const enum WrapMode { - /** No wrapping. */ - NONE, - /** Wrap small integer values. */ - WRAP + /** Implicit conversion required. */ + IMPLICIT = 1 << 0, + /** Explicit conversion required. */ + EXPLICIT = 1 << 1, + /** Small integer wrap required. */ + WRAP = 1 << 2, + + /** Value is known to be immediately dropped. */ + WILL_DROP = 1 << 3, + /** Value is known to be immediately assigned to a retaining target. */ + SKIP_AUTORELEASE = 1 << 4, + /** Is the last statement in a function body. */ + LAST_IN_BODY = 1 << 5, + /** Data can be compiled statically. */ + STATIC_CAPABLE = 1 << 6 } /** Compiler interface. */ @@ -287,6 +291,16 @@ export class Compiler extends DiagnosticEmitter { needsVisitMembers: bool = false; /** Whether RTTI is required. */ needsRTTI: bool = false; + /** Whether the alloc function is required. */ + needsAlloc: bool = false; + /** Whether the retain function is required. */ + needsRetain: bool = false; + /** Whether the retainRelease function is required. */ + needsRetainRelease: bool = false; + /** Whether the release function is required. */ + needsRelease: bool = false; + /** Expressions known to have skipped an autorelease. Usually function returns. */ + skippedAutoreleases: Set = new Set(); /** Compiles a {@link Program} to a {@link Module} using the specified options. */ static compile(program: Program, options: Options | null = null): Module { @@ -306,6 +320,15 @@ export class Compiler extends DiagnosticEmitter { max(options.memoryBase, 8) ); this.module = Module.create(); + var featureFlags: BinaryenFeatureFlags = 0; + if (this.options.hasFeature(Feature.THREADS)) featureFlags |= FeatureFlags.Atomics; + if (this.options.hasFeature(Feature.MUTABLE_GLOBAL)) featureFlags |= FeatureFlags.MutableGloabls; + // if (this.options.hasFeature(Feature.TRUNC_SAT)) featureFlags |= FeatureFlags.NontrappingFPToInt; + if (this.options.hasFeature(Feature.SIMD)) featureFlags |= FeatureFlags.SIMD128; + if (this.options.hasFeature(Feature.BULK_MEMORY)) featureFlags |= FeatureFlags.BulkMemory; + if (this.options.hasFeature(Feature.SIGN_EXTENSION)) featureFlags |= FeatureFlags.SignExt; + // if (this.options.hasFeature(Feature.EXCEPTION_HANDLING)) featureFlags |= FeatureFlags.ExceptionHandling; + this.module.setFeatures(featureFlags); } /** Performs compilation of the underlying {@link Program} to a {@link Module}. */ @@ -360,15 +383,19 @@ export class Compiler extends DiagnosticEmitter { if (!explicitStartFunction) module.setStart(funcRef); } - // compile gc features if utilized + // compile gc features if utilized. has two uses: first, whenever the compiler + // uses these, all it has to do is set a flag to true. second, when inspecting + // generated WATs, it's quite useful that these functions come last. + if (this.needsAlloc) this.compileFunction(program.allocInstance); + if (this.needsRetain) this.compileFunction(program.retainInstance); + if (this.needsRetainRelease) this.compileFunction(program.retainReleaseInstance); + if (this.needsRelease) this.compileFunction(program.releaseInstance); if (this.needsVisitGlobals) compileVisitGlobals(this); - if (this.needsVisitMembers) compileVisitMembers(this); + if (this.needsVisitMembers) compileVisitMembers(this); // called by release // compile runtime type information module.removeGlobal(BuiltinSymbols.RTTI_BASE); - if (this.needsRTTI) { - compileRTTI(this); - } + if (this.needsRTTI) compileRTTI(this); // update the heap base pointer var memoryOffset = this.memoryOffset; @@ -573,14 +600,17 @@ export class Compiler extends DiagnosticEmitter { var module = this.module; var type = field.type; var usizeType = this.options.usizeType; + var loadExpr = module.createLoad(type.byteSize, type.is(TypeFlags.SIGNED), + module.createGetLocal(0, usizeType.toNativeType()), + type.toNativeType(), field.memoryOffset + ); + // a user-defined getter would return a retained value, so: + if (type.isManaged) loadExpr = this.makeRetain(loadExpr); module.addFunction( name, this.ensureFunctionType(null, type, usizeType), null, - module.createLoad(type.byteSize, type.is(TypeFlags.SIGNED), - module.createGetLocal(0, usizeType.toNativeType()), - type.toNativeType(), field.memoryOffset - ) + loadExpr ); module.addFunctionExport(name, name); } @@ -588,24 +618,19 @@ export class Compiler extends DiagnosticEmitter { /** Makes a function to set the value of a field of an exported class. */ private ensureModuleFieldSetter(name: string, field: Field): void { var module = this.module; - var program = this.program; var type = field.type; var nativeType = type.toNativeType(); var usizeType = this.options.usizeType; var nativeSizeType = usizeType.toNativeType(); - var valueExpr: ExpressionRef; + var valueExpr = module.createGetLocal(1, nativeType); if (type.isManaged) { - let retainReleaseInstance = program.retainReleaseInstance; - this.compileFunction(retainReleaseInstance); - valueExpr = module.createCall(retainReleaseInstance.internalName, [ - module.createGetLocal(1, nativeType), // newRef + valueExpr = this.makeRetainRelease( + valueExpr, // newRef module.createLoad(type.byteSize, false, // oldRef module.createGetLocal(0, nativeSizeType), nativeType, field.memoryOffset ) - ], nativeType); - } else { - valueExpr = module.createGetLocal(1, nativeType); + ); } module.addFunction( name, @@ -719,11 +744,12 @@ export class Compiler extends DiagnosticEmitter { // compile top-level statements var previousFlow = this.currentFlow; - this.currentFlow = startFunction.flow; + var flow = startFunction.flow; + this.currentFlow = flow; for (let statements = file.source.statements, i = 0, k = statements.length; i < k; ++i) { this.compileTopLevelStatement(statements[i], startFunctionBody); } - this.releaseLocals(startFunctionBody, startFunction.flow, /* finalize */ true); + this.finishAutoreleases(flow, startFunctionBody); this.currentFlow = previousFlow; this.currentBody = previousBody; @@ -756,6 +782,7 @@ export class Compiler extends DiagnosticEmitter { var module = this.module; var initExpr: ExpressionRef = 0; + var initAutoreleaseSkipped: bool = false; var typeNode = global.typeNode; var initializerNode = global.initializerNode; @@ -780,11 +807,10 @@ export class Compiler extends DiagnosticEmitter { if (global.hasDecorator(DecoratorFlags.LAZY)) { this.currentFlow = global.file.startFunction.flow; } - initExpr = this.compileExpressionRetainType( // reports - initializerNode, - Type.void, - WrapMode.WRAP + initExpr = this.compileExpression(initializerNode, Type.i32, // reports + ContextualFlags.WRAP | ContextualFlags.SKIP_AUTORELEASE ); + if (this.skippedAutoreleases.has(initExpr)) initAutoreleaseSkipped = true; this.currentFlow = previousFlow; if (this.currentType == Type.void) { this.error( @@ -853,13 +879,10 @@ export class Compiler extends DiagnosticEmitter { if (global.hasDecorator(DecoratorFlags.LAZY)) { this.currentFlow = global.file.startFunction.flow; } - initExpr = this.compileExpression( - initializerNode, - type, - ConversionKind.IMPLICIT, - WrapMode.WRAP, - global + initExpr = this.compileExpression(initializerNode, type, + ContextualFlags.IMPLICIT | ContextualFlags.WRAP | ContextualFlags.SKIP_AUTORELEASE | ContextualFlags.STATIC_CAPABLE ); + if (this.skippedAutoreleases.has(initExpr)) initAutoreleaseSkipped = true; this.currentFlow = previousFlow; } @@ -931,12 +954,7 @@ export class Compiler extends DiagnosticEmitter { ); } module.addGlobal(internalName, nativeType, true, type.toNativeZero(module)); - let program = this.program; - if (type.isManaged) { - let retainInstance = program.retainInstance; - this.compileFunction(retainInstance); - initExpr = module.createCall(retainInstance.internalName, [ initExpr ], nativeType); - } + if (type.isManaged && !initAutoreleaseSkipped) initExpr = this.makeRetain(initExpr); this.currentBody.push( module.createSetGlobal(internalName, initExpr) ); @@ -971,11 +989,8 @@ export class Compiler extends DiagnosticEmitter { } let initExpr: ExpressionRef; if (valueNode) { - initExpr = this.compileExpression( - valueNode, - Type.i32, - ConversionKind.IMPLICIT, - WrapMode.NONE + initExpr = this.compileExpression(valueNode, Type.i32, + ContextualFlags.IMPLICIT // autorelease is not applicable in i32 context ); if (getExpressionId(initExpr) != ExpressionId.Const) { initExpr = module.precomputeExpression(initExpr); @@ -1093,7 +1108,12 @@ export class Compiler extends DiagnosticEmitter { } /** Compiles the body of a function within the specified flow. */ - compileFunctionBody(instance: Function, stmts: ExpressionRef[] | null = null): ExpressionRef[] { + compileFunctionBody( + /** Function to compile. */ + instance: Function, + /** Target array of statements. */ + stmts: ExpressionRef[] | null = null + ): ExpressionRef[] { var module = this.module; var bodyNode = assert(instance.prototype.bodyNode); var returnType = instance.signature.returnType; @@ -1112,16 +1132,24 @@ export class Compiler extends DiagnosticEmitter { // none of the following can be an arrow function assert(!instance.isAny(CommonFlags.CONSTRUCTOR | CommonFlags.GET | CommonFlags.SET | CommonFlags.MAIN)); - let stmt = this.compileExpression( - (bodyNode).expression, - returnType, - ConversionKind.IMPLICIT, - WrapMode.NONE + let expr = this.compileExpression((bodyNode).expression, returnType, + ContextualFlags.IMPLICIT ); - flow.set(FlowFlags.RETURNS); - if (!flow.canOverflow(stmt, returnType)) flow.set(FlowFlags.RETURNS_WRAPPED); - if (!stmts) stmts = [ stmt ]; - else stmts.push(stmt); + if (!stmts) stmts = [ expr ]; + else stmts.push(expr); + if (!flow.isAny(FlowFlags.ANY_TERMINATING)) { // TODO: detect if returning an AUTORELEASE local + let indexBefore = stmts.length; + this.performAutoreleases(flow, stmts); + this.finishAutoreleases(flow, stmts); + let canOverflow = flow.canOverflow(expr, returnType); + if (stmts.length > indexBefore) { + let temp = flow.getAndFreeTempLocal(returnType, !canOverflow); + stmts[indexBefore - 1] = module.createSetLocal(temp.index, expr); + stmts.push(module.createGetLocal(temp.index, returnType.toNativeType())); + } + if (!canOverflow) flow.set(FlowFlags.RETURNS_WRAPPED); + flow.set(FlowFlags.RETURNS); // now is terminating + } } // make the main function call `start` implicitly, but only once @@ -1165,14 +1193,17 @@ export class Compiler extends DiagnosticEmitter { module.createGetLocal(thisLocalIndex, nativeSizeType) ), module.createSetLocal(thisLocalIndex, - this.makeAllocation(classInstance, instance.identifierNode) + this.makeRetain( + this.makeAllocation(classInstance) + ), ) ) ); this.makeFieldInitialization(classInstance, stmts); } - // implicitly return `this`. unlike normal functions, + // implicitly return `this`. unlike for normal functions, retaining the value isn't + // necessary because the allocation (constructor call) already did (RC=1) stmts.push( module.createGetLocal(thisLocalIndex, nativeSizeType) ); @@ -1202,6 +1233,7 @@ export class Compiler extends DiagnosticEmitter { compileFunction(instance: Function): bool { if (instance.is(CommonFlags.COMPILED)) return true; assert(!(instance.is(CommonFlags.AMBIENT) && instance.hasDecorator(DecoratorFlags.BUILTIN))); + instance.set(CommonFlags.COMPILED); var module = this.module; @@ -1251,18 +1283,20 @@ export class Compiler extends DiagnosticEmitter { if (type.isManaged) { stmts.push( module.createDrop( - this.ensureRetain( - module.createGetLocal(index, type.toNativeType()), - type + this.makeRetain( + module.createGetLocal(index, type.toNativeType()) ) ) ); - flow.setLocalFlag(index, LocalFlags.AUTORELEASE); + flow.setLocalFlag(index, LocalFlags.RETAINED); } } this.compileFunctionBody(instance, stmts); - if (!flow.isAny(FlowFlags.ANY_TERMINATING)) this.releaseLocals(stmts, flow, /* finalize */ true); + if (!flow.isAny(FlowFlags.ANY_TERMINATING)) { + this.performAutoreleases(flow, stmts); + this.finishAutoreleases(flow, stmts); + } this.currentFlow = previousFlow; // create the function @@ -1658,70 +1692,70 @@ export class Compiler extends DiagnosticEmitter { compileStatement( statement: Statement, - isLastStatementInBody: bool = false + contextualFlags: ContextualFlags = ContextualFlags.NONE ): ExpressionRef { var module = this.module; var stmt: ExpressionRef; switch (statement.kind) { case NodeKind.BLOCK: { - stmt = this.compileBlockStatement(statement); + stmt = this.compileBlockStatement(statement, contextualFlags); break; } case NodeKind.BREAK: { - stmt = this.compileBreakStatement(statement); + stmt = this.compileBreakStatement(statement, contextualFlags); break; } case NodeKind.CONTINUE: { - stmt = this.compileContinueStatement(statement); + stmt = this.compileContinueStatement(statement, contextualFlags); break; } case NodeKind.DO: { - stmt = this.compileDoStatement(statement); + stmt = this.compileDoStatement(statement, contextualFlags); break; } case NodeKind.EMPTY: { - stmt = this.compileEmptyStatement(statement); + stmt = this.compileEmptyStatement(statement, contextualFlags); break; } case NodeKind.EXPRESSION: { - stmt = this.compileExpressionStatement(statement, isLastStatementInBody); + stmt = this.compileExpressionStatement(statement, contextualFlags); break; } case NodeKind.FOR: { - stmt = this.compileForStatement(statement); + stmt = this.compileForStatement(statement, contextualFlags); break; } case NodeKind.IF: { - stmt = this.compileIfStatement(statement); + stmt = this.compileIfStatement(statement, contextualFlags); break; } case NodeKind.RETURN: { - stmt = this.compileReturnStatement(statement, isLastStatementInBody); + stmt = this.compileReturnStatement(statement, contextualFlags); break; } case NodeKind.SWITCH: { - stmt = this.compileSwitchStatement(statement); + stmt = this.compileSwitchStatement(statement, contextualFlags); break; } case NodeKind.THROW: { - stmt = this.compileThrowStatement(statement); + stmt = this.compileThrowStatement(statement, contextualFlags); break; } case NodeKind.TRY: { - stmt = this.compileTryStatement(statement); + stmt = this.compileTryStatement(statement, contextualFlags); break; } case NodeKind.VARIABLE: { - stmt = this.compileVariableStatement(statement); + stmt = this.compileVariableStatement(statement, contextualFlags); if (!stmt) stmt = module.createNop(); break; } case NodeKind.VOID: { - stmt = this.compileVoidStatement(statement); + stmt = this.compileVoidStatement(statement, contextualFlags); break; } case NodeKind.WHILE: { - stmt = this.compileWhileStatement(statement); + stmt = this.compileWhileStatement(statement, contextualFlags); break; } case NodeKind.TYPEDECLARATION: { @@ -1754,7 +1788,11 @@ export class Compiler extends DiagnosticEmitter { } var flow = this.currentFlow; for (let i = 0; i < numStatements; ++i) { - let stmt = this.compileStatement(statements[i], isBody && i == numStatements - 1); + let stmt = this.compileStatement(statements[i], + isBody && i == numStatements - 1 + ? ContextualFlags.LAST_IN_BODY + : ContextualFlags.NONE + ); switch (getExpressionId(stmt)) { case ExpressionId.Block: { if (!getBlockName(stmt)) { @@ -1774,58 +1812,27 @@ export class Compiler extends DiagnosticEmitter { return stmts; } - /** Releases any locals in the current scope marked AUTORELEASE. Includes top-level locals if finalizing. */ - private releaseLocals(stmts: ExpressionRef[], flow: Flow, finalize: bool = false): void { - var module = this.module; - var releaseInstance = this.program.releaseInstance; - var needsRelease = false; - var scopedLocals = flow.scopedLocals; - if (scopedLocals) { - for (let local of scopedLocals.values()) { - if (local.is(CommonFlags.SCOPED)) { // otherwise an alias - if (flow.isAnyLocalFlag(local.index, LocalFlags.ANY_AUTORELEASE)) { - flow.unsetLocalFlag(local.index, LocalFlags.AUTORELEASE); - stmts.push( - module.createCall(releaseInstance.internalName, [ - module.createGetLocal(local.index, local.type.toNativeType()) - ], NativeType.None) - ); - needsRelease = true; - } - } - } - } - if (finalize) { - for (let local of flow.parentFunction.localsByIndex) { - if (flow.isAnyLocalFlag(local.index, LocalFlags.ANY_AUTORELEASE)) { - flow.unsetLocalFlag(local.index, LocalFlags.AUTORELEASE); - stmts.push( - module.createCall(releaseInstance.internalName, [ - module.createGetLocal(local.index, local.type.toNativeType()) - ], NativeType.None) - ); - needsRelease = true; - } - } - } - if (needsRelease) this.compileFunction(releaseInstance); - } - - compileBlockStatement(statement: BlockStatement): ExpressionRef { + compileBlockStatement( + statement: BlockStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var statements = statement.statements; var outerFlow = this.currentFlow; var innerFlow = outerFlow.fork(); this.currentFlow = innerFlow; var stmts = this.compileStatements(statements); - if (!innerFlow.isAny(FlowFlags.ANY_TERMINATING)) this.releaseLocals(stmts, innerFlow); + if (!innerFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(innerFlow, stmts); innerFlow.freeScopedLocals(); - outerFlow.inherit(innerFlow); + outerFlow.inherit(innerFlow); // TODO: only if not terminated? this.currentFlow = outerFlow; return flatten(this.module, stmts, NativeType.None); } - compileBreakStatement(statement: BreakStatement): ExpressionRef { + compileBreakStatement( + statement: BreakStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; if (statement.label) { this.error( @@ -1843,15 +1850,23 @@ export class Compiler extends DiagnosticEmitter { ); return module.createUnreachable(); } - flow.set(FlowFlags.BREAKS); var stmts = new Array(); - this.releaseLocals(stmts, flow); + this.performAutoreleases(flow, stmts); + var current: Flow | null = flow.parent; + while (current && current.breakLabel === breakLabel) { + this.performAutoreleases(current, stmts, /* clearFlags */ false); + current = current.parent; + } flow.freeScopedLocals(); stmts.push(module.createBreak(breakLabel)); + flow.set(FlowFlags.BREAKS); return flatten(module, stmts, NativeType.None); } - compileContinueStatement(statement: ContinueStatement): ExpressionRef { + compileContinueStatement( + statement: ContinueStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; var label = statement.label; if (label) { @@ -1873,13 +1888,21 @@ export class Compiler extends DiagnosticEmitter { } flow.set(FlowFlags.CONTINUES); var stmts = new Array(); - this.releaseLocals(stmts, flow); + this.performAutoreleases(flow, stmts); + var current: Flow | null = flow.parent; + while (current && current.continueLabel === continueLabel) { + this.performAutoreleases(current, stmts, /* clearFlags */ false); + current = current.parent; + } flow.freeScopedLocals(); stmts.push(module.createBreak(continueLabel)); return flatten(module, stmts, NativeType.None); } - compileDoStatement(statement: DoStatement): ExpressionRef { + compileDoStatement( + statement: DoStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; var outerFlow = this.currentFlow; @@ -1900,14 +1923,14 @@ export class Compiler extends DiagnosticEmitter { ); } var condExpr = this.makeIsTrueish( - this.compileExpression(statement.condition, Type.i32, ConversionKind.NONE, WrapMode.NONE), + this.compileExpression(statement.condition, Type.i32), this.currentType ); // TODO: check if condition is always false and if so, omit it (just a block) // Switch back to the parent flow var terminated = innerFlow.isAny(FlowFlags.ANY_TERMINATING); - if (!terminated) this.releaseLocals(stmts, innerFlow); + if (!terminated) this.performAutoreleases(innerFlow, stmts); innerFlow.freeScopedLocals(); outerFlow.popBreakLabel(); this.currentFlow = outerFlow; @@ -1933,22 +1956,26 @@ export class Compiler extends DiagnosticEmitter { return module.createBlock(breakLabel, block); } - compileEmptyStatement(statement: EmptyStatement): ExpressionRef { + compileEmptyStatement( + statement: EmptyStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { return this.module.createNop(); } - compileExpressionStatement(statement: ExpressionStatement, isLastStatementInBody: bool = false): ExpressionRef { - return this.compileExpression( - statement.expression, - Type.void, - ConversionKind.EXPLICIT, - WrapMode.NONE, - null, - isLastStatementInBody + compileExpressionStatement( + statement: ExpressionStatement, + contextualFlags: ContextualFlags, + ): ExpressionRef { + return this.compileExpression(statement.expression, Type.void, + contextualFlags | ContextualFlags.EXPLICIT | ContextualFlags.WILL_DROP ); } - compileForStatement(statement: ForStatement): ExpressionRef { + compileForStatement( + statement: ForStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { // A for statement initiates a new branch with its own scoped variables // possibly declared in its initializer, and break context. var outerFlow = this.currentFlow; @@ -1969,23 +1996,19 @@ export class Compiler extends DiagnosticEmitter { var condExpr: ExpressionRef = 0; var alwaysTrue = false; if (statement.condition) { - condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE), - this.currentType + condExpr = module.precomputeExpression( + this.makeIsTrueish( + this.compileExpressionRetainType(statement.condition, Type.bool), + this.currentType + ) ); // check if the condition is always true - let condPre = module.precomputeExpression(condExpr); - if (getExpressionId(condPre) == ExpressionId.Const) { - assert(getExpressionType(condPre) == NativeType.I32); - if (getConstValueI32(condPre) != 0) alwaysTrue = true; + if (getExpressionId(condExpr) == ExpressionId.Const) { + assert(getExpressionType(condExpr) == NativeType.I32); + if (getConstValueI32(condExpr) != 0) alwaysTrue = true; // TODO: could skip compilation if the condition is always false here, but beware that the // initializer could still declare new 'var's that are used later on. } - // recompile to original - condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE), - this.currentType - ); } else { // omitted condition is always true condExpr = module.createI32(1); @@ -1993,8 +2016,10 @@ export class Compiler extends DiagnosticEmitter { } innerFlow.inheritNonnullIfTrue(condExpr); var incrExpr = statement.incrementor - ? this.compileExpression(statement.incrementor, Type.void, ConversionKind.IMPLICIT, WrapMode.NONE) - : 0; + ? this.compileExpression(statement.incrementor, Type.void, + ContextualFlags.IMPLICIT | ContextualFlags.WILL_DROP + ) + : 0; var bodyStatement = statement.statement; var stmts = new Array(); if (bodyStatement.kind == NodeKind.BLOCK) { @@ -2004,7 +2029,7 @@ export class Compiler extends DiagnosticEmitter { this.compileStatement(bodyStatement) ); } - if (!innerFlow.isAny(FlowFlags.ANY_TERMINATING)) this.releaseLocals(stmts, innerFlow, false); + if (!innerFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(innerFlow, stmts); // Switch back to the parent flow innerFlow.freeScopedLocals(); @@ -2051,36 +2076,33 @@ export class Compiler extends DiagnosticEmitter { return module.createBlock(breakLabel, breakBlock); } - compileIfStatement(statement: IfStatement): ExpressionRef { + compileIfStatement( + statement: IfStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; var ifTrue = statement.ifTrue; var ifFalse = statement.ifFalse; var outerFlow = this.currentFlow; // The condition doesn't initiate a branch yet - var condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE), - this.currentType + var condExpr = module.precomputeExpression( + this.makeIsTrueish( + this.compileExpressionRetainType(statement.condition, Type.bool), + this.currentType + ) ); // Try to eliminate unnecesssary branches if the condition is constant - var condExprPrecomp = module.precomputeExpression(condExpr); if ( - getExpressionId(condExprPrecomp) == ExpressionId.Const && - getExpressionType(condExprPrecomp) == NativeType.I32 + getExpressionId(condExpr) == ExpressionId.Const && + getExpressionType(condExpr) == NativeType.I32 ) { - return getConstValueI32(condExprPrecomp) + return getConstValueI32(condExpr) ? this.compileStatement(ifTrue) : ifFalse ? this.compileStatement(ifFalse) : module.createNop(); - - // Otherwise recompile to the original and let the optimizer decide - } else /* if (condExpr != condExprPrecomp) <- not guaranteed */ { - condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE), - this.currentType - ); } // Each arm initiates a branch @@ -2093,7 +2115,7 @@ export class Compiler extends DiagnosticEmitter { } else { ifTrueStmts.push(this.compileStatement(ifTrue)); } - if (!ifTrueFlow.isAny(FlowFlags.ANY_TERMINATING)) this.releaseLocals(ifTrueStmts, ifTrueFlow); + if (!ifTrueFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(ifTrueFlow, ifTrueStmts); ifTrueFlow.freeScopedLocals(); this.currentFlow = outerFlow; @@ -2107,7 +2129,7 @@ export class Compiler extends DiagnosticEmitter { } else { ifFalseStmts.push(this.compileStatement(ifFalse)); } - if (!ifFalseFlow.isAny(FlowFlags.ANY_TERMINATING)) this.releaseLocals(ifFalseStmts, ifFalseFlow); + if (!ifFalseFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(ifFalseFlow, ifFalseStmts); ifFalseFlow.freeScopedLocals(); this.currentFlow = outerFlow; outerFlow.inheritMutual(ifTrueFlow, ifFalseFlow); @@ -2126,7 +2148,10 @@ export class Compiler extends DiagnosticEmitter { } } - compileReturnStatement(statement: ReturnStatement, isLastStatementInBody: bool): ExpressionRef { + compileReturnStatement( + statement: ReturnStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; var expr: ExpressionRef = 0; var flow = this.currentFlow; @@ -2136,10 +2161,8 @@ export class Compiler extends DiagnosticEmitter { flow.set(FlowFlags.RETURNS); var valueExpression = statement.value; - var mustRetainReturn = true; if (valueExpression) { if (returnType == Type.void) { - this.compileExpressionRetainType(valueExpression, returnType, WrapMode.NONE); this.error( DiagnosticCode.Type_0_is_not_assignable_to_type_1, valueExpression.range, this.currentType.toString(), returnType.toString() @@ -2147,20 +2170,19 @@ export class Compiler extends DiagnosticEmitter { this.currentType = Type.void; return module.createUnreachable(); } - expr = this.compileExpression( - valueExpression, - returnType, - ConversionKind.IMPLICIT, - flow.actualFunction.is(CommonFlags.MODULE_EXPORT) - ? WrapMode.WRAP - : WrapMode.NONE - ); + let contextualFlags = ContextualFlags.IMPLICIT; + if (flow.actualFunction.is(CommonFlags.MODULE_EXPORT)) contextualFlags |= ContextualFlags.WRAP; + expr = this.compileExpression(valueExpression, returnType, contextualFlags | ContextualFlags.SKIP_AUTORELEASE); - if (returnType.isManaged) { - if (getExpressionId(expr) == ExpressionId.GetLocal) { - if (flow.isLocalFlag(getGetLocalIndex(expr), LocalFlags.AUTORELEASE)) { - flow.unsetLocalFlag(getGetLocalIndex(expr), LocalFlags.AUTORELEASE); - mustRetainReturn = false; + // when returning a local, and it is already retained, skip the final set + // of retaining it as the return value and releasing it as a variable + if (!this.skippedAutoreleases.has(expr)) { + if (returnType.isManaged) { + if (getExpressionId(expr) == ExpressionId.GetLocal) { + if (flow.isAnyLocalFlag(getGetLocalIndex(expr), LocalFlags.ANY_RETAINED)) { + flow.unsetLocalFlag(getGetLocalIndex(expr), LocalFlags.ANY_RETAINED); + this.skippedAutoreleases.add(expr); + } } } } @@ -2177,28 +2199,23 @@ export class Compiler extends DiagnosticEmitter { } var stmts = new Array(); - this.releaseLocals(stmts, flow, /* finalize */ true); + this.performAutoreleases(flow, stmts); + this.finishAutoreleases(flow, stmts); if (returnType.isManaged) { - // We don't know at this point whether the return value will be - // dropped or stored by the caller, so we add it to autorelease. + // Make sure that the return value is retained for the caller + if (!this.skippedAutoreleases.has(expr)) expr = this.makeRetain(expr); if (stmts.length) { let temp = flow.getAndFreeTempLocal(returnType, false); stmts.unshift( - module.createSetLocal(temp.index, - mustRetainReturn - ? this.ensureRetain(expr, returnType) - : expr - ) + module.createSetLocal(temp.index, expr) ); expr = module.createGetLocal(temp.index, returnType.toNativeType()); - } else if (mustRetainReturn) { - expr = this.ensureRetain(expr, returnType); // no need for a temp } } flow.freeScopedLocals(); // If the last statement anyway, make it the block's return value - if (isLastStatementInBody && expr && returnType != Type.void) { + if ((contextualFlags & ContextualFlags.LAST_IN_BODY) != 0 && expr && returnType != Type.void) { if (!stmts.length) return expr; stmts.push(expr); return module.createBlock(null, stmts, returnType.toNativeType()); @@ -2218,13 +2235,15 @@ export class Compiler extends DiagnosticEmitter { return module.createBlock(null, stmts); } - compileSwitchStatement(statement: SwitchStatement): ExpressionRef { + compileSwitchStatement(statement: SwitchStatement, contextualFlags: ContextualFlags): ExpressionRef { var module = this.module; var cases = statement.cases; var numCases = cases.length; if (!numCases) { - return this.compileExpression(statement.condition, Type.void, ConversionKind.IMPLICIT, WrapMode.NONE); + return this.compileExpression(statement.condition, Type.void, + ContextualFlags.IMPLICIT + ); } // Everything within a switch uses the same break context @@ -2239,7 +2258,9 @@ export class Compiler extends DiagnosticEmitter { var breaks = new Array(1 + numCases); breaks[0] = module.createSetLocal( // initializer tempLocalIndex, - this.compileExpression(statement.condition, Type.u32, ConversionKind.IMPLICIT, WrapMode.NONE) + this.compileExpression(statement.condition, Type.u32, + ContextualFlags.IMPLICIT + ) ); // make one br_if per (possibly dynamic) labeled case (binaryen optimizes to br_table where possible) @@ -2252,7 +2273,9 @@ export class Compiler extends DiagnosticEmitter { breaks[breakIndex++] = module.createBreak("case" + i.toString(10) + "|" + context, module.createBinary(BinaryOp.EqI32, module.createGetLocal(tempLocalIndex, NativeType.I32), - this.compileExpression(label, Type.u32, ConversionKind.IMPLICIT, WrapMode.NONE) + this.compileExpression(label, Type.u32, + ContextualFlags.IMPLICIT + ) ) ); } else { @@ -2330,7 +2353,10 @@ export class Compiler extends DiagnosticEmitter { return currentBlock; } - compileThrowStatement(statement: ThrowStatement): ExpressionRef { + compileThrowStatement( + statement: ThrowStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var flow = this.currentFlow; // Remember that this branch throws @@ -2340,15 +2366,24 @@ export class Compiler extends DiagnosticEmitter { flow.set(FlowFlags.RETURNS); var stmts = new Array(); - this.releaseLocals(stmts, flow, /* finalize */ true); + this.finishAutoreleases(flow, stmts); // TODO: requires exception-handling spec. - stmts.push(compileAbort(this, null, statement)); + var value = statement.value; + var message: Expression | null = null; + if (value.kind == NodeKind.NEW) { + let newArgs = (value).arguments; + if (newArgs.length) message = newArgs[0]; // FIXME: naively assumes type string + } + stmts.push(compileAbort(this, message, statement)); return flatten(this.module, stmts, NativeType.None); } - compileTryStatement(statement: TryStatement): ExpressionRef { + compileTryStatement( + statement: TryStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { // TODO: can't yet support something like: try { return ... } finally { ... } // worthwhile to investigate lowering returns to block results (here)? this.error( @@ -2359,7 +2394,7 @@ export class Compiler extends DiagnosticEmitter { } /** Compiles a variable statement. Returns `0` if an initializer is not necessary. */ - compileVariableStatement(statement: VariableStatement): ExpressionRef { + compileVariableStatement(statement: VariableStatement, contextualFlags: ContextualFlags): ExpressionRef { var module = this.module; var declarations = statement.declarations; var numDeclarations = declarations.length; @@ -2371,6 +2406,7 @@ export class Compiler extends DiagnosticEmitter { let name = declaration.name.text; let type: Type | null = null; let initExpr: ExpressionRef = 0; + let initAutoreleaseSkipped = false; if (declaration.type) { type = resolver.resolveType( // reports declaration.type, @@ -2379,19 +2415,16 @@ export class Compiler extends DiagnosticEmitter { ); if (!type) continue; if (declaration.initializer) { - initExpr = this.compileExpression( // reports - declaration.initializer, - type, - ConversionKind.IMPLICIT, - WrapMode.NONE + initExpr = this.compileExpression(declaration.initializer, type, // reports + ContextualFlags.IMPLICIT | ContextualFlags.SKIP_AUTORELEASE ); + initAutoreleaseSkipped = this.skippedAutoreleases.has(initExpr); } } else if (declaration.initializer) { // infer type using void/NONE for proper literal inference - initExpr = this.compileExpressionRetainType( // reports - declaration.initializer, - Type.void, - WrapMode.NONE - ); + initExpr = this.compileExpressionRetainType(declaration.initializer, Type.void, + ContextualFlags.SKIP_AUTORELEASE + ); // reports + initAutoreleaseSkipped = this.skippedAutoreleases.has(initExpr); if (this.currentType == Type.void) { this.error( DiagnosticCode.Type_0_is_not_assignable_to_type_1, @@ -2489,12 +2522,17 @@ export class Compiler extends DiagnosticEmitter { } local = flow.parentFunction.addLocal(type, name, declaration); } + let isManaged = type.isManaged; if (initExpr) { - if (type.isManaged) { + if (isManaged) { + flow.setLocalFlag(local.index, LocalFlags.RETAINED); initializers.push( - module.createSetLocal(local.index, this.ensureRetain(initExpr, type)) + module.createSetLocal(local.index, + initAutoreleaseSkipped + ? initExpr + : this.makeRetain(initExpr) + ) ); - flow.setLocalFlag(local.index, LocalFlags.AUTORELEASE); } else { initializers.push( module.createSetLocal(local.index, initExpr) @@ -2505,7 +2543,19 @@ export class Compiler extends DiagnosticEmitter { } } } else { - if (local.type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) { + if (isManaged) { + // This is necessary because the first use (and assign) of the local could be taking place + // in a loop, subsequently marking it retained, but the second iteration of the loop + // still wouldn't release whatever is assigned in the first. Likewise, if the variable wasn't + // initialized but becomes released later on, whatever was stored before would be released. + // TODO: Detect this condition inside of a loop instead? + initializers.push( + module.createSetLocal(local.index, + type.toNativeZero(module) + ) + ); + flow.setLocalFlag(local.index, LocalFlags.CONDITIONALLY_RETAINED); + } else if (local.type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) { flow.setLocalFlag(local.index, LocalFlags.WRAPPED); } } @@ -2516,34 +2566,30 @@ export class Compiler extends DiagnosticEmitter { : flatten(module, initializers, NativeType.None); } - compileVoidStatement(statement: VoidStatement): ExpressionRef { - return this.compileExpression(statement.expression, Type.void, ConversionKind.EXPLICIT, WrapMode.NONE); + compileVoidStatement(statement: VoidStatement, contextualFlags: ContextualFlags): ExpressionRef { + return this.compileExpression(statement.expression, Type.void, + ContextualFlags.EXPLICIT | ContextualFlags.WILL_DROP + ); } - compileWhileStatement(statement: WhileStatement): ExpressionRef { + compileWhileStatement(statement: WhileStatement, contextualFlags: ContextualFlags): ExpressionRef { var module = this.module; var outerFlow = this.currentFlow; // The condition does not yet initialize a branch - var condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE), - this.currentType + var condExpr = module.precomputeExpression( + this.makeIsTrueish( + this.compileExpressionRetainType(statement.condition, Type.bool), + this.currentType + ) ); // Try to eliminate unnecesssary loops if the condition is constant - var condExprPrecomp = module.precomputeExpression(condExpr); if ( - getExpressionId(condExprPrecomp) == ExpressionId.Const && - getExpressionType(condExprPrecomp) == NativeType.I32 + getExpressionId(condExpr) == ExpressionId.Const && + getExpressionType(condExpr) == NativeType.I32 ) { - if (!getConstValueI32(condExprPrecomp)) return module.createNop(); - - // Otherwise recompile to the original and let the optimizer decide - } else /* if (condExpr != condExprPrecomp) <- not guaranteed */ { - condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE), - this.currentType - ); + if (!getConstValueI32(condExpr)) return module.createNop(); } // Statements initiate a new branch with its own break context @@ -2565,7 +2611,7 @@ export class Compiler extends DiagnosticEmitter { var alwaysTrue = false; // TODO var terminated = innerFlow.isAny(FlowFlags.ANY_TERMINATING); if (!terminated) { - this.releaseLocals(stmts, innerFlow); + this.performAutoreleases(innerFlow, stmts); stmts.push(module.createBreak(continueLabel)); } innerFlow.freeScopedLocals(); @@ -2601,12 +2647,12 @@ export class Compiler extends DiagnosticEmitter { compileInlineConstant( element: VariableLikeElement, contextualType: Type, - retainType: bool + contextualFlags: ContextualFlags ): ExpressionRef { assert(element.is(CommonFlags.INLINED)); var type = element.type; switch ( - !retainType && + !(contextualFlags & (ContextualFlags.IMPLICIT | ContextualFlags.EXPLICIT)) && type.is(TypeFlags.INTEGER) && contextualType.is(TypeFlags.INTEGER) && type.size < contextualType.size @@ -2681,36 +2727,34 @@ export class Compiler extends DiagnosticEmitter { compileExpression( expression: Expression, contextualType: Type, - conversionKind: ConversionKind, - wrapMode: WrapMode, - context: Element | null = null, - isLastStatementInBody: bool = false + contextualFlags: ContextualFlags = ContextualFlags.NONE ): ExpressionRef { this.currentType = contextualType; var expr: ExpressionRef; + if (contextualType == Type.void) contextualFlags |= ContextualFlags.WILL_DROP; switch (expression.kind) { case NodeKind.ASSERTION: { - expr = this.compileAssertionExpression(expression, contextualType); + expr = this.compileAssertionExpression(expression, contextualType, contextualFlags); break; } case NodeKind.BINARY: { - expr = this.compileBinaryExpression(expression, contextualType); + expr = this.compileBinaryExpression(expression, contextualType, contextualFlags); break; } case NodeKind.CALL: { - expr = this.compileCallExpression(expression, contextualType, isLastStatementInBody); + expr = this.compileCallExpression(expression, contextualType, contextualFlags); break; } case NodeKind.COMMA: { - expr = this.compileCommaExpression(expression, contextualType, conversionKind, wrapMode); + expr = this.compileCommaExpression(expression, contextualType, contextualFlags); break; } case NodeKind.ELEMENTACCESS: { - expr = this.compileElementAccessExpression(expression, contextualType); + expr = this.compileElementAccessExpression(expression, contextualType, contextualFlags); break; } case NodeKind.FUNCTION: { - expr = this.compileFunctionExpression(expression, contextualType.signatureReference); + expr = this.compileFunctionExpression(expression, contextualType.signatureReference, contextualFlags); break; } case NodeKind.IDENTIFIER: @@ -2719,47 +2763,39 @@ export class Compiler extends DiagnosticEmitter { case NodeKind.THIS: case NodeKind.SUPER: case NodeKind.TRUE: { - expr = this.compileIdentifierExpression( - expression, - contextualType, - conversionKind == ConversionKind.NONE // retain type of inlined constants - ); + expr = this.compileIdentifierExpression(expression, contextualType, contextualFlags); break; } case NodeKind.INSTANCEOF: { - expr = this.compileInstanceOfExpression(expression, contextualType); + expr = this.compileInstanceOfExpression(expression, contextualType, contextualFlags); break; } case NodeKind.LITERAL: { - expr = this.compileLiteralExpression(expression, contextualType, false, context); + expr = this.compileLiteralExpression(expression, contextualType, contextualFlags); break; } case NodeKind.NEW: { - expr = this.compileNewExpression(expression, contextualType); + expr = this.compileNewExpression(expression, contextualType, contextualFlags); break; } case NodeKind.PARENTHESIZED: { - expr = this.compileExpression((expression).expression, contextualType, conversionKind, wrapMode); + expr = this.compileExpression((expression).expression, contextualType, contextualFlags); break; } case NodeKind.PROPERTYACCESS: { - expr = this.compilePropertyAccessExpression( - expression, - contextualType, - conversionKind == ConversionKind.NONE // retain type of inlined constants - ); + expr = this.compilePropertyAccessExpression(expression, contextualType, contextualFlags); break; } case NodeKind.TERNARY: { - expr = this.compileTernaryExpression(expression, contextualType); + expr = this.compileTernaryExpression(expression, contextualType, contextualFlags); break; } case NodeKind.UNARYPOSTFIX: { - expr = this.compileUnaryPostfixExpression(expression, contextualType); + expr = this.compileUnaryPostfixExpression(expression, contextualType, contextualFlags); break; } case NodeKind.UNARYPREFIX: { - expr = this.compileUnaryPrefixExpression(expression, contextualType); + expr = this.compileUnaryPrefixExpression(expression, contextualType, contextualFlags); break; } default: { @@ -2770,53 +2806,64 @@ export class Compiler extends DiagnosticEmitter { expr = this.module.createUnreachable(); } } + // ensure conversion and wrapping in case the respective function doesn't on its own var currentType = this.currentType; - if (conversionKind != ConversionKind.NONE && currentType != contextualType) { - expr = this.convertExpression(expr, currentType, contextualType, conversionKind, wrapMode, expression); - this.currentType = contextualType; - } else if (wrapMode == WrapMode.WRAP) { - expr = this.ensureSmallIntegerWrap(expr, currentType); + var wrap = (contextualFlags & ContextualFlags.WRAP) != 0; + if (currentType != contextualType) { + if (contextualFlags & ContextualFlags.EXPLICIT) { + expr = this.convertExpression(expr, currentType, contextualType, true, wrap, expression); + wrap = false; + this.currentType = contextualType; + } else if (contextualFlags & ContextualFlags.IMPLICIT) { + expr = this.convertExpression(expr, currentType, contextualType, false, wrap, expression); + wrap = false; + this.currentType = contextualType; + } } - + if (wrap) expr = this.ensureSmallIntegerWrap(expr, currentType); + // debug location is added here so the caller doesn't have to. means: compilation of an expression + // must go through this function, with the respective per-kind functions not being used directly. if (this.options.sourceMap) this.addDebugLocation(expr, expression.range); return expr; } + /** Compiles an expression while retaining the type, that is not void, it ultimately compiles to. */ compileExpressionRetainType( expression: Expression, contextualType: Type, - wrapMode: WrapMode + contextualFlags: ContextualFlags = ContextualFlags.NONE ): ExpressionRef { - return this.compileExpression( - expression, + return this.compileExpression(expression, contextualType == Type.void - ? Type.i32 + ? Type.i32 // default to i32 : contextualType, - ConversionKind.NONE, - wrapMode + (contextualFlags & ~(ContextualFlags.IMPLICIT | ContextualFlags.EXPLICIT)) ); } + /** Compiles and precomputes an expression, possibly yielding a costant value. */ precomputeExpression( expression: Expression, contextualType: Type, - conversionKind: ConversionKind, - wrapMode: WrapMode + contextualFlags: ContextualFlags = ContextualFlags.NONE ): ExpressionRef { return this.module.precomputeExpression( - this.compileExpression(expression, contextualType, conversionKind, wrapMode) + this.compileExpression(expression, contextualType, contextualFlags) ); } convertExpression( expr: ExpressionRef, + /** Original type. */ fromType: Type, + /** New type. */ toType: Type, - conversionKind: ConversionKind, - wrapMode: WrapMode, + /** Whether the conversion is explicit.*/ + explicit: bool, + /** Whether the result should be wrapped, if a small integer. */ + wrap: bool, reportNode: Node ): ExpressionRef { - assert(conversionKind != ConversionKind.NONE); var module = this.module; // void to any @@ -2833,7 +2880,7 @@ export class Compiler extends DiagnosticEmitter { if (toType.kind == TypeKind.VOID) return module.createDrop(expr); if (!fromType.isAssignableTo(toType)) { - if (conversionKind == ConversionKind.IMPLICIT) { + if (!explicit) { if (fromType.nonNullableType == toType) { this.error( DiagnosticCode.Object_is_possibly_null, @@ -2875,7 +2922,7 @@ export class Compiler extends DiagnosticEmitter { if (fromType.kind == TypeKind.F32) { if (toType == Type.bool) { expr = module.createBinary(BinaryOp.NeF32, expr, module.createF32(0)); - wrapMode = WrapMode.NONE; + wrap = false; } else if (toType.is(TypeFlags.SIGNED)) { if (toType.is(TypeFlags.LONG)) { expr = module.createUnary(UnaryOp.TruncF32ToI64, expr); @@ -2894,7 +2941,7 @@ export class Compiler extends DiagnosticEmitter { } else { if (toType == Type.bool) { expr = module.createBinary(BinaryOp.NeF64, expr, module.createF64(0)); - wrapMode = WrapMode.NONE; + wrap = false; } else if (toType.is(TypeFlags.SIGNED)) { if (toType.is(TypeFlags.LONG)) { expr = module.createUnary(UnaryOp.TruncF64ToI64, expr); @@ -2964,7 +3011,7 @@ export class Compiler extends DiagnosticEmitter { // i64 to i32 or smaller if (toType == Type.bool) { expr = module.createBinary(BinaryOp.NeI64, expr, module.createI64(0)); - wrapMode = WrapMode.NONE; + wrap = false; } else if (!toType.is(TypeFlags.LONG)) { expr = module.createUnary(UnaryOp.WrapI64, expr); // discards upper bits } @@ -2975,7 +3022,7 @@ export class Compiler extends DiagnosticEmitter { fromType.is(TypeFlags.SIGNED) ? UnaryOp.ExtendI32 : UnaryOp.ExtendU32, this.ensureSmallIntegerWrap(expr, fromType) // must clear garbage bits ); - wrapMode = WrapMode.NONE; + wrap = false; // i32 to i32 } else { @@ -2984,19 +3031,23 @@ export class Compiler extends DiagnosticEmitter { // small i32 to larger i32 if (fromType.size < toType.size) { expr = this.ensureSmallIntegerWrap(expr, fromType); // must clear garbage bits - wrapMode = WrapMode.NONE; + wrap = false; } } } } this.currentType = toType; - return wrapMode == WrapMode.WRAP + return wrap ? this.ensureSmallIntegerWrap(expr, toType) : expr; } - compileAssertionExpression(expression: AssertionExpression, contextualType: Type): ExpressionRef { + compileAssertionExpression( + expression: AssertionExpression, + contextualType: Type, + contextualFlags: ContextualFlags + ): ExpressionRef { switch (expression.assertionKind) { case AssertionKind.PREFIX: case AssertionKind.AS: { @@ -3007,11 +3058,13 @@ export class Compiler extends DiagnosticEmitter { flow.contextualTypeArguments ); if (!toType) return this.module.createUnreachable(); - return this.compileExpression(expression.expression, toType, ConversionKind.EXPLICIT, WrapMode.NONE); + return this.compileExpression(expression.expression, toType, + contextualFlags | ContextualFlags.EXPLICIT + ); } case AssertionKind.NONNULL: { assert(!expression.toType); - let expr = this.compileExpressionRetainType(expression.expression, contextualType, WrapMode.NONE); + let expr = this.compileExpressionRetainType(expression.expression, contextualType); let type = this.currentType; if (!type.is(TypeFlags.NULLABLE | TypeFlags.REFERENCE) || this.currentFlow.isNonnull(type, expr)) { this.info( @@ -3043,7 +3096,8 @@ export class Compiler extends DiagnosticEmitter { compileBinaryExpression( expression: BinaryExpression, - contextualType: Type + contextualType: Type, + contextualFlags: ContextualFlags ): ExpressionRef { var module = this.module; var left = expression.left; @@ -3061,7 +3115,7 @@ export class Compiler extends DiagnosticEmitter { var operator = expression.operator; switch (operator) { case Token.LESSTHAN: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3081,23 +3135,17 @@ export class Compiler extends DiagnosticEmitter { return this.module.createUnreachable(); } - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, true)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -3167,7 +3215,7 @@ export class Compiler extends DiagnosticEmitter { break; } case Token.GREATERTHAN: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3187,23 +3235,17 @@ export class Compiler extends DiagnosticEmitter { return this.module.createUnreachable(); } - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, true)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -3273,7 +3315,7 @@ export class Compiler extends DiagnosticEmitter { break; } case Token.LESSTHAN_EQUALS: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3293,23 +3335,17 @@ export class Compiler extends DiagnosticEmitter { return this.module.createUnreachable(); } - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, true)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -3379,7 +3415,7 @@ export class Compiler extends DiagnosticEmitter { break; } case Token.GREATERTHAN_EQUALS: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3399,23 +3435,17 @@ export class Compiler extends DiagnosticEmitter { return this.module.createUnreachable(); } - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, true)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -3492,7 +3522,7 @@ export class Compiler extends DiagnosticEmitter { // checking for a possible use of unary EQZ. while the most classic of all optimizations, // that's not what the source told us to do. for reference, `!left` emits unary EQZ. - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3508,23 +3538,17 @@ export class Compiler extends DiagnosticEmitter { // still allow '==' with references } - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -3586,7 +3610,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.EXCLAMATION_EQUALS_EQUALS: case Token.EXCLAMATION_EQUALS: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3602,23 +3626,17 @@ export class Compiler extends DiagnosticEmitter { // still allow '!=' with references } - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -3683,7 +3701,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.PLUS_EQUALS: compound = true; case Token.PLUS: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3704,25 +3722,19 @@ export class Compiler extends DiagnosticEmitter { } if (compound) { - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, false, left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, false, right ); } else { @@ -3778,7 +3790,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.MINUS_EQUALS: compound = true; case Token.MINUS: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3799,26 +3811,20 @@ export class Compiler extends DiagnosticEmitter { } if (compound) { - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, false, left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, false, right ); } else { @@ -3874,7 +3880,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.ASTERISK_EQUALS: compound = true; case Token.ASTERISK: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3896,25 +3902,19 @@ export class Compiler extends DiagnosticEmitter { if (compound) { leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.WRAP); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, false, left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, false, right ); } else { @@ -3970,7 +3970,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.ASTERISK_ASTERISK_EQUALS: compound = true; case Token.ASTERISK_ASTERISK: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3994,7 +3994,7 @@ export class Compiler extends DiagnosticEmitter { // Mathf.pow if lhs is f32 (result is f32) if (this.currentType.kind == TypeKind.F32) { - rightExpr = this.compileExpression(right, Type.f32, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, Type.f32, ContextualFlags.IMPLICIT); rightType = this.currentType; if (!(instance = this.f32PowInstance)) { let namespace = this.program.lookupGlobal(CommonSymbols.Mathf); @@ -4022,21 +4022,13 @@ export class Compiler extends DiagnosticEmitter { // Math.pow otherwise (result is f64) // TODO: should the result be converted back? } else { - leftExpr = this.convertExpression( - leftExpr, - this.currentType, - Type.f64, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + this.currentType, Type.f64, + false, false, left ); leftType = this.currentType; - rightExpr = this.compileExpression( - right, - Type.f64, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); + rightExpr = this.compileExpression(right, Type.f64, ContextualFlags.IMPLICIT); rightType = this.currentType; if (!(instance = this.f64PowInstance)) { let namespace = this.program.lookupGlobal(CommonSymbols.Math); @@ -4070,7 +4062,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.SLASH_EQUALS: compound = true; case Token.SLASH: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -4092,26 +4084,20 @@ export class Compiler extends DiagnosticEmitter { if (compound) { leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.WRAP); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, // ! + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, // ! + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -4185,7 +4171,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.PERCENT_EQUALS: compound = true; case Token.PERCENT: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -4207,26 +4193,20 @@ export class Compiler extends DiagnosticEmitter { if (compound) { leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.WRAP); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, // ! + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, // ! + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -4357,7 +4337,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.LESSTHAN_LESSTHAN_EQUALS: compound = true; case Token.LESSTHAN_LESSTHAN: { - leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType.intType); leftType = this.currentType; // check operator overload @@ -4377,7 +4357,7 @@ export class Compiler extends DiagnosticEmitter { return this.module.createUnreachable(); } - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; switch (this.currentType.kind) { case TypeKind.I8: @@ -4423,7 +4403,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.GREATERTHAN_GREATERTHAN_EQUALS: compound = true; case Token.GREATERTHAN_GREATERTHAN: { - leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType.intType); leftType = this.currentType; // check operator overload @@ -4444,7 +4424,7 @@ export class Compiler extends DiagnosticEmitter { } leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); // must clear garbage bits - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.WRAP); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; switch (this.currentType.kind) { case TypeKind.I8: @@ -4511,7 +4491,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS: compound = true; case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN: { - leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType.intType); leftType = this.currentType; // check operator overload @@ -4532,7 +4512,7 @@ export class Compiler extends DiagnosticEmitter { } leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); // must clear garbage bits - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; switch (this.currentType.kind) { case TypeKind.U8: @@ -4580,7 +4560,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.AMPERSAND_EQUALS: compound = true; case Token.AMPERSAND: { - leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType.intType); leftType = this.currentType; // check operator overloadd @@ -4601,26 +4581,20 @@ export class Compiler extends DiagnosticEmitter { } if (compound) { - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, false, left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, false, right ); } else { @@ -4676,7 +4650,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.BAR_EQUALS: compound = true; case Token.BAR: { - leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType.intType); leftType = this.currentType; // check operator overload @@ -4697,26 +4671,20 @@ export class Compiler extends DiagnosticEmitter { } if (compound) { - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, false, left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, false, right ); } else { @@ -4775,7 +4743,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.CARET_EQUALS: compound = true; case Token.CARET: { - leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType.intType); leftType = this.currentType; // check operator overload @@ -4796,26 +4764,20 @@ export class Compiler extends DiagnosticEmitter { } if (compound) { - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, false, left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, false, right ); } else { @@ -4875,103 +4837,201 @@ export class Compiler extends DiagnosticEmitter { // logical (no overloading) - case Token.AMPERSAND_AMPERSAND: { // left && right - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + case Token.AMPERSAND_AMPERSAND: { // left && right -> (t = left) ? right : t + let flow = this.currentFlow; + leftExpr = this.compileExpressionRetainType(left, contextualType, contextualFlags); leftType = this.currentType; - let previousFlow = this.currentFlow; - let rightFlow = previousFlow.fork(); - this.currentFlow = rightFlow; - rightFlow.inheritNonnullIfTrue(leftExpr); - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); - rightType = leftType; - this.currentFlow = previousFlow; + // references must properly retain and release, with the same outcome independent of the branch taken + if (leftType.isManaged) { + + let leftAutoreleaseSkipped = this.skippedAutoreleases.has(leftExpr); + let tempLocal = flow.getTempLocal(leftType, false); + leftExpr = module.createTeeLocal(tempLocal.index, leftExpr); + + let rightFlow = flow.fork(); + this.currentFlow = rightFlow; + rightFlow.inheritNonnullIfTrue(leftExpr); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT | contextualFlags); + rightType = leftType; + let rightAutoreleaseSkipped = this.skippedAutoreleases.has(rightExpr); + + // instead of retaining left and releasing it again in right when right + // is taken, we can also just retain left if right is not taken + let retainLeftInElse = false; + if (leftAutoreleaseSkipped != rightAutoreleaseSkipped) { // xor + if (!leftAutoreleaseSkipped) { + retainLeftInElse = true; + } else { + rightExpr = this.makeRetain(rightExpr); + rightAutoreleaseSkipped = true; + } + } else if (!(contextualFlags & ContextualFlags.SKIP_AUTORELEASE)) { // otherwise keep right alive a little longer + rightExpr = this.moveAutorelease(rightExpr, rightFlow, flow); + } + + let rightStmts = new Array(); + if (leftAutoreleaseSkipped) { // left turned out to be true'ish and is dropped + rightStmts.unshift( + this.makeRelease( + module.createGetLocal(tempLocal.index, leftType.toNativeType()) + ) + ); + } + rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType, rightStmts); + rightFlow.freeScopedLocals(); + this.currentFlow = flow; - // simplify if only interested in true or false - if (contextualType == Type.bool || contextualType == Type.void) { - this.currentType = Type.bool; expr = module.createIf( this.makeIsTrueish(leftExpr, leftType), - this.makeIsTrueish(rightExpr, rightType), - module.createI32(0) - ); - - // simplify if cloning left without side effects is possible - } else if (expr = module.cloneExpression(leftExpr, true, 0)) { - expr = module.createIf( - this.makeIsTrueish(leftExpr, this.currentType), rightExpr, - expr + retainLeftInElse + ? this.makeRetain( + module.createGetLocal(tempLocal.index, leftType.toNativeType()) + ) + : module.createGetLocal(tempLocal.index, leftType.toNativeType()) ); + if (leftAutoreleaseSkipped || rightAutoreleaseSkipped) this.skippedAutoreleases.add(expr); + if (tempLocal) flow.freeTempLocal(tempLocal); - // if not possible, tee left to a temp. local + // basic values can use more aggressive optimizations } else { - let flow = this.currentFlow; - let tempLocal = flow.getAndFreeTempLocal( - this.currentType, - !flow.canOverflow(leftExpr, this.currentType) - ); - expr = module.createIf( - this.makeIsTrueish( - module.createTeeLocal(tempLocal.index, leftExpr), - this.currentType - ), - rightExpr, - module.createGetLocal( - assert(tempLocal).index, // to be sure - this.currentType.toNativeType() - ) - ); + + let rightFlow = flow.fork(); + this.currentFlow = rightFlow; + rightFlow.inheritNonnullIfTrue(leftExpr); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT | contextualFlags); + rightType = leftType; + rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType); + rightFlow.freeScopedLocals(); + this.currentFlow = flow; + + // simplify if only interested in true or false + if (contextualType == Type.bool || contextualType == Type.void) { + this.currentType = Type.bool; + expr = module.createIf( + this.makeIsTrueish(leftExpr, leftType), + this.makeIsTrueish(rightExpr, rightType), + module.createI32(0) + ); + + // simplify if cloning left without side effects is possible + } else if (expr = module.cloneExpression(leftExpr, true, 0)) { + expr = module.createIf( + this.makeIsTrueish(leftExpr, this.currentType), + rightExpr, + expr + ); + + // if not possible, tee left to a temp + } else { + let tempLocal = flow.getTempLocal(leftType, !flow.canOverflow(leftExpr, leftType)); + expr = module.createIf( + this.makeIsTrueish(module.createTeeLocal(tempLocal.index, leftExpr), leftType), + rightExpr, + module.createGetLocal(tempLocal.index, leftType.toNativeType()) + ); + } } break; } - case Token.BAR_BAR: { // left || right - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + case Token.BAR_BAR: { // left || right -> ((t = left) ? t : right) + let flow = this.currentFlow; + leftExpr = this.compileExpressionRetainType(left, contextualType, contextualFlags); leftType = this.currentType; - let previousFlow = this.currentFlow; - let rightFlow = previousFlow.fork(); - this.currentFlow = rightFlow; - rightFlow.inheritNonnullIfFalse(leftExpr); - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); - rightType = leftType; - this.currentFlow = previousFlow; + // references must properly retain and release, with the same outcome independent of the branch taken + if (leftType.isManaged) { + + let leftAutoreleaseSkipped = this.skippedAutoreleases.has(leftExpr); + let tempLocal = flow.getTempLocal(leftType, false); + leftExpr = module.createTeeLocal(tempLocal.index, leftExpr); + + let rightFlow = flow.fork(); + this.currentFlow = rightFlow; + rightFlow.inheritNonnullIfFalse(leftExpr); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT | contextualFlags); + rightType = leftType; + let rightAutoreleaseSkipped = this.skippedAutoreleases.has(rightExpr); + + // instead of retaining left and releasing it again in right when right + // is taken, we can also just retain left if right is not taken + let retainLeftInThen = false; + if (leftAutoreleaseSkipped != rightAutoreleaseSkipped) { // xor + if (!leftAutoreleaseSkipped) { + retainLeftInThen = true; + } else { + rightExpr = this.makeRetain(rightExpr); + rightAutoreleaseSkipped = true; + } + } else if (!(contextualFlags & ContextualFlags.SKIP_AUTORELEASE)) { // otherwise keep right alive a little longer + rightExpr = this.moveAutorelease(rightExpr, rightFlow, flow); + } + + let rightStmts = new Array(); + if (leftAutoreleaseSkipped) { // left turned out to be false'ish and is dropped + // TODO: usually, false'ish means left is null, but this might not hold + // once implicit conversion with strings is performed and left is "", so: + rightStmts.unshift( + this.makeRelease( + module.createGetLocal(tempLocal.index, leftType.toNativeType()) + ) + ); + } + rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType, rightStmts); + rightFlow.freeScopedLocals(); + this.currentFlow = flow; - // simplify if only interested in true or false - if (contextualType == Type.bool || contextualType == Type.void) { - this.currentType = Type.bool; expr = module.createIf( this.makeIsTrueish(leftExpr, leftType), - module.createI32(1), - this.makeIsTrueish(rightExpr, rightType) - ); - - // simplify if cloning left without side effects is possible - } else if (expr = module.cloneExpression(leftExpr, true, 0)) { - expr = module.createIf( - this.makeIsTrueish(leftExpr, this.currentType), - expr, + retainLeftInThen + ? this.makeRetain( + module.createGetLocal(tempLocal.index, leftType.toNativeType()) + ) + : module.createGetLocal(tempLocal.index, leftType.toNativeType()), rightExpr ); + if (leftAutoreleaseSkipped || rightAutoreleaseSkipped) this.skippedAutoreleases.add(expr); + if (tempLocal) flow.freeTempLocal(tempLocal); - // if not possible, tee left to a temp. local + // basic values can use more aggressive optimizations } else { - let flow = this.currentFlow; - let tempLocal = flow.getAndFreeTempLocal( - this.currentType, - !flow.canOverflow(leftExpr, this.currentType) - ); - expr = module.createIf( - this.makeIsTrueish( - module.createTeeLocal(tempLocal.index, leftExpr), - this.currentType - ), - module.createGetLocal( - assert(tempLocal).index, // to be sure - this.currentType.toNativeType() - ), - rightExpr - ); + + let rightFlow = flow.fork(); + this.currentFlow = rightFlow; + rightFlow.inheritNonnullIfFalse(leftExpr); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT | contextualFlags); + rightType = leftType; + rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType); + rightFlow.freeScopedLocals(); + this.currentFlow = flow; + + // simplify if only interested in true or false + if (contextualType == Type.bool || contextualType == Type.void) { + this.currentType = Type.bool; + expr = module.createIf( + this.makeIsTrueish(leftExpr, leftType), + module.createI32(1), + this.makeIsTrueish(rightExpr, rightType) + ); + + // simplify if cloning left without side effects is possible + } else if (expr = module.cloneExpression(leftExpr, true, 0)) { + expr = module.createIf( + this.makeIsTrueish(leftExpr, this.currentType), + expr, + rightExpr + ); + + // if not possible, tee left to a temp. local + } else { + let tempLocal = flow.getAndFreeTempLocal(this.currentType, !flow.canOverflow(leftExpr, this.currentType)); + expr = module.createIf( + this.makeIsTrueish(module.createTeeLocal(tempLocal.index, leftExpr), this.currentType), + module.createGetLocal(tempLocal.index, this.currentType.toNativeType()), + rightExpr + ); + } } break; } @@ -4980,13 +5040,18 @@ export class Compiler extends DiagnosticEmitter { expr = this.module.createUnreachable(); } } - return compound - ? this.compileAssignmentWithValue( - left, - expr, - contextualType != Type.void - ) - : expr; + if (!compound) return expr; + var resolver = this.resolver; + var target = this.resolver.resolveExpression(left, this.currentFlow); + if (!target) return module.createUnreachable(); + return this.makeAssignment( + target, + expr, // TODO: delay release above if possible? + left, + resolver.currentThisExpression, + resolver.currentElementExpression, + contextualType != Type.void + ); } compileUnaryOverload( @@ -4995,21 +5060,9 @@ export class Compiler extends DiagnosticEmitter { valueExpr: ExpressionRef, reportNode: Node ): ExpressionRef { - var argumentExpressions: Expression[]; - var thisArg: ExpressionRef = 0; - if (operatorInstance.is(CommonFlags.INSTANCE)) { - thisArg = valueExpr; // can reuse the previously evaluated expr as the this value here - argumentExpressions = []; - } else { - argumentExpressions = [ value ]; // annotated type might differ -> recompile - } - this.currentType = operatorInstance.signature.returnType; - return this.compileCallDirect( - operatorInstance, - argumentExpressions, - reportNode, - thisArg - ); + // FIXME: see comment in compileBinaryOverload below why recompiling on type mismatch + // is a bad idea currently. so this assumes that the type matches. + return this.makeCallDirect(operatorInstance, [ valueExpr ], reportNode, false); } compileBinaryOverload( @@ -5019,22 +5072,23 @@ export class Compiler extends DiagnosticEmitter { right: Expression, reportNode: Node ): ExpressionRef { - var argumentExpressions: Expression[]; - var thisArg: ExpressionRef = 0; + var rightType: Type; if (operatorInstance.is(CommonFlags.INSTANCE)) { let classInstance = assert(operatorInstance.parent); assert(classInstance.kind == ElementKind.CLASS); - thisArg = leftExpr; // can reuse the previously evaluated leftExpr as the this value here - argumentExpressions = [ right ]; + rightType = operatorInstance.signature.parameterTypes[0]; } else { - argumentExpressions = [ left, right ]; // annotated type of LHS might differ -> recompile + // FIXME: if LHS type differs we can't recompile left because that'd completely confuse + // local states, like having retained locals that actually do not even exist, possibly + // releasing something random in that local before and evil things like that. Hence this + // assumes that LHS type matches, which in turn means that static overloads must be + // guaranteed to never mismatch LHS type, which in turn means that we can't have shiny + // things like multiple static overloads for different combinations of LHS/RHS types. + // We might want that at some point of course, but requires to complete the resolver so + // it can actually resolve every kind of expression without ever having to recompile. + rightType = operatorInstance.signature.parameterTypes[1]; } - this.currentType = operatorInstance.signature.returnType; - return this.compileCallDirect( - operatorInstance, - argumentExpressions, - reportNode, - thisArg - ); + var rightExpr = this.compileExpression(right, rightType, ContextualFlags.IMPLICIT); + return this.makeCallDirect(operatorInstance, [ leftExpr, rightExpr ], reportNode); } compileAssignment(expression: Expression, valueExpression: Expression, contextualType: Type): ExpressionRef { @@ -5043,22 +5097,25 @@ export class Compiler extends DiagnosticEmitter { var flow = this.currentFlow; var target = resolver.resolveExpression(expression, flow); // reports if (!target) return this.module.createUnreachable(); + var thisExpression = resolver.currentThisExpression; + var elementExpression = resolver.currentElementExpression; // to compile just the value, we need to know the target's type var targetType: Type; switch (target.kind) { case ElementKind.GLOBAL: { - if (!this.compileGlobal(target)) { // reports; not yet compiled if a static field compiled as a global - return this.module.createUnreachable(); - } - assert((target).type != Type.void); // compileGlobal must guarantee this + // not yet compiled if a static field compiled as a global + if (!this.compileGlobal(target)) return this.module.createUnreachable(); // reports // fall-through } - case ElementKind.LOCAL: case ElementKind.FIELD: { targetType = (target).type; break; } + case ElementKind.LOCAL: { + targetType = (target).type; + break; + } case ElementKind.PROPERTY_PROTOTYPE: { // static property let setterPrototype = (target).setterPrototype; if (!setterPrototype) { @@ -5088,7 +5145,6 @@ export class Compiler extends DiagnosticEmitter { break; } case ElementKind.CLASS: { - let elementExpression = resolver.currentElementExpression; if (elementExpression) { // indexed access let isUnchecked = flow.is(FlowFlags.UNCHECKED_CONTEXT); // if (isUnchecked) { @@ -5137,30 +5193,43 @@ export class Compiler extends DiagnosticEmitter { // compile the value and do the assignment assert(targetType != Type.void); - var valueExpr = this.compileExpression(valueExpression, targetType, ConversionKind.IMPLICIT, WrapMode.NONE); - return this.compileAssignmentWithValue( + return this.makeAssignment( + target, + this.compileExpression(valueExpression, targetType, ContextualFlags.IMPLICIT | ContextualFlags.SKIP_AUTORELEASE), expression, - valueExpr, + thisExpression, + elementExpression, contextualType != Type.void ); } - compileAssignmentWithValue( - expression: Expression, + /** Makes an assignment expression or block, assigning a value to a target. */ + makeAssignment( + /** Target element, e.g. a Local. */ + target: Element, + /** Value expression that has been compiled in a previous step already. */ valueExpr: ExpressionRef, + /** Expression reference. Has already been compiled to `valueExpr`. */ + valueExpression: Expression, + /** `this` expression reference if a field or property set. */ + thisExpression: Expression | null, + /** Index expression reference if an indexed set. */ + indexExpression: Expression | null, + /** Whether to tee the value. */ tee: bool ): ExpressionRef { var module = this.module; var flow = this.currentFlow; - var target = this.resolver.resolveExpression(expression, flow); // reports - if (!target) return module.createUnreachable(); + + // NOTE: Only locals, globals and fields can make use of skipped autoreleases while + // everything else must insert the skipped autorelease now. See (*) switch (target.kind) { case ElementKind.LOCAL: { if (target.is(CommonFlags.CONST)) { this.error( DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, - expression.range, target.internalName + valueExpression.range, target.internalName ); this.currentType = tee ? (target).type : Type.void; return module.createUnreachable(); @@ -5172,7 +5241,7 @@ export class Compiler extends DiagnosticEmitter { if (target.is(CommonFlags.CONST)) { this.error( DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, - expression.range, + valueExpression.range, target.internalName ); this.currentType = tee ? (target).type : Type.void; @@ -5191,33 +5260,34 @@ export class Compiler extends DiagnosticEmitter { ) { this.error( DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, - expression.range, (target).internalName + valueExpression.range, (target).internalName ); return module.createUnreachable(); } return this.makeFieldAssignment(target, valueExpr, this.compileExpressionRetainType( - assert(this.resolver.currentThisExpression), + assert(thisExpression), // FIXME: explicit type (currently fails due to missing null checking) - this.options.usizeType, WrapMode.NONE + this.options.usizeType ), tee ); } case ElementKind.PROPERTY_PROTOTYPE: { // static property + if (this.skippedAutoreleases.has(valueExpr)) valueExpr = this.makeAutorelease(valueExpr, flow); // (*) let setterPrototype = (target).setterPrototype; if (!setterPrototype) { this.error( DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, - expression.range, target.internalName + valueExpression.range, target.internalName ); return module.createUnreachable(); } let setterInstance = this.resolver.resolveFunction(setterPrototype, null, makeMap(), ReportMode.REPORT); if (!setterInstance) return module.createUnreachable(); // call just the setter if the return value isn't of interest - if (!tee) return this.makeCallDirect(setterInstance, [ valueExpr ], expression); + if (!tee) return this.makeCallDirect(setterInstance, [ valueExpr ], valueExpression); // otherwise call the setter first, then the getter let getterPrototype = assert((target).getterPrototype); // must be present let getterInstance = this.resolver.resolveFunction(getterPrototype, null, makeMap(), ReportMode.REPORT); @@ -5225,35 +5295,35 @@ export class Compiler extends DiagnosticEmitter { let returnType = getterInstance.signature.returnType; let nativeReturnType = returnType.toNativeType(); return module.createBlock(null, [ - this.makeCallDirect(setterInstance, [ valueExpr ], expression), - this.makeCallDirect(getterInstance, null, expression) // sets currentType + this.makeCallDirect(setterInstance, [ valueExpr ], valueExpression), + this.makeCallDirect(getterInstance, null, valueExpression) // sets currentType ], nativeReturnType); } case ElementKind.PROPERTY: { // instance property + if (this.skippedAutoreleases.has(valueExpr)) valueExpr = this.makeAutorelease(valueExpr, flow); // (*) let setterInstance = (target).setterInstance; if (!setterInstance) { this.error( DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, - expression.range, target.internalName + valueExpression.range, target.internalName ); return module.createUnreachable(); } // call just the setter if the return value isn't of interest if (!tee) { let thisExpr = this.compileExpressionRetainType( - assert(this.resolver.currentThisExpression), - this.options.usizeType, WrapMode.NONE + assert(thisExpression), + this.options.usizeType ); - return this.makeCallDirect(setterInstance, [ thisExpr, valueExpr ], expression); + return this.makeCallDirect(setterInstance, [ thisExpr, valueExpr ], valueExpression); } // otherwise call the setter first, then the getter let getterInstance = assert((target).getterInstance); // must be present let returnType = getterInstance.signature.returnType; let nativeReturnType = returnType.toNativeType(); let thisExpr = this.compileExpressionRetainType( - assert(this.resolver.currentThisExpression), - this.options.usizeType, - WrapMode.NONE + assert(thisExpression), + this.options.usizeType ); let tempLocal = flow.getAndFreeTempLocal(returnType, false); let tempLocalIndex = tempLocal.index; @@ -5261,34 +5331,21 @@ export class Compiler extends DiagnosticEmitter { this.makeCallDirect(setterInstance, [ // set and remember the target module.createTeeLocal(tempLocalIndex, thisExpr), valueExpr - ], expression), + ], valueExpression), this.makeCallDirect(getterInstance, [ // get from remembered target module.createGetLocal(tempLocalIndex, nativeReturnType) - ], expression) + ], valueExpression) ], nativeReturnType); } case ElementKind.CLASS: { - let elementExpression = this.resolver.currentElementExpression; - if (elementExpression) { + if (this.skippedAutoreleases.has(valueExpr)) valueExpr = this.makeAutorelease(valueExpr, flow); // (*) + if (indexExpression) { let isUnchecked = flow.is(FlowFlags.UNCHECKED_CONTEXT); - // if (isUnchecked) { - // let arrayType = this.program.determineBuiltinArrayType(target); - // if (arrayType) { - // return compileBuiltinArraySetWithValue( - // this, - // target, - // assert(this.resolver.currentThisExpression), - // elementExpression, - // valueExpr, - // tee - // ); - // } - // } let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET, isUnchecked); if (!indexedGet) { this.error( DiagnosticCode.Index_signature_is_missing_in_type_0, - expression.range, target.internalName + valueExpression.range, target.internalName ); return module.createUnreachable(); } @@ -5296,24 +5353,17 @@ export class Compiler extends DiagnosticEmitter { if (!indexedSet) { this.error( DiagnosticCode.Index_signature_in_type_0_only_permits_reading, - expression.range, target.internalName + valueExpression.range, target.internalName ); this.currentType = tee ? indexedGet.signature.returnType : Type.void; return module.createUnreachable(); } let targetType = (target).type; - let thisExpression = assert(this.resolver.currentThisExpression); let thisExpr = this.compileExpressionRetainType( - thisExpression, - this.options.usizeType, - WrapMode.NONE - ); - let elementExpr = this.compileExpression( - elementExpression, - Type.i32, - ConversionKind.IMPLICIT, - WrapMode.NONE + assert(thisExpression), + this.options.usizeType ); + let elementExpr = this.compileExpression(indexExpression, Type.i32, ContextualFlags.IMPLICIT); if (tee) { let tempLocalTarget = flow.getTempLocal(targetType, false); let tempLocalElement = flow.getAndFreeTempLocal(this.currentType, false); @@ -5324,18 +5374,18 @@ export class Compiler extends DiagnosticEmitter { module.createTeeLocal(tempLocalTarget.index, thisExpr), module.createTeeLocal(tempLocalElement.index, elementExpr), valueExpr - ], expression), + ], valueExpression), this.makeCallDirect(indexedGet, [ module.createGetLocal(tempLocalTarget.index, tempLocalTarget.type.toNativeType()), module.createGetLocal(tempLocalElement.index, tempLocalElement.type.toNativeType()) - ], expression) + ], valueExpression) ], returnType.toNativeType()); } else { return this.makeCallDirect(indexedSet, [ thisExpr, elementExpr, valueExpr - ], expression); + ], valueExpression); } } // fall-through @@ -5343,16 +5393,20 @@ export class Compiler extends DiagnosticEmitter { } this.error( DiagnosticCode.Operation_not_supported, - expression.range + valueExpression.range ); return module.createUnreachable(); } /** Makes an assignment to a local, possibly retaining and releasing affected references and keeping track of wrap and null states. */ - makeLocalAssignment( + private makeLocalAssignment( + /** The local to assign to. */ local: Local, + /** The value to assign. */ valueExpr: ExpressionRef, + /** Whether to tee the value. */ tee: bool, + /** Whether the value is possibly null. */ possiblyNull: bool ): ExpressionRef { var type = local.type; @@ -5360,61 +5414,71 @@ export class Compiler extends DiagnosticEmitter { var flow = this.currentFlow; var localIndex = local.index; - if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) { - if (!flow.canOverflow(valueExpr, type)) flow.setLocalFlag(localIndex, LocalFlags.WRAPPED); - else flow.unsetLocalFlag(localIndex, LocalFlags.WRAPPED); - } - if (type.is(TypeFlags.NULLABLE)) { if (possiblyNull) flow.unsetLocalFlag(localIndex, LocalFlags.NONNULL); else flow.setLocalFlag(localIndex, LocalFlags.NONNULL); } if (type.isManaged) { - let program = this.program; let module = this.module; let nativeType = type.toNativeType(); - if (flow.isAnyLocalFlag(localIndex, LocalFlags.ANY_AUTORELEASE)) { - let retainReleaseInstance = program.retainReleaseInstance; - this.compileFunction(retainReleaseInstance); - if (tee) { // TEE(local = __retainRelease(value, local)) - this.currentType = type; - return module.createTeeLocal(localIndex, - module.createCall(retainReleaseInstance.internalName, [ - valueExpr, - module.createGetLocal(localIndex, nativeType) - ], nativeType) - ); - } else { // local = __retainRelease(value, local) - this.currentType = Type.void; - return module.createSetLocal(localIndex, - module.createCall(retainReleaseInstance.internalName, [ - valueExpr, - module.createGetLocal(localIndex, nativeType) - ], nativeType) - ); + + if (flow.isAnyLocalFlag(localIndex, LocalFlags.ANY_RETAINED)) { + if (this.skippedAutoreleases.has(valueExpr)) { + if (tee) { // TEE(local = { __release(local), value }) + this.currentType = type; + return module.createTeeLocal(localIndex, + module.createBlock(null, [ + this.makeRelease(module.createGetLocal(localIndex, nativeType)), + valueExpr + ], nativeType) + ); + } else { // local = { __release(local), value } + this.currentType = Type.void; + return module.createSetLocal(localIndex, + module.createBlock(null, [ + this.makeRelease(module.createGetLocal(localIndex, nativeType)), + valueExpr + ], nativeType) + ); + } + } else { + if (tee) { // TEE(local = {__retainRelease(value, local)) + this.currentType = type; + return module.createTeeLocal(localIndex, + this.makeRetainRelease(valueExpr, module.createGetLocal(localIndex, nativeType)) + ); + } else { // local = __retainRelease(value, local) + this.currentType = Type.void; + return module.createSetLocal(localIndex, + this.makeRetainRelease(valueExpr, module.createGetLocal(localIndex, nativeType)) + ); + } } } else { - flow.setLocalFlag(localIndex, LocalFlags.AUTORELEASE); - let retainInstance = program.retainInstance; - this.compileFunction(retainInstance); + flow.unsetLocalFlag(localIndex, LocalFlags.CONDITIONALLY_RETAINED); + flow.setLocalFlag(localIndex, LocalFlags.RETAINED); if (tee) { // TEE(local = __retain(value, local)) this.currentType = type; return module.createTeeLocal(localIndex, - module.createCall(retainInstance.internalName, [ - valueExpr - ], nativeType) + this.skippedAutoreleases.has(valueExpr) + ? valueExpr + : this.makeRetain(valueExpr) ); } else { // local = __retain(value, local) this.currentType = Type.void; return module.createSetLocal(localIndex, - module.createCall(retainInstance.internalName, [ - valueExpr - ], nativeType) + this.skippedAutoreleases.has(valueExpr) + ? valueExpr + : this.makeRetain(valueExpr) ); } } } else { + if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) { + if (!flow.canOverflow(valueExpr, type)) flow.setLocalFlag(localIndex, LocalFlags.WRAPPED); + else flow.unsetLocalFlag(localIndex, LocalFlags.WRAPPED); + } if (tee) { // TEE(local = value) this.currentType = type; return this.module.createTeeLocal(localIndex, valueExpr); @@ -5426,36 +5490,64 @@ export class Compiler extends DiagnosticEmitter { } /** Makes an assignment to a global, possibly retaining and releasing affected references. */ - makeGlobalAssignment(global: Global, valueExpr: ExpressionRef, tee: bool): ExpressionRef { + private makeGlobalAssignment( + /** The global to assign to. */ + global: Global, + /** The value to assign. */ + valueExpr: ExpressionRef, + /** Whether to tee the value. */ + tee: bool + ): ExpressionRef { var module = this.module; - var program = this.program; var type = global.type; assert(type != Type.void); var nativeType = type.toNativeType(); if (type.isManaged) { - let retainReleaseInstance = program.retainReleaseInstance; - this.compileFunction(retainReleaseInstance); - if (tee) { // (global = __retainRelease(t1 = value, global)), t1 - let tempValue = this.currentFlow.getAndFreeTempLocal(type, true); // globals are wrapped - this.currentType = type; - return module.createBlock(null, [ - module.createSetGlobal(global.internalName, - module.createCall(retainReleaseInstance.internalName, [ - module.createTeeLocal(tempValue.index, valueExpr), - module.createGetGlobal(global.internalName, nativeType) + if (this.skippedAutoreleases.has(valueExpr)) { + if (tee) { // (global = (__release(global), t1 = value)), t1 + let tempValue = this.currentFlow.getAndFreeTempLocal(type, true); // globals are wrapped + this.currentType = type; + return module.createBlock(null, [ + module.createSetGlobal(global.internalName, + module.createBlock(null, [ + this.makeRelease(module.createGetGlobal(global.internalName, nativeType)), + module.createTeeLocal(tempValue.index, valueExpr) + ], nativeType) + ), + module.createGetLocal(tempValue.index, nativeType) + ], nativeType); + } else { // global = (__release(global), value) + this.currentType = Type.void; + return module.createSetGlobal(global.internalName, + module.createBlock(null, [ + this.makeRelease(module.createGetGlobal(global.internalName, nativeType)), + valueExpr ], nativeType) - ), - module.createGetLocal(tempValue.index, nativeType) - ], nativeType); - } else { // global = __retainRelease(value, global) - this.currentType = Type.void; - return module.createSetGlobal(global.internalName, - module.createCall(retainReleaseInstance.internalName, [ - valueExpr, - module.createGetGlobal(global.internalName, nativeType) - ], nativeType) - ); + ); + } + } else { + if (tee) { // (global = __retainRelease(t1 = value, global)), t1 + let tempValue = this.currentFlow.getAndFreeTempLocal(type, true); // globals are wrapped + this.currentType = type; + return module.createBlock(null, [ + module.createSetGlobal(global.internalName, + this.makeRetainRelease( + module.createTeeLocal(tempValue.index, valueExpr), + module.createGetGlobal(global.internalName, nativeType) + ) + ), + module.createGetLocal(tempValue.index, nativeType) + ], nativeType); + } else { // global = __retainRelease(value, global) + this.currentType = Type.void; + return module.createSetGlobal(global.internalName, + this.makeRetainRelease( + valueExpr, + module.createGetGlobal(global.internalName, nativeType) + ) + ); + } } } else { valueExpr = this.ensureSmallIntegerWrap(valueExpr, type); // globals must be wrapped @@ -5478,9 +5570,17 @@ export class Compiler extends DiagnosticEmitter { } /** Makes an assignment to a field, possibly retaining and releasing affected references. */ - makeFieldAssignment(field: Field, valueExpr: ExpressionRef, thisExpr: ExpressionRef, tee: bool): ExpressionRef { + makeFieldAssignment( + /** The field to assign to. */ + field: Field, + /** The value to assign. */ + valueExpr: ExpressionRef, + /** The value of `this`. */ + thisExpr: ExpressionRef, + /** Whether to tee the value. */ + tee: bool + ): ExpressionRef { var module = this.module; - var program = this.program; var flow = this.currentFlow; var fieldType = field.type; var nativeFieldType = fieldType.toNativeType(); @@ -5490,40 +5590,78 @@ export class Compiler extends DiagnosticEmitter { if (fieldType.isManaged && thisType.isManaged) { let tempThis = flow.getTempLocal(thisType, false); - let retainReleaseInstance = program.retainReleaseInstance; - this.compileFunction(retainReleaseInstance); - if (tee) { // ((t1 = this).field = __retainRelease(t2 = value, t1.field)), t2 - let tempValue = flow.getAndFreeTempLocal(fieldType, !flow.canOverflow(valueExpr, fieldType)); - flow.freeTempLocal(tempThis); - this.currentType = fieldType; - return module.createBlock(null, [ - module.createStore(fieldType.byteSize, + if (this.skippedAutoreleases.has(valueExpr)) { + if (tee) { // ((t1 = this).field = (__release(t1.field), t2 = value)), t2 + let tempValue = flow.getAndFreeTempLocal(fieldType, !flow.canOverflow(valueExpr, fieldType)); + flow.freeTempLocal(tempThis); + this.currentType = fieldType; + return module.createBlock(null, [ + module.createStore(fieldType.byteSize, + module.createTeeLocal(tempThis.index, thisExpr), + module.createBlock(null, [ + this.makeRelease( + module.createLoad(fieldType.byteSize, fieldType.is(TypeFlags.SIGNED), // oldRef + module.createGetLocal(tempThis.index, nativeThisType), + nativeFieldType, field.memoryOffset + ) + ), + module.createTeeLocal(tempValue.index, valueExpr) + ], nativeFieldType), + nativeFieldType, field.memoryOffset + ), + module.createGetLocal(tempValue.index, nativeFieldType) + ], nativeFieldType); + } else { // (t1 = this).field = (__release(t1.field), value) + flow.freeTempLocal(tempThis); + this.currentType = Type.void; + return module.createStore(fieldType.byteSize, module.createTeeLocal(tempThis.index, thisExpr), - module.createCall(retainReleaseInstance.internalName, [ - module.createTeeLocal(tempValue.index, valueExpr), // newRef + module.createBlock(null, [ + this.makeRelease( + module.createLoad(fieldType.byteSize, fieldType.is(TypeFlags.SIGNED), // oldRef + module.createGetLocal(tempThis.index, nativeThisType), + nativeFieldType, field.memoryOffset + ) + ), + valueExpr + ], nativeFieldType), + nativeFieldType, field.memoryOffset + ); + } + } else { + if (tee) { // ((t1 = this).field = __retainRelease(t2 = value, t1.field)), t2 + let tempValue = flow.getAndFreeTempLocal(fieldType, !flow.canOverflow(valueExpr, fieldType)); + flow.freeTempLocal(tempThis); + this.currentType = fieldType; + return module.createBlock(null, [ + module.createStore(fieldType.byteSize, + module.createTeeLocal(tempThis.index, thisExpr), + this.makeRetainRelease( + module.createTeeLocal(tempValue.index, valueExpr), // newRef + module.createLoad(fieldType.byteSize, fieldType.is(TypeFlags.SIGNED), // oldRef + module.createGetLocal(tempThis.index, nativeThisType), + nativeFieldType, field.memoryOffset + ) + ), + nativeFieldType, field.memoryOffset + ), + module.createGetLocal(tempValue.index, nativeFieldType) + ], nativeFieldType); + } else { // (t1 = this).field = __retainRelease(value, t1.field) + flow.freeTempLocal(tempThis); + this.currentType = Type.void; + return module.createStore(fieldType.byteSize, + module.createTeeLocal(tempThis.index, thisExpr), + this.makeRetainRelease( + valueExpr, // newRef module.createLoad(fieldType.byteSize, fieldType.is(TypeFlags.SIGNED), // oldRef module.createGetLocal(tempThis.index, nativeThisType), nativeFieldType, field.memoryOffset ) - ], nativeFieldType), + ), nativeFieldType, field.memoryOffset - ), - module.createGetLocal(tempValue.index, nativeFieldType) - ], nativeFieldType); - } else { // (t1 = this).field = __retainRelease(value, t1.field) - flow.freeTempLocal(tempThis); - this.currentType = Type.void; - return module.createStore(fieldType.byteSize, - module.createTeeLocal(tempThis.index, thisExpr), - module.createCall(retainReleaseInstance.internalName, [ - valueExpr, // newRef - module.createLoad(fieldType.byteSize, fieldType.is(TypeFlags.SIGNED), // oldRef - module.createGetLocal(tempThis.index, nativeThisType), - nativeFieldType, field.memoryOffset - ) - ], nativeFieldType), - nativeFieldType, field.memoryOffset - ); + ); + } } } else { if (tee) { // (this.field = (t1 = value)), t1 @@ -5548,11 +5686,16 @@ export class Compiler extends DiagnosticEmitter { } } + /** Compiles a call expression according to the specified context. */ compileCallExpression( + /** Call expression to compile. */ expression: CallExpression, + /** Contextual type indicating the return type the caller expects, if any. */ contextualType: Type, - isLastStatementInBody: bool = false + /** Contextual flags indicating contextual conditions. */ + contextualFlags: ContextualFlags ): ExpressionRef { + var module = this.module; var flow = this.currentFlow; @@ -5587,7 +5730,9 @@ export class Compiler extends DiagnosticEmitter { module.createIf( module.createGetLocal(thisLocal.index, nativeSizeType), module.createGetLocal(thisLocal.index, nativeSizeType), - this.makeAllocation(classInstance, expression) + this.makeRetain( + this.makeAllocation(classInstance) + ) ) ) ) @@ -5679,7 +5824,7 @@ export class Compiler extends DiagnosticEmitter { if (templateName !== null && inferredTypes.has(templateName)) { let inferredType = inferredTypes.get(templateName); if (inferredType) { - argumentExprs[i] = this.compileExpressionRetainType(argumentExpression, inferredType, WrapMode.NONE); + argumentExprs[i] = this.compileExpressionRetainType(argumentExpression, inferredType); let commonType: Type | null; if (!(commonType = Type.commonDenominator(inferredType, this.currentType, true))) { if (!(commonType = Type.commonDenominator(inferredType, this.currentType, false))) { @@ -5692,7 +5837,7 @@ export class Compiler extends DiagnosticEmitter { } inferredType = commonType; } else { - argumentExprs[i] = this.compileExpressionRetainType(argumentExpression, Type.i32, WrapMode.NONE); + argumentExprs[i] = this.compileExpressionRetainType(argumentExpression, Type.i32); inferredType = this.currentType; // ++numInferred; } @@ -5704,12 +5849,7 @@ export class Compiler extends DiagnosticEmitter { flow.contextualTypeArguments ); if (!concreteType) return module.createUnreachable(); - argumentExprs[i] = this.compileExpression( - argumentExpression, - concreteType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); + argumentExprs[i] = this.compileExpression(argumentExpression, concreteType, ContextualFlags.IMPLICIT); } } let resolvedTypeArguments = new Array(numTypeParameters); @@ -5739,8 +5879,7 @@ export class Compiler extends DiagnosticEmitter { if (instance.is(CommonFlags.INSTANCE)) { thisExpr = this.compileExpressionRetainType( assert(this.resolver.currentThisExpression), - this.options.usizeType, - WrapMode.NONE + this.options.usizeType ); } @@ -5749,8 +5888,8 @@ export class Compiler extends DiagnosticEmitter { expression.arguments, expression, thisExpr, - isLastStatementInBody, - contextualType == Type.void + false, + contextualFlags ); } @@ -5789,8 +5928,7 @@ export class Compiler extends DiagnosticEmitter { let thisExpression = assert(this.resolver.currentThisExpression); let thisExpr = this.compileExpressionRetainType( thisExpression, - this.options.usizeType, - WrapMode.NONE + this.options.usizeType ); indexArg = module.createLoad( 4, @@ -5810,12 +5948,7 @@ export class Compiler extends DiagnosticEmitter { } case ElementKind.FUNCTION_TARGET: { signature = (target).signature; - indexArg = this.compileExpression( - expression.expression, - (target).type, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); + indexArg = this.compileExpression(expression.expression, (target).type, ContextualFlags.IMPLICIT); break; } @@ -5839,8 +5972,7 @@ export class Compiler extends DiagnosticEmitter { indexArg = this.compileCallDirect(getterInstance, [], expression.expression, this.compileExpressionRetainType( assert(this.resolver.currentThisExpression), - this.options.usizeType, - WrapMode.NONE + this.options.usizeType ) ); signature = this.currentType.signatureReference; @@ -5983,7 +6115,7 @@ export class Compiler extends DiagnosticEmitter { reportNode: Node, thisArg: ExpressionRef = 0, inlineCanAlias: bool = false, - immediatelyDropped: bool = false + contextualFlags: ContextualFlags = ContextualFlags.NONE ): ExpressionRef { var numArguments = argumentExpressions.length; var signature = instance.signature; @@ -6007,7 +6139,7 @@ export class Compiler extends DiagnosticEmitter { ); } else { this.currentInlineFunctions.push(instance); - let expr = this.compileCallInlinePrechecked(instance, argumentExpressions, thisArg, inlineCanAlias, immediatelyDropped); + let expr = this.compileCallInlinePrechecked(instance, argumentExpressions, thisArg, inlineCanAlias, (contextualFlags & ContextualFlags.WILL_DROP) != 0); this.currentInlineFunctions.pop(); return expr; } @@ -6023,15 +6155,27 @@ export class Compiler extends DiagnosticEmitter { } var parameterTypes = signature.parameterTypes; for (let i = 0; i < numArguments; ++i, ++index) { - operands[index] = this.compileExpression( - argumentExpressions[i], - parameterTypes[i], - ConversionKind.IMPLICIT, - WrapMode.NONE + operands[index] = this.compileExpression(argumentExpressions[i], parameterTypes[i], + ContextualFlags.IMPLICIT ); } assert(index == numArgumentsInclThis); - return this.makeCallDirect(instance, operands, reportNode, immediatelyDropped); + if (signature.returnType.isManaged) { + if (contextualFlags & ContextualFlags.WILL_DROP) { + // Skip autorelease and simply release + return this.makeCallDirect(instance, operands, reportNode, true); + } else if (contextualFlags & ContextualFlags.SKIP_AUTORELEASE) { + // Skip autorelease and remember + let expr = this.makeCallDirect(instance, operands, reportNode, false, true); + this.skippedAutoreleases.add(expr); + return expr; + } else { + return this.makeCallDirect(instance, operands, reportNode, false, false); + } + } + return this.makeCallDirect(instance, operands, reportNode, + (contextualFlags & ContextualFlags.WILL_DROP) != 0 + ); } compileCallInline( @@ -6072,11 +6216,8 @@ export class Compiler extends DiagnosticEmitter { // compile arguments possibly using their own temp locals var temps = flow.blockLocalsBeforeInlining(instance); for (let i = 0; i < numArguments; ++i) { - args[i] = this.compileExpression( - argumentExpressions[i], - parameterTypes[i], - ConversionKind.IMPLICIT, - WrapMode.NONE + args[i] = this.compileExpression(argumentExpressions[i], parameterTypes[i], + ContextualFlags.IMPLICIT ); } flow.unblockLocals(temps); @@ -6141,10 +6282,10 @@ export class Compiler extends DiagnosticEmitter { !previousFlow.canOverflow(paramExpr, paramType) ); if (paramType.isManaged) { - flow.setLocalFlag(argumentLocal.index, LocalFlags.AUTORELEASE); + flow.setLocalFlag(argumentLocal.index, LocalFlags.RETAINED); body.push( module.createSetLocal(argumentLocal.index, - this.ensureRetain(paramExpr, paramType) + this.makeRetain(paramExpr) ) ); } else { @@ -6163,8 +6304,7 @@ export class Compiler extends DiagnosticEmitter { let initExpr = this.compileExpression( assert(instance.prototype.signatureNode.parameters[i].initializer), initType, - ConversionKind.IMPLICIT, - WrapMode.WRAP + ContextualFlags.IMPLICIT ); if (canAlias && getExpressionId(initExpr) == ExpressionId.GetLocal) { flow.addScopedAlias(signature.getParameterName(i), initType, getGetLocalIndex(initExpr)); @@ -6175,10 +6315,10 @@ export class Compiler extends DiagnosticEmitter { !flow.canOverflow(initExpr, initType) ); if (initType.isManaged) { - flow.setLocalFlag(argumentLocal.index, LocalFlags.AUTORELEASE); + flow.setLocalFlag(argumentLocal.index, LocalFlags.RETAINED); body.push( module.createSetLocal(argumentLocal.index, - this.ensureRetain(initExpr, initType) + this.makeRetain(initExpr) ) ); } else { @@ -6193,15 +6333,22 @@ export class Compiler extends DiagnosticEmitter { this.compileFunctionBody(instance, body); // Free any new scoped locals and reset to the original flow - if (!flow.isAny(FlowFlags.ANY_TERMINATING)) this.releaseLocals(body, flow); + if (!flow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(flow, body); flow.freeScopedLocals(); var returnType = flow.returnType; this.currentFlow = previousFlow; // Create an outer block that we can break to when returning a value out of order var expr = module.createBlock(flow.inlineReturnLabel, body, returnType.toNativeType()); - if (returnType.isManaged) expr = this.ensureAutorelease(expr, returnType, immediatelyDropped); - else this.currentType = returnType; + this.currentType = returnType; + if (returnType.isManaged) { + if (immediatelyDropped) { + expr = this.makeRelease(expr); + this.currentType = Type.void; + } else { + expr = this.makeAutorelease(expr); + } + } return expr; } @@ -6303,8 +6450,7 @@ export class Compiler extends DiagnosticEmitter { this.compileExpression( initializer, type, - ConversionKind.IMPLICIT, - WrapMode.WRAP + ContextualFlags.IMPLICIT ) ); } else { @@ -6374,40 +6520,155 @@ export class Compiler extends DiagnosticEmitter { return BuiltinSymbols.setargc; } - ensureRetain(expr: ExpressionRef, type: Type): ExpressionRef { - if (type.isManaged) { - let retainInstance = this.program.retainInstance; - this.compileFunction(retainInstance); - return this.module.createCall(retainInstance.internalName, [ expr ], type.toNativeType()); - } - return expr; + // + + /** Makes retain call, retaining the expression's value. */ + makeRetain(expr: ExpressionRef): ExpressionRef { + this.needsRetain = true; + return this.module.createCall(this.program.retainInstance.internalName, [ expr ], this.options.nativeSizeType); } - ensureAutorelease(expr: ExpressionRef, type: Type, immediatelyDropped: bool): ExpressionRef { - if (type.isManaged) { - if (immediatelyDropped) { - let releaseInstance = this.program.releaseInstance; - this.compileFunction(releaseInstance); - this.currentType = Type.void; - return this.module.createCall(releaseInstance.internalName, [ expr ], NativeType.None); - } else { - let flow = this.currentFlow; - let temp = flow.getAutoreleaseLocal(type); - this.currentType = type; - return this.module.createTeeLocal(temp.index, expr); + /** Makes a retainRelease call, retaining the new expression's value and releasing the old expression's value. */ + makeRetainRelease(exprNew: ExpressionRef, exprOld: ExpressionRef): ExpressionRef { + this.needsRetainRelease = true; + return this.module.createCall(this.program.retainReleaseInstance.internalName, [ exprNew, exprOld ], this.options.nativeSizeType); + } + + /** Makes a release call, releasing the expression's value. Changes the current type to void.*/ + makeRelease(expr: ExpressionRef): ExpressionRef { + this.needsRelease = true; + return this.module.createCall(this.program.releaseInstance.internalName, [ expr ], NativeType.None); + } + + /** Makes an automatic release call at the end of the current flow. */ + makeAutorelease(expr: ExpressionRef, flow: Flow = this.currentFlow): ExpressionRef { + return this.module.createTeeLocal(flow.getAutoreleaseLocal(this.options.usizeType).index, expr); + } + + /** Attempts to undo a final autorelease, returning the index of the previously retaining variable or -1 if not possible. */ + undoAutorelease(expr: ExpressionRef, flow: Flow): i32 { + // NOTE: Can't remove the local.tee completely because it's already compiled + // and a child of something else. Preventing the final release however should + // make it optimize away. + switch (getExpressionId(expr)) { + case ExpressionId.SetLocal: { // local.tee(__retain(expr)) + if (isTeeLocal(expr)) { + let index = getSetLocalIndex(expr); + if (flow.isAnyLocalFlag(index, LocalFlags.ANY_RETAINED)) { + // Assumes that the expression actually belongs to the flow and that + // top-level autoreleases are never undone. While that's true, it's + // not necessary to check presence in scopedLocals. + flow.unsetLocalFlag(index, LocalFlags.ANY_RETAINED); + return index; + } + } + break; + } + case ExpressionId.Block: { // { ..., local.tee(__retain(expr)) } + if (getBlockName(expr) === null) { // must not be a break target + let count = getBlockChildCount(expr); + if (count) { + return this.undoAutorelease(getBlockChild(expr, count - 1), flow); + } + } + break; + } + } + return -1; + } + + /** + * Attemps to move a final autorelease from one flow to a parent. + * It is crucial that from flow hasn't processed autoreleases yet because otherwise the final + * retain would have been written already. + */ + moveAutorelease(expr: ExpressionRef, fromInnerFlow: Flow, toOuterFlow: Flow): ExpressionRef { + // NOTE: While this avoids an unnecessary set of retain and release, it cannot + // eliminate the now unnecessary temporary local.tee because it is already part of + // another expression in the tree. But optimizing should collapse locals again. + var index = this.undoAutorelease(expr, fromInnerFlow); + return ~index + ? this.makeAutorelease(expr, toOuterFlow) // undone, can skip the retain + : this.makeAutorelease(this.makeRetain(expr), toOuterFlow); + } + + /** Performs any queued autoreleases in the specified flow. */ + performAutoreleases(flow: Flow, stmts: ExpressionRef[], clearFlags: bool = true): void { + var scopedLocals = flow.scopedLocals; + if (scopedLocals) { + let module = this.module; + for (let local of scopedLocals.values()) { + if (local.is(CommonFlags.SCOPED)) { // otherwise an alias + let localIndex = local.index; + if (flow.isAnyLocalFlag(localIndex, LocalFlags.ANY_RETAINED)) { + if (clearFlags) flow.unsetLocalFlag(localIndex, LocalFlags.ANY_RETAINED); + stmts.push( + this.makeRelease( + module.createGetLocal(localIndex, local.type.toNativeType()) + ) + ); + } + } } - } else { - this.currentType = type; - return expr; } } + /** Performs any queued autoreleases in the specified flow and returns the value. */ + performAutoreleasesWithValue( + flow: Flow, + valueExpr: ExpressionRef, + valueType: Type, + stmts: ExpressionRef[] | null = null, + clearFlags: bool = true + ): ExpressionRef { + if (!stmts) stmts = new Array(); + this.performAutoreleases(flow, stmts, clearFlags); + if (stmts.length) { + let nativeType = valueType.toNativeType(); + let temp = flow.getAndFreeTempLocal(valueType, !flow.canOverflow(valueExpr, valueType)); + let module = this.module; + stmts.unshift( + module.createSetLocal(temp.index, valueExpr), + ); + stmts.push( + module.createGetLocal(temp.index, nativeType) + ); + return module.createBlock(null, stmts, nativeType); + } else if (stmts.length) { + stmts.push( + valueExpr + ); + return this.module.createBlock(null, stmts, valueType.toNativeType()); + } + return valueExpr; + } + + /** Finishes any queued top-level autoreleases in the actual function of the specified flow. */ + finishAutoreleases(flow: Flow, stmts: ExpressionRef[]): void { + var module = this.module; + for (let local of flow.actualFunction.localsByIndex) { + let localIndex = local.index; + if (flow.isAnyLocalFlag(localIndex, LocalFlags.ANY_RETAINED)) { + flow.unsetLocalFlag(localIndex, LocalFlags.ANY_RETAINED); + stmts.push( + this.makeRelease( + module.createGetLocal(localIndex, local.type.toNativeType()) + ) + ); + } + } + } + + // + /** Creates a direct call to the specified function. */ makeCallDirect( instance: Function, operands: ExpressionRef[] | null, reportNode: Node, - immediatelyDropped: bool = false + immediatelyDropped: bool = false, + /** Skip the usual autorelease and manage this at the callsite instead. */ + skipAutorelease: bool = false ): ExpressionRef { if (instance.hasDecorator(DecoratorFlags.INLINE)) { this.warning( @@ -6462,8 +6723,7 @@ export class Compiler extends DiagnosticEmitter { operands.push(this.compileExpression( parameterNodes[i].initializer, parameterTypes[i], - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT )); this.currentFlow = previousFlow; continue; @@ -6480,8 +6740,17 @@ export class Compiler extends DiagnosticEmitter { instance.flow.flags = original.flow.flags; let nativeReturnType = returnType.toNativeType(); let expr = module.createCall(instance.internalName, operands, nativeReturnType); - if (returnType.isManaged) expr = this.ensureAutorelease(expr, returnType, immediatelyDropped); - else this.currentType = returnType; + this.currentType = returnType; + if (returnType.isManaged) { + if (immediatelyDropped) { + expr = this.makeRelease(expr); + this.currentType = Type.void; + } else if (!skipAutorelease) { + expr = this.makeAutorelease(expr); + } else { + this.skippedAutoreleases.add(expr); + } + } return module.createBlock(null, [ module.createSetGlobal(this.ensureArgcVar(), module.createI32(numArguments)), expr @@ -6490,12 +6759,19 @@ export class Compiler extends DiagnosticEmitter { } } - // If the return value is of a reference type then it has been pre-retained by the callee - // and has semantics very similar to an allocation. Hence, add an autorelease local that - // keeps track of it. TODO: detect if immediately dropped and skip the temp. + // If the return value is of a reference type it has not yet been released but is in flight + // which is equivalent to a skipped autorelease. Hence, insert either a release if it is + // dropped anyway, preserve the skipped autorelease if explicitly requested or autorelease now. var expr = module.createCall(instance.internalName, operands, returnType.toNativeType()); - if (returnType.isManaged) expr = this.ensureAutorelease(expr, returnType, immediatelyDropped); - else this.currentType = returnType; + this.currentType = returnType; + if (returnType.isManaged) { + if (immediatelyDropped) { + expr = this.makeRelease(expr); + this.currentType = Type.void; + } else if (!skipAutorelease) { + expr = this.makeAutorelease(expr); + } + } return expr; } @@ -6528,11 +6804,8 @@ export class Compiler extends DiagnosticEmitter { } var parameterTypes = signature.parameterTypes; for (let i = 0; i < numArguments; ++i, ++index) { - operands[index] = this.compileExpression( - argumentExpressions[i], - parameterTypes[i], - ConversionKind.IMPLICIT, - WrapMode.NONE + operands[index] = this.compileExpression(argumentExpressions[i], parameterTypes[i], + ContextualFlags.IMPLICIT ); } assert(index == numArgumentsInclThis); @@ -6576,8 +6849,15 @@ export class Compiler extends DiagnosticEmitter { var returnType = signature.returnType; var expr = module.createCallIndirect(indexArg, operands, signature.toSignatureString()); - if (returnType.isManaged) expr = this.ensureAutorelease(expr, returnType, immediatelyDropped); - else this.currentType = returnType; + this.currentType = returnType; + if (returnType.isManaged) { + if (immediatelyDropped) { + expr = this.makeRelease(expr); + this.currentType = Type.void; + } else { + expr = this.makeAutorelease(expr); + } + } return module.createBlock(null, [ module.createSetGlobal(this.ensureArgcVar(), // might be calling a trampoline module.createI32(numArguments) @@ -6586,28 +6866,28 @@ export class Compiler extends DiagnosticEmitter { ], this.currentType.toNativeType()); // not necessarily wrapped } - compileCommaExpression(expression: CommaExpression, contextualType: Type, conversionKind: ConversionKind, wrapMode: WrapMode): ExpressionRef { + compileCommaExpression( + expression: CommaExpression, + contextualType: Type, + contextualFlags: ContextualFlags + ): ExpressionRef { var expressions = expression.expressions; var numExpressions = expressions.length; var exprs = new Array(numExpressions--); for (let i = 0; i < numExpressions; ++i) { - exprs[i] = this.compileExpression( - expressions[i], - Type.void, // drop all - ConversionKind.IMPLICIT, - WrapMode.NONE + exprs[i] = this.compileExpression(expressions[i], Type.void, // drop all except last + ContextualFlags.IMPLICIT | ContextualFlags.WILL_DROP ); } - exprs[numExpressions] = this.compileExpression( - expressions[numExpressions], - contextualType, // except last - conversionKind, - wrapMode - ); + exprs[numExpressions] = this.compileExpression(expressions[numExpressions], contextualType, contextualFlags); return this.module.createBlock(null, exprs, this.currentType.toNativeType()); } - compileElementAccessExpression(expression: ElementAccessExpression, contextualType: Type): ExpressionRef { + compileElementAccessExpression( + expression: ElementAccessExpression, + contextualType: Type, + contextualFlags: ContextualFlags + ): ExpressionRef { var target = this.resolver.resolveElementAccessExpression( expression, this.currentFlow, @@ -6616,20 +6896,7 @@ export class Compiler extends DiagnosticEmitter { if (!target) return this.module.createUnreachable(); switch (target.kind) { case ElementKind.CLASS: { - let isUnchecked = this.currentFlow.is(FlowFlags.UNCHECKED_CONTEXT); - // if (isUnchecked) { - // let arrayType = this.program.determineBuiltinArrayType(target); - // if (arrayType) { - // return compileBuiltinArrayGet( - // this, - // target, - // expression.expression, - // expression.elementExpression, - // contextualType - // ); - // } - // } - let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET, isUnchecked); + let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET, this.currentFlow.is(FlowFlags.UNCHECKED_CONTEXT)); if (!indexedGet) { this.error( DiagnosticCode.Index_signature_is_missing_in_type_0, @@ -6637,15 +6904,12 @@ export class Compiler extends DiagnosticEmitter { ); return this.module.createUnreachable(); } - let thisArg = this.compileExpression( - expression.expression, - (target).type, - ConversionKind.IMPLICIT, - WrapMode.NONE + let thisArg = this.compileExpression(expression.expression, (target).type, + ContextualFlags.IMPLICIT ); return this.compileCallDirect(indexedGet, [ expression.elementExpression - ], expression, thisArg); + ], expression, thisArg, false, contextualFlags & (ContextualFlags.WILL_DROP | ContextualFlags.SKIP_AUTORELEASE)); } } this.error( @@ -6657,7 +6921,8 @@ export class Compiler extends DiagnosticEmitter { compileFunctionExpression( expression: FunctionExpression, - contextualSignature: Signature | null + contextualSignature: Signature | null, + contextualFlags: ContextualFlags ): ExpressionRef { var declaration = expression.declaration.clone(); // generic contexts can have multiple assert(!declaration.typeParameters); // function expression cannot be generic @@ -6811,7 +7076,7 @@ export class Compiler extends DiagnosticEmitter { compileIdentifierExpression( expression: IdentifierExpression, contextualType: Type, - retainConstantType: bool + contextualFlags: ContextualFlags ): ExpressionRef { var module = this.module; var flow = this.currentFlow; @@ -6856,7 +7121,9 @@ export class Compiler extends DiagnosticEmitter { module.createGetLocal(thisLocal.index, nativeSizeType) ), module.createSetLocal(thisLocal.index, - this.makeAllocation(classInstance, expression) + this.makeRetain( + this.makeAllocation(classInstance) + ) ) ) ]; @@ -6936,7 +7203,7 @@ export class Compiler extends DiagnosticEmitter { let localType = (target).type; assert(localType != Type.void); if ((target).is(CommonFlags.INLINED)) { - return this.compileInlineConstant(target, contextualType, retainConstantType); + return this.compileInlineConstant(target, contextualType, contextualFlags); } let localIndex = (target).index; assert(localIndex >= 0); @@ -6953,7 +7220,7 @@ export class Compiler extends DiagnosticEmitter { let globalType = (target).type; assert(globalType != Type.void); if ((target).is(CommonFlags.INLINED)) { - return this.compileInlineConstant(target, contextualType, retainConstantType); + return this.compileInlineConstant(target, contextualType, contextualFlags); } this.currentType = globalType; return this.module.createGetGlobal((target).internalName, globalType.toNativeType()); @@ -6995,14 +7262,15 @@ export class Compiler extends DiagnosticEmitter { compileInstanceOfExpression( expression: InstanceOfExpression, - contextualType: Type + contextualType: Type, + contextualFlags: ContextualFlags ): ExpressionRef { var module = this.module; // NOTE that this differs from TypeScript in that the rhs is a type, not an expression. at the // time of implementation, this seemed more useful because dynamic rhs expressions are not // possible in AS anyway. also note that the code generated below must preserve side-effects of // the LHS expression even when the result is a constant, i.e. return a block dropping `expr`. - var expr = this.compileExpressionRetainType(expression.expression, this.options.usizeType, WrapMode.NONE); + var expr = this.compileExpressionRetainType(expression.expression, this.options.usizeType); var actualType = this.currentType; var expectedType = this.resolver.resolveType(expression.isType, this.currentFlow.actualFunction); this.currentType = Type.bool; @@ -7011,7 +7279,7 @@ export class Compiler extends DiagnosticEmitter { // instanceof - must be exact if (!expectedType.is(TypeFlags.REFERENCE)) { return module.createBlock(null, [ - this.convertExpression(expr, actualType, Type.void, ConversionKind.EXPLICIT, WrapMode.NONE, expression.expression), + this.convertExpression(expr, actualType, Type.void, (contextualFlags & ContextualFlags.EXPLICIT) != 0, false, expression.expression), module.createI32(actualType == expectedType ? 1 : 0) ], NativeType.I32); } @@ -7019,7 +7287,7 @@ export class Compiler extends DiagnosticEmitter { // instanceof - always false if (!actualType.is(TypeFlags.REFERENCE)) { return module.createBlock(null, [ - this.convertExpression(expr, actualType, Type.void, ConversionKind.EXPLICIT, WrapMode.NONE, expression.expression), + this.convertExpression(expr, actualType, Type.void, (contextualFlags & ContextualFlags.EXPLICIT) != 0,false, expression.expression), module.createI32(0) ], NativeType.I32); } @@ -7076,7 +7344,7 @@ export class Compiler extends DiagnosticEmitter { // downcast - check statically if (actualType.isAssignableTo(expectedType)) { return module.createBlock(null, [ - this.convertExpression(expr, actualType, Type.void, ConversionKind.EXPLICIT, WrapMode.NONE, expression.expression), + this.convertExpression(expr, actualType, Type.void, (contextualFlags & ContextualFlags.EXPLICIT) != 0, false, expression.expression), module.createI32(1) ], NativeType.I32); @@ -7115,7 +7383,7 @@ export class Compiler extends DiagnosticEmitter { // false return module.createBlock(null, [ - this.convertExpression(expr, actualType, Type.void, ConversionKind.EXPLICIT, WrapMode.NONE, expression.expression), + this.convertExpression(expr, actualType, Type.void, (contextualFlags & ContextualFlags.EXPLICIT) != 0, false, expression.expression), module.createI32(0) ], NativeType.I32); } @@ -7123,13 +7391,13 @@ export class Compiler extends DiagnosticEmitter { compileLiteralExpression( expression: LiteralExpression, contextualType: Type, - implicitNegate: bool = false, - context: Element | null = null + contextualFlags: ContextualFlags, + implicitlyNegate: bool = false ): ExpressionRef { var module = this.module; switch (expression.literalKind) { case LiteralKind.ARRAY: { - assert(!implicitNegate); + assert(!implicitlyNegate); let classType = contextualType.classReference; if (classType) { if (classType.prototype == this.program.arrayPrototype) { @@ -7137,8 +7405,8 @@ export class Compiler extends DiagnosticEmitter { assert(classType.typeArguments)[0], (expression).elementExpressions, false, // TODO: isConst? - expression, - context + contextualFlags, + expression ); } } @@ -7150,7 +7418,7 @@ export class Compiler extends DiagnosticEmitter { } case LiteralKind.FLOAT: { let floatValue = (expression).value; - if (implicitNegate) { + if (implicitlyNegate) { floatValue = -floatValue; } if (contextualType == Type.f32) { @@ -7161,7 +7429,7 @@ export class Compiler extends DiagnosticEmitter { } case LiteralKind.INTEGER: { let intValue = (expression).value; - if (implicitNegate) { + if (implicitlyNegate) { intValue = i64_sub( i64_new(0), intValue @@ -7180,11 +7448,11 @@ export class Compiler extends DiagnosticEmitter { } } case LiteralKind.STRING: { - assert(!implicitNegate); + assert(!implicitlyNegate); return this.compileStringLiteral(expression); } case LiteralKind.OBJECT: { - assert(!implicitNegate); + assert(!implicitlyNegate); return this.compileObjectLiteral(expression, contextualType); } // case LiteralKind.REGEXP: @@ -7205,24 +7473,37 @@ export class Compiler extends DiagnosticEmitter { elementType: Type, expressions: (Expression | null)[], isConst: bool, - reportNode: Node, - context: Element | null = null + contextualFlags: ContextualFlags, + reportNode: Node ): ExpressionRef { var module = this.module; + var program = this.program; + var arrayPrototype = assert(program.arrayPrototype); + var arrayInstance = assert(this.resolver.resolveClass(arrayPrototype, [ elementType ])); + var arrayBufferInstance = assert(program.arrayBufferInstance); + var arrayType = arrayInstance.type; + var flow = this.currentFlow; - // find out whether all elements are constant (array is static) + // block those here so compiling expressions doesn't conflict + var tempThis = flow.getTempLocal(arrayType, false); + var tempDataStart = flow.getTempLocal(arrayBufferInstance.type); + + // compile value expressions and find out whether all are constant var length = expressions.length; - var constantValues: ExpressionRef[] | null = new Array(length); + var values = new Array(length); + var allValuesAreConstant = true; var nativeElementType = elementType.toNativeType(); for (let i = 0; i < length; ++i) { let expression = expressions[i]; let expr = expression - ? this.compileExpression(expression, elementType, ConversionKind.IMPLICIT, WrapMode.NONE) + ? module.precomputeExpression( + this.compileExpression(expression, elementType, + ContextualFlags.IMPLICIT + ) + ) : elementType.toNativeZero(module); - expr = module.precomputeExpression(expr); if (getExpressionId(expr) == ExpressionId.Const) { assert(getExpressionType(expr) == nativeElementType); - constantValues![i] = expr; } else { if (isConst) { this.warning( @@ -7230,26 +7511,23 @@ export class Compiler extends DiagnosticEmitter { reportNode.range ); } - constantValues = null; - break; + allValuesAreConstant = false; } + values[i] = expr; } - var program = this.program; - var arrayPrototype = assert(program.arrayPrototype); - var arrayInstance = assert(this.resolver.resolveClass(arrayPrototype, [ elementType ])); - var arrayBufferInstance = assert(program.arrayBufferInstance); - var arrayType = arrayInstance.type; - // if the array is static, make a static arraybuffer segment - if (constantValues) { + if (allValuesAreConstant) { + flow.freeTempLocal(tempThis); + flow.freeTempLocal(tempDataStart); + let runtimeHeaderSize = program.runtimeHeaderSize; - let bufferSegment = this.ensureStaticArrayBuffer(elementType, constantValues); + let bufferSegment = this.ensureStaticArrayBuffer(elementType, values); let bufferAddress = i64_add(bufferSegment.offset, i64_new(runtimeHeaderSize)); // make both the buffer and array header static if assigned to a global. this can't be done // if inside of a function because each invocation must create a new array reference then. - if (context && context.kind == ElementKind.GLOBAL) { + if (contextualFlags & ContextualFlags.STATIC_CAPABLE) { let arraySegment = this.ensureStaticArrayHeader(elementType, bufferSegment); let arrayAddress = i64_add(arraySegment.offset, i64_new(runtimeHeaderSize)); this.currentType = arrayType; @@ -7271,13 +7549,15 @@ export class Compiler extends DiagnosticEmitter { : module.createI32(i64_low(bufferAddress)) ], reportNode); this.currentType = arrayType; - return expr; + return this.makeAutorelease(this.makeRetain(expr)); } } // otherwise compile an explicit instantiation with indexed sets var setter = arrayInstance.lookupOverload(OperatorKind.INDEXED_SET, true); if (!setter) { + flow.freeTempLocal(tempThis); + flow.freeTempLocal(tempDataStart); this.error( DiagnosticCode.Index_signature_in_type_0_only_permits_reading, reportNode.range, arrayInstance.internalName @@ -7286,9 +7566,7 @@ export class Compiler extends DiagnosticEmitter { return module.createUnreachable(); } var nativeArrayType = arrayType.toNativeType(); - var flow = this.currentFlow; - var tempThis = flow.getTempLocal(arrayType, false); - var tempDataStart = flow.getTempLocal(arrayBufferInstance.type); + var stmts = new Array(); // tempThis = makeArray(length, alignLog2, classId, source = 0) stmts.push( @@ -7319,15 +7597,10 @@ export class Compiler extends DiagnosticEmitter { ); var isManaged = elementType.isManaged; for (let i = 0, alignLog2 = elementType.alignLog2; i < length; ++i) { - let valueExpression = expressions[i]; - let valueExpr = valueExpression - ? this.compileExpression(valueExpression, elementType, ConversionKind.IMPLICIT, WrapMode.NONE) - : elementType.toNativeZero(module); + let valueExpr = values[i]; if (isManaged) { // value = __retain(value) - valueExpr = this.makeCallDirect(program.retainInstance, [ - valueExpr - ], reportNode); + valueExpr = this.makeRetain(valueExpr); } // store(tempData, value, immOffset) stmts.push( @@ -7414,7 +7687,7 @@ export class Compiler extends DiagnosticEmitter { exprs[i + 1] = this.module.createStore( // TODO: handle setters as well type.byteSize, this.module.createGetLocal(tempLocal.index, this.options.nativeSizeType), - this.compileExpression(values[i], (member).type, ConversionKind.IMPLICIT, WrapMode.NONE), + this.compileExpression(values[i], (member).type, ContextualFlags.IMPLICIT), type.toNativeType(), (member).memoryOffset ); @@ -7425,7 +7698,9 @@ export class Compiler extends DiagnosticEmitter { // allocate a new instance first and assign 'this' to the temp. local exprs[0] = module.createSetLocal( tempLocal.index, - this.makeAllocation(classReference, expression) + this.makeRetain( + this.makeAllocation(classReference) + ) ); // once all field values have been set, return 'this' @@ -7435,7 +7710,11 @@ export class Compiler extends DiagnosticEmitter { return module.createBlock(null, exprs, this.options.nativeSizeType); } - compileNewExpression(expression: NewExpression, contextualType: Type): ExpressionRef { + compileNewExpression( + expression: NewExpression, + contextualType: Type, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; var flow = this.currentFlow; @@ -7476,7 +7755,8 @@ export class Compiler extends DiagnosticEmitter { ); } if (!classInstance) return module.createUnreachable(); - return this.compileInstantiate(classInstance, expression.arguments, expression); + if (contextualType == Type.void) contextualFlags |= ContextualFlags.WILL_DROP; + return this.compileInstantiate(classInstance, expression.arguments, contextualFlags, expression); } /** Gets the compiled constructor of the specified class or generates one if none is present. */ @@ -7546,7 +7826,9 @@ export class Compiler extends DiagnosticEmitter { module.createGetLocal(0, nativeSizeType) ), module.createSetLocal(0, - this.makeAllocation(classInstance, reportNode) + this.makeRetain( + this.makeAllocation(classInstance) + ) ) ) ); @@ -7587,15 +7869,28 @@ export class Compiler extends DiagnosticEmitter { return instance; } - compileInstantiate(classInstance: Class, argumentExpressions: Expression[], reportNode: Node): ExpressionRef { + compileInstantiate( + /** Class to instantiate. */ + classInstance: Class, + /** Constructor arguments. */ + argumentExpressions: Expression[], + /** Contextual flags. */ + contextualFlags: ContextualFlags, + /** Node to report on. */ + reportNode: Node + ): ExpressionRef { var ctor = this.ensureConstructor(classInstance, reportNode); - var expr = this.compileCallDirect( // no need for another AUTORELEASE local + var expr = this.compileCallDirect( // no need for another autoreleased local ctor, argumentExpressions, reportNode, - this.options.usizeType.toNativeZero(this.module) + this.options.usizeType.toNativeZero(this.module), + false, + contextualFlags ); - this.currentType = classInstance.type; // important because a super ctor could be called + if (getExpressionType(expr) != NativeType.None) { // possibly IMM_DROPPED + this.currentType = classInstance.type; // important because a super ctor could be called + } return expr; } @@ -7607,7 +7902,7 @@ export class Compiler extends DiagnosticEmitter { compilePropertyAccessExpression( propertyAccess: PropertyAccessExpression, contextualType: Type, - retainConstantType: bool + contextualFlags: ContextualFlags ): ExpressionRef { var module = this.module; var flow = this.currentFlow; @@ -7625,7 +7920,7 @@ export class Compiler extends DiagnosticEmitter { let globalType = (target).type; assert(globalType != Type.void); if ((target).is(CommonFlags.INLINED)) { - return this.compileInlineConstant(target, contextualType, retainConstantType); + return this.compileInlineConstant(target, contextualType, contextualFlags); } this.currentType = globalType; return module.createGetGlobal((target).internalName, globalType.toNativeType()); @@ -7647,8 +7942,7 @@ export class Compiler extends DiagnosticEmitter { assert((target).memoryOffset >= 0); let thisExpr = this.compileExpressionRetainType( assert(this.resolver.currentThisExpression), - this.options.usizeType, - WrapMode.NONE + this.options.usizeType ); this.currentType = (target).type; return module.createLoad( @@ -7672,8 +7966,7 @@ export class Compiler extends DiagnosticEmitter { return this.compileCallDirect(getterInstance, [], propertyAccess, this.compileExpressionRetainType( assert(this.resolver.currentThisExpression), - this.options.usizeType, - WrapMode.NONE + this.options.usizeType ) ); } @@ -7692,106 +7985,102 @@ export class Compiler extends DiagnosticEmitter { return module.createUnreachable(); } - compileTernaryExpression(expression: TernaryExpression, contextualType: Type): ExpressionRef { + compileTernaryExpression( + expression: TernaryExpression, + contextualType: Type, + contextualFlags: ContextualFlags + ): ExpressionRef { var ifThen = expression.ifThen; var ifElse = expression.ifElse; var outerFlow = this.currentFlow; - var condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(expression.condition, Type.bool, WrapMode.NONE), - this.currentType + var condExpr = this.module.precomputeExpression( + this.makeIsTrueish( + this.compileExpressionRetainType(expression.condition, Type.bool), + this.currentType + ) ); // Try to eliminate unnecesssary branches if the condition is constant - var condExprPrecomp = this.module.precomputeExpression(condExpr); if ( - getExpressionId(condExprPrecomp) == ExpressionId.Const && - getExpressionType(condExprPrecomp) == NativeType.I32 + getExpressionId(condExpr) == ExpressionId.Const && + getExpressionType(condExpr) == NativeType.I32 ) { - return getConstValueI32(condExprPrecomp) - ? this.compileExpressionRetainType(ifThen, contextualType, WrapMode.NONE) - : this.compileExpressionRetainType(ifElse, contextualType, WrapMode.NONE); - - // Otherwise recompile to the original and let the optimizer decide - } else /* if (condExpr != condExprPrecomp) <- not guaranteed */ { - condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(expression.condition, Type.bool, WrapMode.NONE), - this.currentType - ); + return getConstValueI32(condExpr) + ? this.compileExpressionRetainType(ifThen, contextualType) + : this.compileExpressionRetainType(ifElse, contextualType); } - var module = this.module; var ifThenFlow = outerFlow.fork(); this.currentFlow = ifThenFlow; - var ifThenExpr = this.compileExpressionRetainType(ifThen, contextualType, WrapMode.NONE); + var ifThenExpr = this.compileExpressionRetainType(ifThen, contextualType, contextualFlags & ContextualFlags.SKIP_AUTORELEASE); var ifThenType = this.currentType; - var ifThenStmts = new Array(); - this.releaseLocals(ifThenStmts, ifThenFlow); - if (ifThenStmts.length) { - let temp = ifThenFlow.getAndFreeTempLocal(ifThenType, false); - let nativeType = ifThenType.toNativeType(); - ifThenStmts.unshift( - module.createSetLocal(temp.index, ifThenExpr) - ); - ifThenStmts.push( - module.createGetLocal(temp.index, nativeType) - ); - ifThenExpr = this.module.createBlock(null, ifThenStmts, nativeType); - } - ifThenFlow.freeScopedLocals(); + var IfThenAutoreleaseSkipped = this.skippedAutoreleases.has(ifThenExpr); var ifElseFlow = outerFlow.fork(); this.currentFlow = ifElseFlow; - var ifElseExpr = this.compileExpressionRetainType(ifElse, contextualType, WrapMode.NONE); + var ifElseExpr = this.compileExpressionRetainType(ifElse, contextualType, contextualFlags & ContextualFlags.SKIP_AUTORELEASE); var ifElseType = this.currentType; - var ifElseStmts = new Array(); - this.releaseLocals(ifElseStmts, ifElseFlow); - if (ifElseStmts.length) { - let temp = ifElseFlow.getAndFreeTempLocal(ifElseType, false); - let nativeType = ifElseType.toNativeType(); - ifElseStmts.unshift( - module.createSetLocal(temp.index, ifElseExpr) - ); - ifElseStmts.push( - module.createGetLocal(temp.index, nativeType) - ); - ifElseExpr = module.createBlock(null, ifElseStmts, nativeType); - } - ifElseFlow.freeScopedLocals(); - this.currentFlow = outerFlow; - - outerFlow.inheritMutual(ifThenFlow, ifElseFlow); + var ifElseAutoreleaseSkipped = this.skippedAutoreleases.has(ifElseExpr); var commonType = Type.commonDenominator(ifThenType, ifElseType, false); if (!commonType) { this.error( DiagnosticCode.Type_0_is_not_assignable_to_type_1, - expression.range, ifThenType.toString(), ifElseType.toString() + ifElse.range, ifElseType.toString(), ifThenType.toString() ); this.currentType = contextualType; return this.module.createUnreachable(); } ifThenExpr = this.convertExpression( ifThenExpr, - ifThenType, - commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + ifThenType, commonType, + false, false, ifThen ); ifElseExpr = this.convertExpression( ifElseExpr, - ifElseType, - commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + ifElseType, commonType, + false, false, ifElse ); this.currentType = commonType; - return this.module.createIf(condExpr, ifThenExpr, ifElseExpr); + + if (IfThenAutoreleaseSkipped != ifElseAutoreleaseSkipped) { // unify to both skipped + if (!IfThenAutoreleaseSkipped) { + ifThenExpr = this.makeRetain(ifThenExpr); + IfThenAutoreleaseSkipped = true; + } else { + ifElseExpr = this.makeRetain(ifElseExpr); + ifElseAutoreleaseSkipped = true; + } + } else if (!IfThenAutoreleaseSkipped && commonType.isManaged) { // keep alive a little longer + // if (!(contextualFlags & ContextualFlags.SKIP_AUTORELEASE)) { + ifThenExpr = this.moveAutorelease(ifThenExpr, ifThenFlow, outerFlow); + ifElseExpr = this.moveAutorelease(ifElseExpr, ifElseFlow, outerFlow); + // } + } + + ifThenExpr = this.performAutoreleasesWithValue(ifThenFlow, ifThenExpr, commonType); + ifThenFlow.freeScopedLocals(); + + ifElseExpr = this.performAutoreleasesWithValue(ifElseFlow, ifElseExpr, commonType); + ifElseFlow.freeScopedLocals(); + + this.currentFlow = outerFlow; + outerFlow.inheritMutual(ifThenFlow, ifElseFlow); + + var expr = this.module.createIf(condExpr, ifThenExpr, ifElseExpr); + assert(IfThenAutoreleaseSkipped == ifElseAutoreleaseSkipped); + if (IfThenAutoreleaseSkipped) this.skippedAutoreleases.add(expr); + return expr; } - compileUnaryPostfixExpression(expression: UnaryPostfixExpression, contextualType: Type): ExpressionRef { + compileUnaryPostfixExpression( + expression: UnaryPostfixExpression, + contextualType: Type, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; var flow = this.currentFlow; @@ -7801,8 +8090,7 @@ export class Compiler extends DiagnosticEmitter { contextualType == Type.void ? Type.i32 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // shortcut if compiling the getter already failed @@ -7981,20 +8269,32 @@ export class Compiler extends DiagnosticEmitter { } } + var resolver = this.resolver; + var target = resolver.resolveExpression(expression.operand, flow); // reports + // simplify if dropped anyway if (!tempLocal) { this.currentType = Type.void; - return this.compileAssignmentWithValue( - expression.operand, + if (!target) return module.createUnreachable(); + return this.makeAssignment( + target, expr, + expression.operand, + resolver.currentThisExpression, + resolver.currentElementExpression, false ); + } else if (!target) { + return module.createUnreachable(); } // otherwise use the temp. local for the intermediate value (always possibly overflows) - var setValue = this.compileAssignmentWithValue( + var setValue = this.makeAssignment( + target, + expr, // includes a tee of getValue to tempLocal expression.operand, - expr, // also tees getValue to tempLocal + resolver.currentThisExpression, + resolver.currentElementExpression, false ); @@ -8010,7 +8310,8 @@ export class Compiler extends DiagnosticEmitter { compileUnaryPrefixExpression( expression: UnaryPrefixExpression, - contextualType: Type + contextualType: Type, + contextualFlags: ContextualFlags ): ExpressionRef { var module = this.module; var compound = false; @@ -8023,8 +8324,7 @@ export class Compiler extends DiagnosticEmitter { contextualType == Type.void ? Type.i32 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // check operator overload @@ -8053,7 +8353,7 @@ export class Compiler extends DiagnosticEmitter { (expression.operand).literalKind == LiteralKind.FLOAT )) { // implicitly negate integer and float literals. also enables proper checking of literal ranges. - expr = this.compileLiteralExpression(expression.operand, contextualType, true); + expr = this.compileLiteralExpression(expression.operand, contextualType, ContextualFlags.NONE, true); // compileExpression normally does this: if (this.options.sourceMap) this.addDebugLocation(expr, expression.range); break; @@ -8064,8 +8364,7 @@ export class Compiler extends DiagnosticEmitter { contextualType == Type.void ? Type.i32 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // check operator overload @@ -8134,8 +8433,7 @@ export class Compiler extends DiagnosticEmitter { contextualType == Type.void ? Type.i32 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // check operator overload @@ -8204,8 +8502,7 @@ export class Compiler extends DiagnosticEmitter { contextualType == Type.void ? Type.i32 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // check operator overload @@ -8273,8 +8570,7 @@ export class Compiler extends DiagnosticEmitter { contextualType == Type.void ? Type.i32 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // check operator overload @@ -8302,8 +8598,7 @@ export class Compiler extends DiagnosticEmitter { : contextualType.is(TypeFlags.FLOAT) ? Type.i64 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // check operator overload @@ -8322,10 +8617,9 @@ export class Compiler extends DiagnosticEmitter { ); return module.createUnreachable(); } else { - expr = this.convertExpression( - expr, + expr = this.convertExpression(expr, this.currentType, this.currentType.intType, - ConversionKind.IMPLICIT, WrapMode.NONE, + false, false, expression.operand ); } @@ -8376,13 +8670,18 @@ export class Compiler extends DiagnosticEmitter { return module.createUnreachable(); } } - return compound - ? this.compileAssignmentWithValue( - expression.operand, - expr, - contextualType != Type.void - ) - : expr; + if (!compound) return expr; + var resolver = this.resolver; + var target = resolver.resolveExpression(expression.operand, this.currentFlow); + if (!target) return module.createUnreachable(); + return this.makeAssignment( + target, + expr, + expression.operand, + resolver.currentThisExpression, + resolver.currentElementExpression, + contextualType != Type.void + ); } /** Makes sure that a 32-bit integer value is wrapped to a valid value of the specified type. */ @@ -8538,23 +8837,26 @@ export class Compiler extends DiagnosticEmitter { } /** Makes an allocation suitable to hold the data of an instance of the given class. */ - makeAllocation(classInstance: Class, reportNode: Node): ExpressionRef { + makeAllocation( + classInstance: Class + ): ExpressionRef { + // TODO: investigate if it's possible to allocate with RC=1 immediately var program = this.program; assert(classInstance.program == program); var module = this.module; var options = this.options; - var classType = classInstance.type; - this.currentType = classType; - return this.makeCallDirect(program.allocInstance, [ + this.currentType = classInstance.type; + this.needsAlloc = true; + return module.createCall(program.allocInstance.internalName, [ options.isWasm64 ? module.createI64(classInstance.currentMemoryOffset) : module.createI32(classInstance.currentMemoryOffset), - module.createI32( - classInstance.hasDecorator(DecoratorFlags.UNMANAGED) - ? 0 - : classInstance.id - ) - ], reportNode); + module.createI32( + classInstance.hasDecorator(DecoratorFlags.UNMANAGED) + ? 0 + : classInstance.id + ) + ], options.nativeSizeType); } /** Makes the initializers for a class's fields. */ @@ -8587,11 +8889,8 @@ export class Compiler extends DiagnosticEmitter { stmts.push( module.createStore(fieldType.byteSize, module.createGetLocal(thisLocalIndex, nativeSizeType), - this.compileExpression( // reports - initializerNode, - fieldType, - ConversionKind.IMPLICIT, - WrapMode.NONE + this.compileExpression(initializerNode, fieldType, // reports + ContextualFlags.IMPLICIT ), nativeFieldType, field.memoryOffset diff --git a/src/flow.ts b/src/flow.ts index b974ef50..a5bc440b 100644 --- a/src/flow.ts +++ b/src/flow.ts @@ -146,32 +146,32 @@ export enum LocalFlags { READFROM = 1 << 2, /** Local is written to. */ WRITTENTO = 1 << 3, - /** Local must be autoreleased. */ - AUTORELEASE = 1 << 4, + /** Local is retained. */ + RETAINED = 1 << 4, /** Local is conditionally read from. */ CONDITIONALLY_READFROM = 1 << 5, /** Local is conditionally written to. */ CONDITIONALLY_WRITTENTO = 1 << 6, - /** Local must be conditionally autoreleased. */ - CONDITIONALLY_AUTORELEASE = 1 << 7, + /** Local must be conditionally retained. */ + CONDITIONALLY_RETAINED = 1 << 7, /** Any categorical flag. */ ANY_CATEGORICAL = WRAPPED | NONNULL | READFROM | WRITTENTO - | AUTORELEASE, + | RETAINED, /** Any conditional flag. */ - ANY_CONDITIONAL = AUTORELEASE + ANY_CONDITIONAL = RETAINED | CONDITIONALLY_READFROM | CONDITIONALLY_WRITTENTO - | CONDITIONALLY_AUTORELEASE, + | CONDITIONALLY_RETAINED, - /** Any autorelease flag. */ - ANY_AUTORELEASE = AUTORELEASE - | CONDITIONALLY_AUTORELEASE + /** Any retained flag. */ + ANY_RETAINED = RETAINED + | CONDITIONALLY_RETAINED } export namespace LocalFlags { export function join(left: LocalFlags, right: LocalFlags): LocalFlags { @@ -324,7 +324,7 @@ export class Flow { var scopedLocals = this.scopedLocals; if (!scopedLocals) this.scopedLocals = scopedLocals = new Map(); scopedLocals.set("~auto" + (this.parentFunction.nextAutoreleaseId++), local); - this.setLocalFlag(local.index, LocalFlags.AUTORELEASE); + this.setLocalFlag(local.index, LocalFlags.RETAINED); return local; } @@ -585,7 +585,7 @@ export class Flow { var localFlags = other.localFlags; for (let i = 0, k = localFlags.length; i < k; ++i) { let flags = localFlags[i]; - if (flags & LocalFlags.AUTORELEASE) this.setLocalFlag(i, LocalFlags.CONDITIONALLY_AUTORELEASE); + if (flags & LocalFlags.RETAINED) this.setLocalFlag(i, LocalFlags.CONDITIONALLY_RETAINED); if (flags & LocalFlags.READFROM) this.setLocalFlag(i, LocalFlags.CONDITIONALLY_READFROM); if (flags & LocalFlags.WRITTENTO) this.setLocalFlag(i, LocalFlags.CONDITIONALLY_WRITTENTO); } diff --git a/src/glue/binaryen.d.ts b/src/glue/binaryen.d.ts index 2235487b..f3f6376e 100644 --- a/src/glue/binaryen.d.ts +++ b/src/glue/binaryen.d.ts @@ -22,6 +22,16 @@ declare function _BinaryenTypeVec128(): BinaryenType; declare function _BinaryenTypeUnreachable(): BinaryenType; declare function _BinaryenTypeAuto(): BinaryenType; +declare type BinaryenFeatureFlags = u32; + +declare function _BinaryenFeatureAtomics(): BinaryenFeatureFlags; +declare function _BinaryenFeatureMutableGlobals(): BinaryenFeatureFlags; +declare function _BinaryenFeatureNontrappingFPToInt(): BinaryenFeatureFlags; +declare function _BinaryenFeatureSIMD128(): BinaryenFeatureFlags; +declare function _BinaryenFeatureBulkMemory(): BinaryenFeatureFlags; +declare function _BinaryenFeatureSignExt(): BinaryenFeatureFlags; +declare function _BinaryenFeatureExceptionHandling(): BinaryenFeatureFlags; + declare type BinaryenExpressionId = i32; declare function _BinaryenInvalidId(): BinaryenExpressionId; @@ -612,6 +622,8 @@ declare function _BinaryenModuleRead(input: usize, inputSize: usize): BinaryenMo declare function _BinaryenModuleInterpret(module: BinaryenModuleRef): void; declare function _BinaryenModuleAddDebugInfoFileName(module: BinaryenModuleRef, filename: usize): BinaryenIndex; declare function _BinaryenModuleGetDebugInfoFileName(module: BinaryenModuleRef, index: BinaryenIndex): usize; +declare function _BinaryenGetFeatures(module: BinaryenModuleRef): BinaryenFeatureFlags; +declare function _BinaryenSetFeatures(module: BinaryenModuleRef, featureFlags: BinaryenFeatureFlags): void; declare type BinaryenRelooperRef = usize; declare type BinaryenRelooperBlockRef = usize; diff --git a/src/module.ts b/src/module.ts index 7fcb992c..164e2b6d 100644 --- a/src/module.ts +++ b/src/module.ts @@ -27,6 +27,16 @@ export enum NativeType { Auto = _BinaryenTypeAuto() } +export enum FeatureFlags { + Atomics = _BinaryenFeatureAtomics(), + MutableGloabls = _BinaryenFeatureMutableGlobals(), + NontrappingFPToInt = _BinaryenFeatureNontrappingFPToInt(), + SIMD128 = _BinaryenFeatureSIMD128(), + BulkMemory = _BinaryenFeatureBulkMemory(), + SignExt = _BinaryenFeatureSignExt(), + ExceptionHandling = _BinaryenFeatureExceptionHandling() +} + export enum ExpressionId { Invalid = _BinaryenInvalidId(), Block = _BinaryenBlockId(), @@ -553,6 +563,7 @@ export class Module { offset: Index = 0, align: Index = bytes // naturally aligned by default ): ExpressionRef { + if (type < NativeType.None || type > NativeType.V128) throw new Error("here: " + type); return _BinaryenStore(this.ref, bytes, offset, align, ptr, value, type); } @@ -1044,6 +1055,14 @@ export class Module { _BinaryenSetDebugInfo(on); } + getFeatures(): BinaryenFeatureFlags { + return _BinaryenGetFeatures(this.ref); + } + + setFeatures(featureFlags: BinaryenFeatureFlags): void { + _BinaryenSetFeatures(this.ref, featureFlags); + } + optimize(func: FunctionRef = 0): void { if (func) { _BinaryenFunctionOptimize(func, this.ref); diff --git a/src/program.ts b/src/program.ts index c0b859fd..6e30e719 100644 --- a/src/program.ts +++ b/src/program.ts @@ -309,13 +309,6 @@ function operatorKindFromDecorator(decoratorKind: DecoratorKind, arg: string): O return OperatorKind.INVALID; } -/** Garbage collector kind present. */ -export enum CollectorKind { - NONE, - TRACING, - COUNTING -} - /** Represents an AssemblyScript program. */ export class Program extends DiagnosticEmitter { @@ -794,13 +787,18 @@ export class Program extends DiagnosticEmitter { if (globalAliases) { for (let [alias, name] of globalAliases) { if (!name.length) continue; // explicitly disabled - let elementsByName = this.elementsByName; - let element = elementsByName.get(name); - if (element) { - if (elementsByName.has(alias)) throw new Error("duplicate global element: " + name); - elementsByName.set(alias, element); + let firstChar = name.charCodeAt(0); + if (firstChar >= CharCode._0 && firstChar <= CharCode._9) { + this.registerConstantInteger(alias, Type.i32, i64_new(parseI32(name, 10))); + } else { + let elementsByName = this.elementsByName; + let element = elementsByName.get(name); + if (element) { + if (elementsByName.has(alias)) throw new Error("duplicate global element: " + name); + elementsByName.set(alias, element); + } + else throw new Error("no such global element: " + name); } - else throw new Error("no such global element: " + name); } } } diff --git a/src/types.ts b/src/types.ts index eaa17ab8..2caf8e9b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -7,8 +7,7 @@ import { Class, FunctionTarget, Program, - DecoratorFlags, - CollectorKind + DecoratorFlags } from "./program"; import { diff --git a/std/assembly/array.ts b/std/assembly/array.ts index 1811681a..934dfda7 100644 --- a/std/assembly/array.ts +++ b/std/assembly/array.ts @@ -7,18 +7,20 @@ import { itoa, dtoa, itoa_stream, dtoa_stream, MAX_DOUBLE_LENGTH } from "./util/ import { idof, isArray as builtin_isArray } from "./builtins"; import { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_EMPTYARRAY, E_HOLEYARRAY } from "./util/error"; -/** Ensures that the given array has _at least_ the specified capacity. */ -function ensureCapacity(array: ArrayBufferView, minCapacity: i32, alignLog2: u32): void { - if (minCapacity > array.dataLength >>> alignLog2) { - if (minCapacity > (BLOCK_MAXSIZE >>> alignLog2)) throw new RangeError(E_INVALIDLENGTH); - let oldData = array.data; - let newByteLength = minCapacity << alignLog2; - let newData = __realloc(changetype(oldData), newByteLength); // registers on move - if (newData !== changetype(oldData)) { - array.data = changetype(newData); // retains - array.dataStart = newData; +/** Ensures that the given array has _at least_ the specified backing size. */ +function ensureSize(array: usize, minSize: usize, alignLog2: u32): void { + var oldCapacity = changetype(array).dataLength; + if (minSize > oldCapacity >>> alignLog2) { + if (minSize > BLOCK_MAXSIZE >>> alignLog2) throw new RangeError(E_INVALIDLENGTH); + let oldData = changetype(changetype(array).data); + let newCapacity = minSize << alignLog2; + let newData = __realloc(oldData, newCapacity); + memory.fill(newData + oldCapacity, 0, newCapacity - oldCapacity); + if (newData !== oldData) { // oldData has been free'd + store(changetype(array), __retain(newData), offsetof("data")); + changetype(array).dataStart = newData; } - array.dataLength = newByteLength; + changetype(array).dataLength = newCapacity; } } @@ -41,10 +43,10 @@ export class Array extends ArrayBufferView { static create(capacity: i32 = 0): Array { if (capacity > BLOCK_MAXSIZE >>> alignof()) throw new RangeError(E_INVALIDLENGTH); - var array = __allocArray(capacity, alignof(), idof()); + var array = changetype>(__allocArray(capacity, alignof(), idof())); // retains changetype>(array).length_ = 0; // safe even if T is a non-nullable reference - memory.fill(changetype(array).dataStart, 0, changetype(array).dataLength); - return changetype>(array); // retains + memory.fill(array.dataStart, 0, array.dataLength); + return array; } constructor(length: i32 = 0) { @@ -71,7 +73,7 @@ export class Array extends ArrayBufferView { if (length > this.length_) throw new Error(E_HOLEYARRAY); } } - ensureCapacity(this, length, alignof()); + ensureSize(changetype(this), length, alignof()); this.length_ = length; } @@ -110,7 +112,7 @@ export class Array extends ArrayBufferView { if (index > length) throw new Error(E_HOLEYARRAY); } } - ensureCapacity(this, index + 1, alignof()); + ensureSize(changetype(this), index + 1, alignof()); this.__unchecked_set(index, value); if (index >= length) this.length_ = index + 1; } @@ -177,7 +179,7 @@ export class Array extends ArrayBufferView { push(value: T): i32 { var length = this.length_; var newLength = length + 1; - ensureCapacity(this, newLength, alignof()); + ensureSize(changetype(this), newLength, alignof()); if (isManaged()) { let offset = this.dataStart + (length << alignof()); store(offset, __retainRelease(changetype(value), load(offset))); @@ -193,8 +195,8 @@ export class Array extends ArrayBufferView { var otherLen = select(0, other.length_, other === null); var outLen = thisLen + otherLen; if (outLen > BLOCK_MAXSIZE >>> alignof()) throw new Error(E_INVALIDLENGTH); - var out = __allocArray(outLen, alignof(), idof>()); - var outStart = changetype(out).dataStart; + var out = changetype>(__allocArray(outLen, alignof(), idof>())); // retains + var outStart = out.dataStart; var thisSize = thisLen << alignof(); if (isManaged()) { let thisStart = this.dataStart; @@ -213,7 +215,7 @@ export class Array extends ArrayBufferView { memory.copy(outStart, this.dataStart, thisSize); memory.copy(outStart + thisSize, other.dataStart, otherLen << alignof()); } - return changetype>(out); + return out; } copyWithin(target: i32, start: i32, end: i32 = i32.MAX_VALUE): this { @@ -259,8 +261,8 @@ export class Array extends ArrayBufferView { map(callbackfn: (value: T, index: i32, array: Array) => U): Array { var length = this.length_; - var out = __allocArray(length, alignof(), idof>()); - var outStart = changetype(out).dataStart; + var out = changetype>(__allocArray(length, alignof(), idof>())); // retains + var outStart = out.dataStart; for (let index = 0; index < min(length, this.length_); ++index) { let result = callbackfn(load(this.dataStart + (index << alignof())), index, this); // retains if (isManaged()) { @@ -270,16 +272,16 @@ export class Array extends ArrayBufferView { } // releases result } - return changetype>(out); // retains + return out; } filter(callbackfn: (value: T, index: i32, array: Array) => bool): Array { - var result = __allocArray(0, alignof(), idof>()); + var result = changetype>(__allocArray(0, alignof(), idof>())); // retains for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) { let value = load(this.dataStart + (index << alignof())); - if (callbackfn(value, index, this)) changetype>(result).push(value); + if (callbackfn(value, index, this)) result.push(value); } - return changetype>(result); // retains + return result; } reduce( @@ -332,7 +334,7 @@ export class Array extends ArrayBufferView { unshift(element: T): i32 { var newLength = this.length_ + 1; - ensureCapacity(this, newLength, alignof()); + ensureSize(changetype(this), newLength, alignof()); var dataStart = this.dataStart; memory.copy( dataStart + sizeof(), @@ -353,8 +355,8 @@ export class Array extends ArrayBufferView { begin = begin < 0 ? max(begin + length, 0) : min(begin, length); end = end < 0 ? max(end + length, 0) : min(end , length); length = max(end - begin, 0); - var slice = __allocArray(length, alignof(), idof>()); - var sliceBase = changetype(slice).dataStart; + var slice = changetype>(__allocArray(length, alignof(), idof>())); // retains + var sliceBase = slice.dataStart; var thisBase = this.dataStart + (begin << alignof()); if (isManaged()) { let off = 0; @@ -367,15 +369,15 @@ export class Array extends ArrayBufferView { } else { memory.copy(sliceBase, thisBase, length << alignof()); } - return changetype>(slice); // retains + return slice; } splice(start: i32, deleteCount: i32 = i32.MAX_VALUE): Array { var length = this.length_; start = start < 0 ? max(length + start, 0) : min(start, length); deleteCount = max(min(deleteCount, length - start), 0); - var result = __allocArray(deleteCount, alignof(), idof>()); - var resultStart = changetype(result).dataStart; + var result = changetype>(__allocArray(deleteCount, alignof(), idof>())); // retains + var resultStart = result.dataStart; var thisStart = this.dataStart; var thisBase = thisStart + (start << alignof()); if (isManaged()) { @@ -401,7 +403,7 @@ export class Array extends ArrayBufferView { ); } this.length_ = length - deleteCount; - return changetype>(result); // retains + return result; } reverse(): Array { @@ -421,9 +423,6 @@ export class Array extends ArrayBufferView { } sort(comparator: (a: T, b: T) => i32 = COMPARATOR()): this { - // TODO remove this when flow will allow tracking null - assert(comparator); // The comparison function must be a function - var length = this.length_; if (length <= 1) return this; var base = this.dataStart; @@ -460,21 +459,21 @@ export class Array extends ArrayBufferView { var sepLen = separator.length; var valueLen = 5; // max possible length of element len("false") var estLen = (valueLen + sepLen) * lastIndex + valueLen; - var result = __alloc(estLen << 1, idof()); + var result = changetype(__alloc(estLen << 1, idof())); // retains var offset = 0; var value: bool; for (let i = 0; i < lastIndex; ++i) { value = load(dataStart + i); valueLen = 4 + i32(!value); memory.copy( - result + (offset << 1), + changetype(result) + (offset << 1), changetype(select("true", "false", value)), valueLen << 1 ); offset += valueLen; if (sepLen) { memory.copy( - result + (offset << 1), + changetype(result) + (offset << 1), changetype(separator), sepLen << 1 ); @@ -484,16 +483,14 @@ export class Array extends ArrayBufferView { value = load(dataStart + lastIndex); valueLen = 4 + i32(!value); memory.copy( - result + (offset << 1), + changetype(result) + (offset << 1), changetype(select("true", "false", value)), valueLen << 1 ); offset += valueLen; - if (estLen > offset) { - return changetype(result).substring(0, offset); // retains/releases result, retains return - } - return changetype(result); // retains + if (estLen > offset) return result.substring(0, offset); + return result; } private join_int(separator: string = ","): string { @@ -506,16 +503,16 @@ export class Array extends ArrayBufferView { var sepLen = separator.length; const valueLen = (sizeof() <= 4 ? 10 : 20) + i32(isSigned()); var estLen = (valueLen + sepLen) * lastIndex + valueLen; - var result = __alloc(estLen << 1, idof()); + var result = changetype(__alloc(estLen << 1, idof())); // retains var offset = 0; var value: T; for (let i = 0; i < lastIndex; ++i) { value = load(dataStart + (i << alignof())); // @ts-ignore: type - offset += itoa_stream(result, offset, value); + offset += itoa_stream(changetype(result), offset, value); if (sepLen) { memory.copy( - result + (offset << 1), + changetype(result) + (offset << 1), changetype(separator), sepLen << 1 ); @@ -524,11 +521,9 @@ export class Array extends ArrayBufferView { } value = load(dataStart + (lastIndex << alignof())); // @ts-ignore: type - offset += itoa_stream(result, offset, value); - if (estLen > offset) { - return changetype(result).substring(0, offset); // retains/releases result, retains return - } - return changetype(result); // retains + offset += itoa_stream(changetype(result), offset, value); + if (estLen > offset) return result.substring(0, offset); + return result; } private join_flt(separator: string = ","): string { @@ -545,18 +540,18 @@ export class Array extends ArrayBufferView { const valueLen = MAX_DOUBLE_LENGTH; var sepLen = separator.length; var estLen = (valueLen + sepLen) * lastIndex + valueLen; - var result = __alloc(estLen << 1, idof()); + var result = changetype(__alloc(estLen << 1, idof())); // retains var offset = 0; var value: T; for (let i = 0; i < lastIndex; ++i) { value = load(dataStart + (i << alignof())); - offset += dtoa_stream(result, offset, + offset += dtoa_stream(changetype(result), offset, // @ts-ignore: type value ); if (sepLen) { memory.copy( - result + (offset << 1), + changetype(result) + (offset << 1), changetype(separator), sepLen << 1 ); @@ -564,14 +559,12 @@ export class Array extends ArrayBufferView { } } value = load(dataStart + (lastIndex << alignof())); - offset += dtoa_stream(result, offset, + offset += dtoa_stream(changetype(result), offset, // @ts-ignore: type value ); - if (estLen > offset) { - return changetype(result).substring(0, offset); // retains/releases result, retains return - } - return changetype(result); // retains + if (estLen > offset) return result.substring(0, offset); + return result; } private join_str(separator: string = ","): string { @@ -588,13 +581,13 @@ export class Array extends ArrayBufferView { if (value !== null) estLen += value.length; } var offset = 0; - var result = __alloc((estLen + sepLen * lastIndex) << 1, idof()); + var result = changetype(__alloc((estLen + sepLen * lastIndex) << 1, idof())); // retains for (let i = 0; i < lastIndex; ++i) { value = load(dataStart + (i << alignof())); if (value !== null) { let valueLen = changetype(value).length; memory.copy( - result + (offset << 1), + changetype(result) + (offset << 1), changetype(value), valueLen << 1 ); @@ -602,7 +595,7 @@ export class Array extends ArrayBufferView { } if (sepLen) { memory.copy( - result + (offset << 1), + changetype(result) + (offset << 1), changetype(separator), sepLen << 1 ); @@ -612,12 +605,12 @@ export class Array extends ArrayBufferView { value = load(dataStart + (lastIndex << alignof())); if (value !== null) { memory.copy( - result + (offset << 1), + changetype(result) + (offset << 1), changetype(value), changetype(value).length << 1 ); } - return changetype(result); // retains + return result; } private join_arr(separator: string = ","): string { @@ -654,14 +647,14 @@ export class Array extends ArrayBufferView { const valueLen = 15; // max possible length of element len("[object Object]") var sepLen = separator.length; var estLen = (valueLen + sepLen) * lastIndex + valueLen; - var result = __alloc(estLen << 1, idof()); + var result = changetype(__alloc(estLen << 1, idof())); var offset = 0; var value: T; for (let i = 0; i < lastIndex; ++i) { value = load(base + (i << alignof())); if (value) { memory.copy( - result + (offset << 1), + changetype(result) + (offset << 1), changetype("[object Object]"), valueLen << 1 ); @@ -669,7 +662,7 @@ export class Array extends ArrayBufferView { } if (sepLen) { memory.copy( - result + (offset << 1), + changetype(result) + (offset << 1), changetype(separator), sepLen << 1 ); @@ -678,42 +671,32 @@ export class Array extends ArrayBufferView { } if (load(base + (lastIndex << alignof()))) { memory.copy( - result + (offset << 1), + changetype(result) + (offset << 1), changetype("[object Object]"), valueLen << 1 ); offset += valueLen; } - if (estLen > offset) { - return changetype(result).substring(0, offset); // retains/releases result, retains return - } - return changetype(result); // retains + if (estLen > offset) return result.substring(0, offset); + return result; } toString(): string { return this.join(); } - // GC integration + // RT integration - @unsafe private __traverse(cookie: u32): void { - __visit(changetype(this.data), cookie); + @unsafe private __visit_impl(cookie: u32): void { if (isManaged()) { let cur = this.dataStart; let end = cur + this.dataLength; while (cur < end) { let val = load(cur); - if (isNullable()) { - if (val) { - __visit(val, cookie); - __visit_members(val, cookie); - } - } else { - __visit(val, cookie); - __visit_members(val, cookie); - } + if (val) __visit(val, cookie); cur += sizeof(); } } + // automatically visits ArrayBufferView (.data) next } } diff --git a/std/assembly/arraybuffer.ts b/std/assembly/arraybuffer.ts index d02feecf..9725098a 100644 --- a/std/assembly/arraybuffer.ts +++ b/std/assembly/arraybuffer.ts @@ -12,9 +12,9 @@ export abstract class ArrayBufferView { protected constructor(length: i32, alignLog2: i32) { if (length > BLOCK_MAXSIZE >>> alignLog2) throw new RangeError(E_INVALIDLENGTH); - var buffer = new ArrayBuffer(length = length << alignLog2); - this.data = buffer; // retains - this.dataStart = changetype(buffer); + var buffer = __alloc(length = length << alignLog2, idof()); + this.data = changetype(buffer); // retains + this.dataStart = buffer; this.dataLength = length; } diff --git a/std/assembly/fixedarray.ts b/std/assembly/fixedarray.ts index 039d83d6..b0487f9a 100644 --- a/std/assembly/fixedarray.ts +++ b/std/assembly/fixedarray.ts @@ -56,23 +56,15 @@ export class FixedArray { } } - // GC integration + // RT integration - @unsafe private __traverse(cookie: u32): void { + @unsafe private __visit_impl(cookie: u32): void { if (isManaged()) { let cur = changetype(this); let end = cur + changetype(changetype(this) - BLOCK_OVERHEAD).rtSize; while (cur < end) { let val = load(cur); - if (isNullable()) { - if (val) { - __visit(val, cookie); - __visit_members(val, cookie); - } - } else { - __visit(val, cookie); - __visit_members(val, cookie); - } + if (val) __visit(val, cookie); cur += sizeof(); } } diff --git a/std/assembly/map.ts b/std/assembly/map.ts index d87b97a7..a609c6bc 100644 --- a/std/assembly/map.ts +++ b/std/assembly/map.ts @@ -187,14 +187,13 @@ export class Map { return "[object Map]"; } - // GC integration + // RT integration - @unsafe private __traverse(cookie: u32): void { + @unsafe private __visit_impl(cookie: u32): void { __visit(changetype(this.buckets), cookie); - var entries = this.entries; - __visit(changetype(entries), cookie); + var entries = changetype(this.entries); if (isManaged() || isManaged()) { - let cur = changetype(entries); + let cur = entries; let end = cur + this.entriesOffset * ENTRY_SIZE(); while (cur < end) { let entry = changetype>(cur); @@ -202,30 +201,19 @@ export class Map { if (isManaged()) { let val = changetype(entry.key); if (isNullable()) { - if (val) { - __visit(val, cookie); - __visit_members(val, cookie); - } - } else { - __visit(val, cookie); - __visit_members(val, cookie); - } + if (val) __visit(val, cookie); + } else __visit(val, cookie); } if (isManaged()) { let val = changetype(entry.value); if (isNullable()) { - if (val) { - __visit(val, cookie); - __visit_members(val, cookie); - } - } else { - __visit(val, cookie); - __visit_members(val, cookie); - } + if (val) __visit(val, cookie); + } else __visit(val, cookie); } } cur += ENTRY_SIZE(); } } + __visit(entries, cookie); } } diff --git a/std/assembly/rt/common.ts b/std/assembly/rt/common.ts index a1115d5b..1d1270e0 100644 --- a/std/assembly/rt/common.ts +++ b/std/assembly/rt/common.ts @@ -46,14 +46,14 @@ import { RTTI_BASE } from "builtins"; import { RTTIData, RTTIFlags } from "common/rtti"; +import { E_INDEXOUTOFRANGE } from "../util/error"; // @ts-ignore: decorator @unsafe @global export function __typeinfo(id: u32): RTTIFlags { var ptr = RTTI_BASE; - return !id || id > load(ptr) - ? unreachable() - : changetype(ptr + id * offsetof()).flags; + if (!id || id > load(ptr)) throw new Error(E_INDEXOUTOFRANGE); + return changetype(ptr + id * offsetof()).flags; } // @ts-ignore: decorator @@ -79,7 +79,7 @@ export function __allocArray(length: i32, alignLog2: usize, id: u32, data: usize var array = __alloc(offsetof(), id); var bufferSize = length << alignLog2; var buffer = __alloc(bufferSize, idof()); - changetype(array).data = changetype(buffer); // TODO/RT: retains + store(array, __retain(buffer), offsetof("data")); changetype(array).dataStart = buffer; changetype(array).dataLength = bufferSize; store(changetype(array), length, offsetof("length_")); diff --git a/std/assembly/rt/index-stub.ts b/std/assembly/rt/index-stub.ts index 132db8c2..6822a518 100644 --- a/std/assembly/rt/index-stub.ts +++ b/std/assembly/rt/index-stub.ts @@ -1,85 +1,2 @@ -import { AL_MASK, BLOCK, BLOCK_OVERHEAD, BLOCK_MAXSIZE } from "rt/common"; - -// @ts-ignore: decorator -@lazy -var startOffset: usize = (HEAP_BASE + AL_MASK) & ~AL_MASK; - -// @ts-ignore: decorator -@lazy -var offset: usize = startOffset; - -// @ts-ignore: decorator -@unsafe @global -export function __alloc(size: usize, id: u32): usize { - if (size > BLOCK_MAXSIZE) unreachable(); - var ptr = offset + BLOCK_OVERHEAD; - var newPtr = (ptr + max(size, 1) + AL_MASK) & ~AL_MASK; - var pagesBefore = memory.size(); - if (newPtr > pagesBefore << 16) { - let pagesNeeded = ((newPtr - ptr + 0xffff) & ~0xffff) >>> 16; - let pagesWanted = max(pagesBefore, pagesNeeded); // double memory - if (memory.grow(pagesWanted) < 0) { - if (memory.grow(pagesNeeded) < 0) unreachable(); // out of memory - } - } - offset = newPtr; - var block = changetype(ptr - BLOCK_OVERHEAD); - block.rtId = id; - block.rtSize = size; - return ptr; -} - -// @ts-ignore: decorator -@unsafe @global -export function __realloc(ref: usize, size: usize): usize { - var block = changetype(ref - BLOCK_OVERHEAD); - var oldSize = block.rtSize; - if (size > oldSize) { - let newRef = __alloc(size, block.rtId); - memory.copy(newRef, ref, oldSize); - ref = newRef; - } else { - block.rtSize = size; - } - return ref; -} - -// @ts-ignore: decorator -@unsafe @global -export function __free(ref: usize): void { -} - -// @ts-ignore: decorator -// @unsafe @global -// export function __reset(): void { // special -// offset = startOffset; -// } - -// @ts-ignore: decorator -@global @unsafe -export function __retain(ref: usize): usize { - return ref; -} - -// @ts-ignore: decorator -@global @unsafe -export function __release(ref: usize): void { -} - -// @ts-ignore: decorator -@global @unsafe -function __visit(ref: usize, cookie: u32): void { -} - -// @ts-ignore: decorator -@global @unsafe -function __retainRelease(ref: usize, oldRef: usize): usize { - return ref; -} - -// @ts-ignore: decorator -@global @unsafe -export function __collect(): void { -} - +export { __alloc, __realloc, __free, __retain, __release, __collect } from "rt/stub"; export { __instanceof, __typeinfo } from "rt/common"; diff --git a/std/assembly/rt/purerc.ts b/std/assembly/rt/purerc.ts index 8abbf6eb..21767db1 100644 --- a/std/assembly/rt/purerc.ts +++ b/std/assembly/rt/purerc.ts @@ -1,4 +1,4 @@ -import { DEBUG, BLOCK_OVERHEAD, BLOCK } from "rt/common"; +import { DEBUG, BLOCK_OVERHEAD } from "rt/common"; import { Block, freeBlock, ROOT } from "rt/tlsf"; import { RTTIFlags } from "common/rtti"; @@ -102,12 +102,16 @@ function increment(s: Block): void { var info = s.gcInfo; assert((info & ~REFCOUNT_MASK) == ((info + 1) & ~REFCOUNT_MASK)); // overflow s.gcInfo = info + 1; + if (isDefined(ASC_RTRACE)) onIncrement(s); + if (DEBUG) assert(!(s.mmInfo & 1)); // used } /** Decrements the reference count of the specified block by one, possibly freeing it. */ function decrement(s: Block): void { var info = s.gcInfo; var rc = info & REFCOUNT_MASK; + if (isDefined(ASC_RTRACE)) onDecrement(s); + if (DEBUG) assert(!(s.mmInfo & 1)); // used if (rc == 1) { __visit_members(changetype(s) + BLOCK_OVERHEAD, VISIT_DECREMENT); if (!(info & BUFFERED_MASK)) { @@ -261,3 +265,11 @@ export function __retainRelease(ref: usize, oldRef: usize): usize { } return ref; } + +// @ts-ignore: decorator +@external("rtrace", "retain") +declare function onIncrement(s: Block): void; + +// @ts-ignore: decorator +@external("rtrace", "release") +declare function onDecrement(s: Block): void; diff --git a/std/assembly/rt/stub.ts b/std/assembly/rt/stub.ts new file mode 100644 index 00000000..54d49087 --- /dev/null +++ b/std/assembly/rt/stub.ts @@ -0,0 +1,83 @@ +import { AL_MASK, BLOCK, BLOCK_OVERHEAD, BLOCK_MAXSIZE } from "rt/common"; + +// @ts-ignore: decorator +@lazy +var startOffset: usize = (HEAP_BASE + AL_MASK) & ~AL_MASK; + +// @ts-ignore: decorator +@lazy +var offset: usize = startOffset; + +// @ts-ignore: decorator +@unsafe @global +export function __alloc(size: usize, id: u32): usize { + if (size > BLOCK_MAXSIZE) unreachable(); + var ptr = offset + BLOCK_OVERHEAD; + var newPtr = (ptr + max(size, 1) + AL_MASK) & ~AL_MASK; + var pagesBefore = memory.size(); + if (newPtr > pagesBefore << 16) { + let pagesNeeded = ((newPtr - ptr + 0xffff) & ~0xffff) >>> 16; + let pagesWanted = max(pagesBefore, pagesNeeded); // double memory + if (memory.grow(pagesWanted) < 0) { + if (memory.grow(pagesNeeded) < 0) unreachable(); // out of memory + } + } + offset = newPtr; + var block = changetype(ptr - BLOCK_OVERHEAD); + block.rtId = id; + block.rtSize = size; + return ptr; +} + +// @ts-ignore: decorator +@unsafe @global +export function __realloc(ref: usize, size: usize): usize { + var block = changetype(ref - BLOCK_OVERHEAD); + var oldSize = block.rtSize; + if (size > oldSize) { + let newRef = __alloc(size, block.rtId); + memory.copy(newRef, ref, oldSize); + ref = newRef; + } else { + block.rtSize = size; + } + return ref; +} + +// @ts-ignore: decorator +@unsafe @global +export function __free(ref: usize): void { +} + +// @ts-ignore: decorator +// @unsafe @global +// export function __reset(): void { // special +// offset = startOffset; +// } + +// @ts-ignore: decorator +@global @unsafe +export function __retain(ref: usize): usize { + return ref; +} + +// @ts-ignore: decorator +@global @unsafe +export function __release(ref: usize): void { +} + +// @ts-ignore: decorator +@global @unsafe +function __visit(ref: usize, cookie: u32): void { +} + +// @ts-ignore: decorator +@global @unsafe +function __retainRelease(ref: usize, oldRef: usize): usize { + return ref; +} + +// @ts-ignore: decorator +@global @unsafe +export function __collect(): void { +} diff --git a/std/assembly/rt/tlsf.ts b/std/assembly/rt/tlsf.ts index 190bf8bc..165136f1 100644 --- a/std/assembly/rt/tlsf.ts +++ b/std/assembly/rt/tlsf.ts @@ -476,7 +476,7 @@ export function allocateBlock(root: Root, size: usize): Block { if (DEBUG) assert(block); // must be found now } if (DEBUG) assert((block.mmInfo & ~TAGS_MASK) >= payloadSize); // must fit - block.gcInfo = 1; // RC=1 + block.gcInfo = 0; // RC=0 // block.rtId = 0; // set by the caller (__alloc) block.rtSize = size; removeBlock(root, block); @@ -520,6 +520,7 @@ export function reallocateBlock(root: Root, block: Block, size: usize): Block { memory.copy(changetype(newBlock) + BLOCK_OVERHEAD, changetype(block) + BLOCK_OVERHEAD, size); block.mmInfo = blockInfo | FREE; insertBlock(root, block); + if (isDefined(ASC_RTRACE)) onFree(block); return newBlock; } @@ -529,6 +530,7 @@ export function freeBlock(root: Root, block: Block): void { assert(!(blockInfo & FREE)); // must be used (user might call through to this) block.mmInfo = blockInfo | FREE; insertBlock(root, block); + if (isDefined(ASC_RTRACE)) onFree(block); } // @ts-ignore: decorator @@ -559,3 +561,7 @@ export function __free(ref: usize): void { assert(ref != 0 && !(ref & AL_MASK)); // must exist and be aligned freeBlock(ROOT, changetype(ref - BLOCK_OVERHEAD)); } + +// @ts-ignore: decorator +@external("rtrace", "free") +declare function onFree(s: Block): void; diff --git a/std/assembly/set.ts b/std/assembly/set.ts index cda13835..fddac80a 100644 --- a/std/assembly/set.ts +++ b/std/assembly/set.ts @@ -167,31 +167,25 @@ export class Set { return "[object Set]"; } - // GC integration + // RT integration - @unsafe private __traverse(cookie: u32): void { + @unsafe private __visit_impl(cookie: u32): void { __visit(changetype(this.buckets), cookie); - var entries = this.entries; - __visit(changetype(entries), cookie); + var entries = changetype(this.entries); if (isManaged()) { - let cur = changetype(entries); + let cur = entries; let end = cur + this.entriesOffset * ENTRY_SIZE(); while (cur < end) { let entry = changetype>(cur); if (!(entry.taggedNext & EMPTY)) { let val = changetype(entry.key); if (isNullable()) { - if (val) { - __visit(val, cookie); - __visit_members(val, cookie); - } - } else { - __visit(val, cookie); - __visit_members(val, cookie); - } + if (val) __visit(val, cookie); + } else __visit(val, cookie); } cur += ENTRY_SIZE(); } } + __visit(entries, cookie); } } diff --git a/std/assembly/string.ts b/std/assembly/string.ts index 1c7cd3c3..a5207b85 100644 --- a/std/assembly/string.ts +++ b/std/assembly/string.ts @@ -68,10 +68,10 @@ import { idof } from "./builtins"; var otherSize: isize = other.length << 1; var outSize: usize = thisSize + otherSize; if (outSize == 0) return changetype(""); - var out = __alloc(outSize, idof()); - memory.copy(out, changetype(this), thisSize); - memory.copy(out + thisSize, changetype(other), otherSize); - return changetype(out); // retains + var out = changetype(__alloc(outSize, idof())); // retains + memory.copy(changetype(out), changetype(this), thisSize); + memory.copy(changetype(out) + thisSize, changetype(other), otherSize); + return out; } endsWith(searchString: String, endPosition: i32 = String.MAX_LENGTH): bool { diff --git a/tests/compiler.js b/tests/compiler.js index 54cf4c25..229e524a 100644 --- a/tests/compiler.js +++ b/tests/compiler.js @@ -212,7 +212,7 @@ tests.forEach(filename => { "--validate", "--measure", "--binaryFile", // -> stdout - "-O3" + // "-O3" ]; if (asc_flags) Array.prototype.push.apply(cmd, asc_flags); @@ -240,7 +240,7 @@ tests.forEach(filename => { if (!ptr) return "null"; var U32 = new Uint32Array(exports.memory ? exports.memory.buffer : memory.buffer); var U16 = new Uint16Array(exports.memory ? exports.memory.buffer : memory.buffer); - var len16 = U32[(ptr - RUNTIME_HEADER_SIZE + 4) >>> 2] >>> 1; + var len16 = U32[(ptr - RUNTIME_HEADER_SIZE + 12) >>> 2] >>> 1; var ptr16 = ptr >>> 1; return String.fromCharCode.apply(String, U16.subarray(ptr16, ptr16 + len16)); } @@ -248,6 +248,12 @@ tests.forEach(filename => { var binaryBuffer = stdout.toBuffer(); if (args.createBinary) fs.writeFileSync(path.join(basedir, basename + ".optimized.wasm"), binaryBuffer); + let rtrace = new Map(); + let rtraceEnabled = false; + let rtraceRetains = 0; + let rtraceReleases = 0; + let rtraceFrees = 0; + let rtraceUsesAfterFree = 0; let runTime = asc.measure(() => { exports = new WebAssembly.Instance(new WebAssembly.Module(binaryBuffer), { env: { @@ -284,6 +290,37 @@ tests.forEach(filename => { foo: { baz: function() {}, "var": 3 + }, + + // runtime tracing + rtrace: { + retain: function(s) { + ++rtraceRetains; + let rc = rtrace.get(s) | 0; + rtrace.set(s, ++rc); + // console.log(" retain(" + s + ", RC=" + rc + ")"); + rtraceEnabled = true; + }, + release: function(s) { + ++rtraceReleases; + let rc = rtrace.get(s) | 0; + if (--rc <= 0) { + rtrace.delete(s); + if (rc < 0) { + ++rtraceUsesAfterFree; + console.log(" USEAFTERFREE(" + s + ", RC=" + rc + ")"); + } + } else rtrace.set(s, rc); + // console.log(" release(" + s + ", RC=" + rc + ")"); + rtraceEnabled = true; + }, + free: function(s) { + ++rtraceFrees; + let rc = rtrace.get(s) | 0; + // if (rc != 0) console.log(" free(" + s + ", RC=" + rc + ")"); + rtrace.delete(s); + rtraceEnabled = true; + } } }).exports; if (exports.main) { @@ -291,6 +328,16 @@ tests.forEach(filename => { var code = exports.main(); console.log(colorsUtil.white(" [exit " + code + "]\n")); } + if (rtraceEnabled) { + console.log("- " + "rtrace: " + rtraceRetains + " retains, " + rtraceReleases + " releases, " + rtraceFrees + " explicit frees"); + if (rtrace.size || rtraceUsesAfterFree) { + let msg = "memory leak detected: " + rtrace.size + " leaking, " + rtraceUsesAfterFree + " uses after free"; + console.log(" " + colorsUtil.red("ERROR: ") + msg); + failed = true; + failedMessages.set(basename, msg); + } + console.log(); + } }); console.log("- " + colorsUtil.green("instantiate OK") + " (" + asc.formatTime(runTime) + ")"); console.log("\n " + Object.keys(exports).map(key => { diff --git a/tests/compiler/abi.optimized.wat b/tests/compiler/abi.optimized.wat index 0abe0f08..2bd761fb 100644 --- a/tests/compiler/abi.optimized.wat +++ b/tests/compiler/abi.optimized.wat @@ -4,8 +4,7 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\0c") - (data (i32.const 24) "a\00b\00i\00.\00t\00s") + (data (i32.const 8) "\0c\00\00\00\01\00\00\00\10\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s") (global $abi/condition (mut i32) (i32.const 0)) (global $abi/y (mut i32) (i32.const 0)) (export "memory" (memory $0)) diff --git a/tests/compiler/abi.untouched.wat b/tests/compiler/abi.untouched.wat index 89527822..daa77aca 100644 --- a/tests/compiler/abi.untouched.wat +++ b/tests/compiler/abi.untouched.wat @@ -4,7 +4,7 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00a\00b\00i\00.\00t\00s\00") + (data (i32.const 8) "\0c\00\00\00\01\00\00\00\10\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $abi/condition (mut i32) (i32.const 0)) diff --git a/tests/compiler/assert.optimized.wat b/tests/compiler/assert.optimized.wat index b70fe4f1..be9888f2 100644 --- a/tests/compiler/assert.optimized.wat +++ b/tests/compiler/assert.optimized.wat @@ -1,10 +1,8 @@ (module (type $FUNCSIG$v (func)) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\12") - (data (i32.const 24) "a\00s\00s\00e\00r\00t\00.\00t\00s") - (data (i32.const 48) "\10\00\00\00\18") - (data (i32.const 64) "m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e") + (data (i32.const 8) "\12\00\00\00\01\00\00\00\10\00\00\00\12\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s") + (data (i32.const 48) "\18\00\00\00\01\00\00\00\10\00\00\00\18\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e") (export "memory" (memory $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop diff --git a/tests/compiler/assert.untouched.wat b/tests/compiler/assert.untouched.wat index e316002e..1bde422d 100644 --- a/tests/compiler/assert.untouched.wat +++ b/tests/compiler/assert.untouched.wat @@ -3,8 +3,8 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\12\00\00\00\00\00\00\00\00\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s\00") - (data (i32.const 48) "\10\00\00\00\18\00\00\00\00\00\00\00\00\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e\00") + (data (i32.const 8) "\12\00\00\00\01\00\00\00\10\00\00\00\12\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s\00") + (data (i32.const 48) "\18\00\00\00\01\00\00\00\10\00\00\00\18\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e\00") (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) diff --git a/tests/compiler/binary.untouched.wat b/tests/compiler/binary.untouched.wat index 899c6070..38ab0e52 100644 --- a/tests/compiler/binary.untouched.wat +++ b/tests/compiler/binary.untouched.wat @@ -1345,34 +1345,32 @@ local.get $5 i32.gt_s if - block + local.get $2 + local.get $3 + i32.ge_u + if local.get $2 local.get $3 - i32.ge_u + i32.eq if - local.get $2 - local.get $3 - i32.eq - if - f32.const 0 - local.get $0 - f32.mul - return - end - local.get $2 - local.get $3 - i32.sub - local.set $2 + f32.const 0 + local.get $0 + f32.mul + return end local.get $2 - i32.const 1 - i32.shl - local.set $2 - local.get $4 - i32.const 1 + local.get $3 i32.sub - local.set $4 + local.set $2 end + local.get $2 + i32.const 1 + i32.shl + local.set $2 + local.get $4 + i32.const 1 + i32.sub + local.set $4 br $continue|0 end end @@ -2623,34 +2621,32 @@ local.get $5 i64.gt_s if - block + local.get $2 + local.get $3 + i64.ge_u + if local.get $2 local.get $3 - i64.ge_u + i64.eq if - local.get $2 - local.get $3 - i64.eq - if - f64.const 0 - local.get $0 - f64.mul - return - end - local.get $2 - local.get $3 - i64.sub - local.set $2 + f64.const 0 + local.get $0 + f64.mul + return end local.get $2 - i64.const 1 - i64.shl - local.set $2 - local.get $4 - i64.const 1 + local.get $3 i64.sub - local.set $4 + local.set $2 end + local.get $2 + i64.const 1 + i64.shl + local.set $2 + local.get $4 + i64.const 1 + i64.sub + local.set $4 br $continue|0 end end diff --git a/tests/compiler/bool.optimized.wat b/tests/compiler/bool.optimized.wat index 698b678a..da10001a 100644 --- a/tests/compiler/bool.optimized.wat +++ b/tests/compiler/bool.optimized.wat @@ -3,15 +3,14 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\0e") - (data (i32.const 24) "b\00o\00o\00l\00.\00t\00s") - (global $bool/i (mut i32) (i32.const 2)) - (global $bool/I (mut i64) (i64.const 2)) - (global $bool/u (mut i32) (i32.const 2)) - (global $bool/U (mut i64) (i64.const 2)) - (global $bool/f (mut f32) (f32.const 2)) - (global $bool/F (mut f64) (f64.const 2)) - (global $bool/uu (mut i32) (i32.const 2)) + (data (i32.const 8) "\0e\00\00\00\01\00\00\00\10\00\00\00\0e\00\00\00b\00o\00o\00l\00.\00t\00s") + (global $bool/i i32 (i32.const 2)) + (global $bool/I i64 (i64.const 2)) + (global $bool/u i32 (i32.const 2)) + (global $bool/U i64 (i64.const 2)) + (global $bool/f f32 (f32.const 2)) + (global $bool/F f64 (f64.const 2)) + (global $bool/uu i32 (i32.const 2)) (export "memory" (memory $0)) (start $start) (func $start:bool (; 1 ;) (type $FUNCSIG$v) diff --git a/tests/compiler/bool.untouched.wat b/tests/compiler/bool.untouched.wat index bee3cecb..dc5d0846 100644 --- a/tests/compiler/bool.untouched.wat +++ b/tests/compiler/bool.untouched.wat @@ -3,7 +3,7 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00b\00o\00o\00l\00.\00t\00s\00") + (data (i32.const 8) "\0e\00\00\00\01\00\00\00\10\00\00\00\0e\00\00\00b\00o\00o\00l\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $bool/i (mut i32) (i32.const 2)) diff --git a/tests/compiler/builtins.optimized.wat b/tests/compiler/builtins.optimized.wat index f0fadc98..582a84ab 100644 --- a/tests/compiler/builtins.optimized.wat +++ b/tests/compiler/builtins.optimized.wat @@ -4,11 +4,9 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\16") - (data (i32.const 24) "b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s") - (data (i32.const 48) "\10") - (data (i32.const 64) "\10\00\00\00\06") - (data (i32.const 80) "a\00b\00c") + (data (i32.const 8) "\16\00\00\00\01\00\00\00\10\00\00\00\16\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s") + (data (i32.const 52) "\01\00\00\00\10") + (data (i32.const 64) "\06\00\00\00\01\00\00\00\10\00\00\00\06\00\00\00a\00b\00c") (table $0 2 funcref) (elem (i32.const 0) $builtins/test $start:builtins~anonymous|0) (global $builtins/b (mut i32) (i32.const 0)) @@ -19,7 +17,7 @@ (global $builtins/u (mut i32) (i32.const 0)) (global $builtins/U (mut i64) (i64.const 0)) (global $builtins/s (mut i32) (i32.const 0)) - (global $builtins/fn (mut i32) (i32.const 1)) + (global $builtins/fn i32 (i32.const 1)) (export "memory" (memory $0)) (export "test" (func $builtins/test)) (start $start) diff --git a/tests/compiler/builtins.untouched.wat b/tests/compiler/builtins.untouched.wat index f1c9e8f7..2a987dde 100644 --- a/tests/compiler/builtins.untouched.wat +++ b/tests/compiler/builtins.untouched.wat @@ -6,9 +6,9 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\16\00\00\00\00\00\00\00\00\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s\00") - (data (i32.const 48) "\10\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 64) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00a\00b\00c\00") + (data (i32.const 8) "\16\00\00\00\01\00\00\00\10\00\00\00\16\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s\00") + (data (i32.const 48) "\00\00\00\00\01\00\00\00\10\00\00\00\00\00\00\00") + (data (i32.const 64) "\06\00\00\00\01\00\00\00\10\00\00\00\06\00\00\00a\00b\00c\00") (table $0 2 funcref) (elem (i32.const 0) $null $start:builtins~anonymous|0) (global $builtins/b (mut i32) (i32.const 0)) diff --git a/tests/compiler/call-inferred.optimized.wat b/tests/compiler/call-inferred.optimized.wat index 7999547f..870e20fe 100644 --- a/tests/compiler/call-inferred.optimized.wat +++ b/tests/compiler/call-inferred.optimized.wat @@ -1,8 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 1) - (data (i32.const 8) "\10\00\00\00 ") - (data (i32.const 24) "c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s") + (data (i32.const 8) " \00\00\00\01\00\00\00\10\00\00\00 \00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s") (export "memory" (memory $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop diff --git a/tests/compiler/call-inferred.untouched.wat b/tests/compiler/call-inferred.untouched.wat index 9f45f175..b3ea04e4 100644 --- a/tests/compiler/call-inferred.untouched.wat +++ b/tests/compiler/call-inferred.untouched.wat @@ -6,7 +6,7 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00 \00\00\00\00\00\00\00\00\00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s\00") + (data (i32.const 8) " \00\00\00\01\00\00\00\10\00\00\00 \00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) diff --git a/tests/compiler/do.optimized.wat b/tests/compiler/do.optimized.wat index b803d615..71f240b0 100644 --- a/tests/compiler/do.optimized.wat +++ b/tests/compiler/do.optimized.wat @@ -3,8 +3,9 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\n") - (data (i32.const 24) "d\00o\00.\00t\00s") + (data (i32.const 8) "\n\00\00\00\01\00\00\00\10\00\00\00\n\00\00\00d\00o\00.\00t\00s\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) (global $do/n (mut i32) (i32.const 10)) (global $do/m (mut i32) (i32.const 0)) (global $do/o (mut i32) (i32.const 0)) @@ -12,19 +13,26 @@ (start $start) (func $start:do (; 1 ;) (type $FUNCSIG$v) (local $0 i32) - loop $continue|0 - global.get $do/n - i32.const 1 - i32.sub - global.set $do/n - global.get $do/m - i32.const 1 - i32.add - global.set $do/m - global.get $do/n - br_if $continue|0 + block $break|0 + loop $continue|0 + block + global.get $do/n + i32.const 1 + i32.sub + global.set $do/n + global.get $do/m + i32.const 1 + i32.add + global.set $do/m + end + global.get $do/n + br_if $continue|0 + end end global.get $do/n + i32.const 0 + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -35,7 +43,8 @@ end global.get $do/m i32.const 10 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -46,18 +55,24 @@ end i32.const 10 global.set $do/n - loop $continue|1 - global.get $do/n - local.tee $0 - i32.const 1 - i32.sub - global.set $do/n - local.get $0 - br_if $continue|1 + block $break|1 + loop $continue|1 + nop + block (result i32) + global.get $do/n + local.tee $0 + i32.const 1 + i32.sub + global.set $do/n + local.get $0 + end + br_if $continue|1 + end end global.get $do/n i32.const -1 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -70,51 +85,66 @@ global.set $do/n i32.const 0 global.set $do/m - loop $continue|2 - global.get $do/n - i32.const 1 - i32.sub - global.set $do/n - global.get $do/m - i32.const 1 - i32.add - global.set $do/m - loop $continue|3 + block $break|2 + loop $continue|2 + block + global.get $do/n + i32.const 1 + i32.sub + global.set $do/n + global.get $do/m + i32.const 1 + i32.add + global.set $do/m + block $break|3 + loop $continue|3 + block + global.get $do/n + i32.const 1 + i32.sub + global.set $do/n + global.get $do/o + i32.const 1 + i32.add + global.set $do/o + end + global.get $do/n + br_if $continue|3 + end + end + global.get $do/n + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 24 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $do/o + i32.const 9 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 25 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + end global.get $do/n - i32.const 1 - i32.sub - global.set $do/n - global.get $do/o - i32.const 1 - i32.add - global.set $do/o - global.get $do/n - br_if $continue|3 + br_if $continue|2 end - global.get $do/n - if - i32.const 0 - i32.const 24 - i32.const 24 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - global.get $do/o - i32.const 9 - i32.ne - if - i32.const 0 - i32.const 24 - i32.const 25 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - global.get $do/n - br_if $continue|2 end global.get $do/n + i32.const 0 + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -125,7 +155,8 @@ end global.get $do/m i32.const 1 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -136,7 +167,8 @@ end global.get $do/o i32.const 9 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -150,6 +182,5 @@ call $start:do ) (func $null (; 3 ;) (type $FUNCSIG$v) - nop ) ) diff --git a/tests/compiler/do.untouched.wat b/tests/compiler/do.untouched.wat index 8aea2d55..71f240b0 100644 --- a/tests/compiler/do.untouched.wat +++ b/tests/compiler/do.untouched.wat @@ -3,7 +3,7 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00d\00o\00.\00t\00s\00") + (data (i32.const 8) "\n\00\00\00\01\00\00\00\10\00\00\00\n\00\00\00d\00o\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $do/n (mut i32) (i32.const 10)) diff --git a/tests/compiler/empty.json b/tests/compiler/empty.json index 453cb077..8e2a32c1 100644 --- a/tests/compiler/empty.json +++ b/tests/compiler/empty.json @@ -1,5 +1,5 @@ { "asc_flags": [ - "--runtime none" + "--runtime half" ] } diff --git a/tests/compiler/empty.optimized.wat b/tests/compiler/empty.optimized.wat index bb456a11..d1ce3b55 100644 --- a/tests/compiler/empty.optimized.wat +++ b/tests/compiler/empty.optimized.wat @@ -1,8 +1,3552 @@ (module + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$v (func)) - (memory $0 0) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (memory $0 1) + (data (i32.const 8) "\n\00\00\00\01\00\00\00\10\00\00\00\n\00\00\00a\00,\00b\00,\00c\00") + (data (i32.const 40) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00,\00") + (data (i32.const 64) "\1c\00\00\00\01\00\00\00\10\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 160) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 216) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 272) "\00\00\00\00\01\00\00\00\10\00\00\00\00\00\00\00") + (data (i32.const 288) "\08\00\00\00\01\00\00\00\10\00\00\00\08\00\00\00n\00u\00l\00l\00") + (data (i32.const 312) "\1c\00\00\00\01\00\00\00\10\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 360) "\1a\00\00\00\01\00\00\00\10\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 408) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 464) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 520) "^\00\00\00\01\00\00\00\10\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00") + (data (i32.const 632) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00a\00") + (data (i32.const 656) "\10\00\00\00\01\00\00\00\10\00\00\00\10\00\00\00e\00m\00p\00t\00y\00.\00t\00s\00") + (data (i32.const 688) "\12\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00I\04\00\00\0e\00\00\00I\00\00\00\0e\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/started (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 688)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 840)) (export "memory" (memory $0)) - (func $null (; 0 ;) (type $FUNCSIG$v) + (export "main" (func $empty/main)) + (func $~lib/rt/tlsf/removeBlock (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 6 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 7 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/purerc/increment (; 14 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/memory/memory.copy (; 16 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/common/__allocArray (; 17 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 16 + local.get $2 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $0 + local.get $1 + i32.shl + local.set $5 + local.get $5 + i32.const 15 + call $~lib/rt/tlsf/__alloc + local.set $6 + local.get $4 + local.get $6 + call $~lib/rt/purerc/__retain + i32.store + local.get $4 + local.get $6 + i32.store offset=4 + local.get $4 + local.get $5 + i32.store offset=8 + local.get $4 + local.get $0 + i32.store offset=12 + local.get $3 + if + local.get $6 + local.get $3 + local.get $5 + call $~lib/memory/memory.copy + end + local.get $4 + ) + (func $~lib/string/String#get:length (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (; 19 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $2 + call $~lib/rt/purerc/__retain + drop + i32.const 0 + local.set $5 + local.get $0 + local.get $1 + i32.const 1 + i32.shl + i32.add + local.set $6 + local.get $2 + local.get $3 + i32.const 1 + i32.shl + i32.add + local.set $7 + block $break|0 + loop $continue|0 + local.get $4 + if (result i32) + local.get $6 + i32.load16_u + local.get $7 + i32.load16_u + i32.sub + local.tee $5 + i32.eqz + else + i32.const 0 + end + if + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $6 + i32.const 2 + i32.add + local.set $6 + local.get $7 + i32.const 2 + i32.add + local.set $7 + br $continue|0 + end + end + end + local.get $0 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $5 + ) + (func $~lib/string/String#indexOf (; 20 ;) (type $FUNCSIG$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) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 140 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 0 + i32.eq + if + i32.const 304 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + end + local.get $1 + call $~lib/string/String#get:length + local.set $3 + local.get $3 + i32.eqz + if + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $0 + call $~lib/string/String#get:length + local.set $4 + local.get $4 + i32.eqz + if + local.get $1 + call $~lib/rt/purerc/__release + i32.const -1 + return + end + local.get $2 + local.tee $5 + i32.const 0 + local.tee $6 + local.get $5 + local.get $6 + i32.gt_s + select + local.tee $5 + local.get $4 + local.tee $6 + local.get $5 + local.get $6 + i32.lt_s + select + local.set $7 + local.get $4 + local.get $3 + i32.sub + local.set $4 + block $break|0 + local.get $7 + local.set $5 + loop $repeat|0 + local.get $5 + local.get $4 + i32.le_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $5 + local.get $1 + i32.const 0 + local.get $3 + call $~lib/util/string/compareImpl + i32.eqz + if + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 + return + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/rt/purerc/__release + i32.const -1 + ) + (func $~lib/rt/tlsf/reallocateBlock (; 21 ;) (type $FUNCSIG$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) + (local $8 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $1 + i32.load + local.set $4 + local.get $4 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 491 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const -4 + i32.and + i32.le_u + if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + block $~lib/rt/tlsf/GETRIGHT|inlined.4 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $6 + local.get $6 + i32.load + local.set $7 + local.get $7 + i32.const 1 + i32.and + if + local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $7 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $5 + local.get $5 + local.get $3 + i32.ge_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return + end + end + local.get $0 + local.get $2 + call $~lib/rt/tlsf/allocateBlock + local.set $8 + local.get $8 + local.get $1 + i32.load offset=4 + i32.store offset=4 + local.get $8 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $8 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + local.get $8 + ) + (func $~lib/rt/tlsf/__realloc (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 552 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 553 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 23 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $continue|0 + end + end + end + end + ) + (func $~lib/array/ensureSize (; 24 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load offset=8 + local.set $3 + local.get $1 + local.get $3 + local.get $2 + i32.shr_u + i32.gt_u + if + local.get $1 + i32.const 1073741808 + local.get $2 + i32.shr_u + i32.gt_u + if + i32.const 328 + i32.const 376 + i32.const 14 + i32.const 47 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load + local.set $4 + local.get $1 + local.get $2 + i32.shl + local.set $5 + local.get $4 + local.get $5 + call $~lib/rt/tlsf/__realloc + local.set $6 + local.get $6 + local.get $3 + i32.add + i32.const 0 + local.get $5 + local.get $3 + i32.sub + call $~lib/memory/memory.fill + local.get $6 + local.get $4 + i32.ne + if + local.get $0 + local.get $6 + call $~lib/rt/purerc/__retain + i32.store + local.get $0 + local.get $6 + i32.store offset=4 + end + local.get $0 + local.get $5 + i32.store offset=8 + end + ) + (func $~lib/rt/tlsf/freeBlock (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 424 + i32.const 480 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/purerc/growRoots (; 27 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__retainRelease (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.ne + if + global.get $~lib/builtins/HEAP_BASE + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + local.get $2 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + end + local.get $0 + ) + (func $~lib/array/Array<~lib/string/String>#push (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.add + local.set $3 + local.get $0 + local.get $3 + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.get $2 + i32.const 2 + i32.shl + i32.add + local.set $4 + local.get $4 + local.get $1 + local.get $4 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $0 + local.get $3 + i32.store offset=12 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + ) + (func $~lib/string/String#split (; 32 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 357 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.eqz + if + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $1 + i32.const 0 + i32.eq + if + block (result i32) + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $3 + local.get $3 + i32.load offset=4 + local.set $4 + local.get $4 + local.get $0 + call $~lib/rt/purerc/__retain + i32.store + local.get $3 + end + call $~lib/rt/purerc/__retain + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + return + end + local.get $0 + call $~lib/string/String#get:length + local.set $5 + local.get $1 + call $~lib/string/String#get:length + local.set $6 + local.get $2 + i32.const 0 + i32.lt_s + if + global.get $~lib/builtins/i32.MAX_VALUE + local.set $2 + end + local.get $6 + i32.eqz + if + local.get $5 + i32.eqz + if + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + return + end + local.get $5 + local.tee $4 + local.get $2 + local.tee $3 + local.get $4 + local.get $3 + i32.lt_s + select + local.set $5 + local.get $5 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $4 + local.get $4 + i32.load offset=4 + local.set $3 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + i32.const 2 + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $8 + local.get $8 + local.get $0 + local.get $7 + i32.const 1 + i32.shl + i32.add + i32.load16_u + i32.store16 + local.get $3 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $8 + call $~lib/rt/purerc/__retain + drop + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + local.get $4 + call $~lib/rt/purerc/__retain + local.set $8 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + return + else + local.get $5 + i32.eqz + if + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $3 + local.get $3 + i32.load offset=4 + i32.const 288 + i32.store + local.get $3 + call $~lib/rt/purerc/__retain + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + return + end + end + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $9 + i32.const 0 + local.set $10 + i32.const 0 + local.set $11 + i32.const 0 + local.set $12 + block $break|1 + loop $continue|1 + local.get $0 + local.get $1 + local.get $11 + call $~lib/string/String#indexOf + local.tee $10 + i32.const -1 + i32.ne + if + local.get $10 + local.get $11 + i32.sub + local.set $3 + local.get $3 + i32.const 0 + i32.gt_s + if + local.get $3 + i32.const 1 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $4 + local.get $0 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $3 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $4 + call $~lib/array/Array<~lib/string/String>#push + drop + else + local.get $9 + i32.const 288 + call $~lib/array/Array<~lib/string/String>#push + drop + end + local.get $12 + i32.const 1 + i32.add + local.tee $12 + local.get $2 + i32.eq + if + local.get $9 + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + return + end + local.get $10 + local.get $6 + i32.add + local.set $11 + br $continue|1 + end + end + end + local.get $11 + i32.eqz + if + local.get $9 + local.get $0 + call $~lib/array/Array<~lib/string/String>#push + drop + local.get $9 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $5 + local.get $11 + i32.sub + local.set $13 + local.get $13 + i32.const 0 + i32.gt_s + if + local.get $13 + i32.const 1 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $3 + local.get $3 + local.get $0 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $13 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $3 + call $~lib/array/Array<~lib/string/String>#push + drop + else + local.get $9 + i32.const 288 + call $~lib/array/Array<~lib/string/String>#push + drop + end + local.get $9 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + ) + (func $~lib/array/Array<~lib/string/String>#get:length (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + ) + (func $~lib/array/Array<~lib/string/String>#__get (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 536 + i32.const 376 + i32.const 97 + i32.const 45 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 424 + i32.const 376 + i32.const 100 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__unchecked_get + ) + (func $~lib/string/String.__eq (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + i32.eq + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 1 + return + end + local.get $0 + i32.const 0 + i32.eq + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $0 + call $~lib/string/String#get:length + local.set $2 + local.get $2 + local.get $1 + call $~lib/string/String#get:length + i32.ne + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 + i32.const 0 + local.get $1 + i32.const 0 + local.get $2 + call $~lib/util/string/compareImpl + i32.eqz + ) + (func $start:empty (; 37 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 24 + i32.const 56 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + local.set $0 + local.get $0 + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 3 + i32.eq + if (result i32) + local.get $0 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $1 + i32.const 648 + call $~lib/string/String.__eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 672 + i32.const 5 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $empty/main (; 38 ;) (type $FUNCSIG$v) + global.get $~lib/started + i32.eqz + if + call $start + i32.const 1 + global.set $~lib/started + end + ) + (func $start (; 39 ;) (type $FUNCSIG$v) + call $start:empty + ) + (func $~lib/rt/purerc/__release (; 40 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/purerc/markGray (; 41 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 42 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 43 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 44 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 45 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 46 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/array/Array#__visit_impl (; 47 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) + (func $~lib/builtins/__visit_members (; 48 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $block$16$break + block + end + block $switch$1$leave + block $switch$1$case$20 + block $switch$1$case$19 + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$19 $switch$1$case$20 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + br $block$16$break + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + end + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + ) + (func $null (; 49 ;) (type $FUNCSIG$v) + ) ) diff --git a/tests/compiler/empty.untouched.wat b/tests/compiler/empty.untouched.wat index 29ee81b8..d1ce3b55 100644 --- a/tests/compiler/empty.untouched.wat +++ b/tests/compiler/empty.untouched.wat @@ -1,9 +1,3552 @@ (module + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$v (func)) - (memory $0 0) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (memory $0 1) + (data (i32.const 8) "\n\00\00\00\01\00\00\00\10\00\00\00\n\00\00\00a\00,\00b\00,\00c\00") + (data (i32.const 40) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00,\00") + (data (i32.const 64) "\1c\00\00\00\01\00\00\00\10\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 160) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 216) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 272) "\00\00\00\00\01\00\00\00\10\00\00\00\00\00\00\00") + (data (i32.const 288) "\08\00\00\00\01\00\00\00\10\00\00\00\08\00\00\00n\00u\00l\00l\00") + (data (i32.const 312) "\1c\00\00\00\01\00\00\00\10\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 360) "\1a\00\00\00\01\00\00\00\10\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 408) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 464) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 520) "^\00\00\00\01\00\00\00\10\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00") + (data (i32.const 632) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00a\00") + (data (i32.const 656) "\10\00\00\00\01\00\00\00\10\00\00\00\10\00\00\00e\00m\00p\00t\00y\00.\00t\00s\00") + (data (i32.const 688) "\12\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00I\04\00\00\0e\00\00\00I\00\00\00\0e\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/started (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 688)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 840)) (export "memory" (memory $0)) - (func $null (; 0 ;) (type $FUNCSIG$v) + (export "main" (func $empty/main)) + (func $~lib/rt/tlsf/removeBlock (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 6 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 7 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/purerc/increment (; 14 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/memory/memory.copy (; 16 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/common/__allocArray (; 17 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 16 + local.get $2 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $0 + local.get $1 + i32.shl + local.set $5 + local.get $5 + i32.const 15 + call $~lib/rt/tlsf/__alloc + local.set $6 + local.get $4 + local.get $6 + call $~lib/rt/purerc/__retain + i32.store + local.get $4 + local.get $6 + i32.store offset=4 + local.get $4 + local.get $5 + i32.store offset=8 + local.get $4 + local.get $0 + i32.store offset=12 + local.get $3 + if + local.get $6 + local.get $3 + local.get $5 + call $~lib/memory/memory.copy + end + local.get $4 + ) + (func $~lib/string/String#get:length (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (; 19 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $2 + call $~lib/rt/purerc/__retain + drop + i32.const 0 + local.set $5 + local.get $0 + local.get $1 + i32.const 1 + i32.shl + i32.add + local.set $6 + local.get $2 + local.get $3 + i32.const 1 + i32.shl + i32.add + local.set $7 + block $break|0 + loop $continue|0 + local.get $4 + if (result i32) + local.get $6 + i32.load16_u + local.get $7 + i32.load16_u + i32.sub + local.tee $5 + i32.eqz + else + i32.const 0 + end + if + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $6 + i32.const 2 + i32.add + local.set $6 + local.get $7 + i32.const 2 + i32.add + local.set $7 + br $continue|0 + end + end + end + local.get $0 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $5 + ) + (func $~lib/string/String#indexOf (; 20 ;) (type $FUNCSIG$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) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 140 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 0 + i32.eq + if + i32.const 304 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + end + local.get $1 + call $~lib/string/String#get:length + local.set $3 + local.get $3 + i32.eqz + if + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $0 + call $~lib/string/String#get:length + local.set $4 + local.get $4 + i32.eqz + if + local.get $1 + call $~lib/rt/purerc/__release + i32.const -1 + return + end + local.get $2 + local.tee $5 + i32.const 0 + local.tee $6 + local.get $5 + local.get $6 + i32.gt_s + select + local.tee $5 + local.get $4 + local.tee $6 + local.get $5 + local.get $6 + i32.lt_s + select + local.set $7 + local.get $4 + local.get $3 + i32.sub + local.set $4 + block $break|0 + local.get $7 + local.set $5 + loop $repeat|0 + local.get $5 + local.get $4 + i32.le_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $5 + local.get $1 + i32.const 0 + local.get $3 + call $~lib/util/string/compareImpl + i32.eqz + if + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 + return + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/rt/purerc/__release + i32.const -1 + ) + (func $~lib/rt/tlsf/reallocateBlock (; 21 ;) (type $FUNCSIG$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) + (local $8 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $1 + i32.load + local.set $4 + local.get $4 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 491 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const -4 + i32.and + i32.le_u + if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + block $~lib/rt/tlsf/GETRIGHT|inlined.4 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $6 + local.get $6 + i32.load + local.set $7 + local.get $7 + i32.const 1 + i32.and + if + local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $7 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $5 + local.get $5 + local.get $3 + i32.ge_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return + end + end + local.get $0 + local.get $2 + call $~lib/rt/tlsf/allocateBlock + local.set $8 + local.get $8 + local.get $1 + i32.load offset=4 + i32.store offset=4 + local.get $8 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $8 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + local.get $8 + ) + (func $~lib/rt/tlsf/__realloc (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 552 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 553 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 23 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $continue|0 + end + end + end + end + ) + (func $~lib/array/ensureSize (; 24 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load offset=8 + local.set $3 + local.get $1 + local.get $3 + local.get $2 + i32.shr_u + i32.gt_u + if + local.get $1 + i32.const 1073741808 + local.get $2 + i32.shr_u + i32.gt_u + if + i32.const 328 + i32.const 376 + i32.const 14 + i32.const 47 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load + local.set $4 + local.get $1 + local.get $2 + i32.shl + local.set $5 + local.get $4 + local.get $5 + call $~lib/rt/tlsf/__realloc + local.set $6 + local.get $6 + local.get $3 + i32.add + i32.const 0 + local.get $5 + local.get $3 + i32.sub + call $~lib/memory/memory.fill + local.get $6 + local.get $4 + i32.ne + if + local.get $0 + local.get $6 + call $~lib/rt/purerc/__retain + i32.store + local.get $0 + local.get $6 + i32.store offset=4 + end + local.get $0 + local.get $5 + i32.store offset=8 + end + ) + (func $~lib/rt/tlsf/freeBlock (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 424 + i32.const 480 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/purerc/growRoots (; 27 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__retainRelease (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.ne + if + global.get $~lib/builtins/HEAP_BASE + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + local.get $2 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + end + local.get $0 + ) + (func $~lib/array/Array<~lib/string/String>#push (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.add + local.set $3 + local.get $0 + local.get $3 + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.get $2 + i32.const 2 + i32.shl + i32.add + local.set $4 + local.get $4 + local.get $1 + local.get $4 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $0 + local.get $3 + i32.store offset=12 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + ) + (func $~lib/string/String#split (; 32 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 357 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.eqz + if + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $1 + i32.const 0 + i32.eq + if + block (result i32) + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $3 + local.get $3 + i32.load offset=4 + local.set $4 + local.get $4 + local.get $0 + call $~lib/rt/purerc/__retain + i32.store + local.get $3 + end + call $~lib/rt/purerc/__retain + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + return + end + local.get $0 + call $~lib/string/String#get:length + local.set $5 + local.get $1 + call $~lib/string/String#get:length + local.set $6 + local.get $2 + i32.const 0 + i32.lt_s + if + global.get $~lib/builtins/i32.MAX_VALUE + local.set $2 + end + local.get $6 + i32.eqz + if + local.get $5 + i32.eqz + if + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + return + end + local.get $5 + local.tee $4 + local.get $2 + local.tee $3 + local.get $4 + local.get $3 + i32.lt_s + select + local.set $5 + local.get $5 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $4 + local.get $4 + i32.load offset=4 + local.set $3 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + i32.const 2 + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $8 + local.get $8 + local.get $0 + local.get $7 + i32.const 1 + i32.shl + i32.add + i32.load16_u + i32.store16 + local.get $3 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $8 + call $~lib/rt/purerc/__retain + drop + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + local.get $4 + call $~lib/rt/purerc/__retain + local.set $8 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + return + else + local.get $5 + i32.eqz + if + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $3 + local.get $3 + i32.load offset=4 + i32.const 288 + i32.store + local.get $3 + call $~lib/rt/purerc/__retain + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + return + end + end + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $9 + i32.const 0 + local.set $10 + i32.const 0 + local.set $11 + i32.const 0 + local.set $12 + block $break|1 + loop $continue|1 + local.get $0 + local.get $1 + local.get $11 + call $~lib/string/String#indexOf + local.tee $10 + i32.const -1 + i32.ne + if + local.get $10 + local.get $11 + i32.sub + local.set $3 + local.get $3 + i32.const 0 + i32.gt_s + if + local.get $3 + i32.const 1 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $4 + local.get $0 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $3 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $4 + call $~lib/array/Array<~lib/string/String>#push + drop + else + local.get $9 + i32.const 288 + call $~lib/array/Array<~lib/string/String>#push + drop + end + local.get $12 + i32.const 1 + i32.add + local.tee $12 + local.get $2 + i32.eq + if + local.get $9 + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + return + end + local.get $10 + local.get $6 + i32.add + local.set $11 + br $continue|1 + end + end + end + local.get $11 + i32.eqz + if + local.get $9 + local.get $0 + call $~lib/array/Array<~lib/string/String>#push + drop + local.get $9 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $5 + local.get $11 + i32.sub + local.set $13 + local.get $13 + i32.const 0 + i32.gt_s + if + local.get $13 + i32.const 1 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $3 + local.get $3 + local.get $0 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $13 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $3 + call $~lib/array/Array<~lib/string/String>#push + drop + else + local.get $9 + i32.const 288 + call $~lib/array/Array<~lib/string/String>#push + drop + end + local.get $9 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + ) + (func $~lib/array/Array<~lib/string/String>#get:length (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + ) + (func $~lib/array/Array<~lib/string/String>#__get (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 536 + i32.const 376 + i32.const 97 + i32.const 45 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 424 + i32.const 376 + i32.const 100 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__unchecked_get + ) + (func $~lib/string/String.__eq (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + i32.eq + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 1 + return + end + local.get $0 + i32.const 0 + i32.eq + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $0 + call $~lib/string/String#get:length + local.set $2 + local.get $2 + local.get $1 + call $~lib/string/String#get:length + i32.ne + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 + i32.const 0 + local.get $1 + i32.const 0 + local.get $2 + call $~lib/util/string/compareImpl + i32.eqz + ) + (func $start:empty (; 37 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 24 + i32.const 56 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + local.set $0 + local.get $0 + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 3 + i32.eq + if (result i32) + local.get $0 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $1 + i32.const 648 + call $~lib/string/String.__eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 672 + i32.const 5 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $empty/main (; 38 ;) (type $FUNCSIG$v) + global.get $~lib/started + i32.eqz + if + call $start + i32.const 1 + global.set $~lib/started + end + ) + (func $start (; 39 ;) (type $FUNCSIG$v) + call $start:empty + ) + (func $~lib/rt/purerc/__release (; 40 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/purerc/markGray (; 41 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 42 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 43 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 44 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 45 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 46 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/array/Array#__visit_impl (; 47 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/builtins/__visit_members (; 48 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $block$16$break + block + end + block $switch$1$leave + block $switch$1$case$20 + block $switch$1$case$19 + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$19 $switch$1$case$20 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + br $block$16$break + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + end + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + ) + (func $null (; 49 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/rc/global-init.json b/tests/compiler/rc/global-init.json new file mode 100644 index 00000000..9f7878d4 --- /dev/null +++ b/tests/compiler/rc/global-init.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/rc/global-init.optimized.wat b/tests/compiler/rc/global-init.optimized.wat new file mode 100644 index 00000000..b6d82717 --- /dev/null +++ b/tests/compiler/rc/global-init.optimized.wat @@ -0,0 +1,2245 @@ +(module + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (memory $0 1) + (data (i32.const 8) "\00\00\00\00\01\00\00\00\10\00\00\00\00\00\00\00") + (data (i32.const 24) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 80) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 128) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 184) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 240) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 296) "\10\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $rc/global-init/a (mut i32) (i32.const 0)) + (global $rc/global-init/b (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 296)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 432)) + (export "memory" (memory $0)) + (start $start) + (func $rc/global-init/getRef (; 4 ;) (type $FUNCSIG$i) (result i32) + i32.const 24 + call $~lib/rt/purerc/__retain + ) + (func $start:rc/global-init (; 5 ;) (type $FUNCSIG$v) + call $rc/global-init/getRef + global.set $rc/global-init/a + call $rc/global-init/getRef + global.set $rc/global-init/b + i32.const 0 + global.get $rc/global-init/a + call $~lib/rt/purerc/__retainRelease + global.set $rc/global-init/a + i32.const 0 + global.get $rc/global-init/b + call $~lib/rt/purerc/__retainRelease + global.set $rc/global-init/b + ) + (func $start (; 6 ;) (type $FUNCSIG$v) + call $start:rc/global-init + ) + (func $~lib/rt/purerc/increment (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/removeBlock (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/freeBlock (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 144 + i32.const 200 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/tlsf/addMemory (; 13 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 14 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 256 + i32.const 96 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.copy (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 22 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__retainRelease (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.ne + if + global.get $~lib/builtins/HEAP_BASE + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + local.get $2 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + end + local.get $0 + ) + (func $~lib/rt/purerc/markGray (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/builtins/__visit_members (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 32 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/global-init.ts b/tests/compiler/rc/global-init.ts new file mode 100644 index 00000000..54d54022 --- /dev/null +++ b/tests/compiler/rc/global-init.ts @@ -0,0 +1,14 @@ +function getRef(): string { + return ""; +} + +// Assignment of a return value picks up its delayed release state and skips +// one set of retain/release. + +var a: string = getRef(); +var b = getRef(); // same, but inferred + +// Unleak + +a = /* __retainRelease( */ changetype(0) /* , a) */; +b = /* __retainRelease( */ changetype(0) /* , a) */; diff --git a/tests/compiler/rc/global-init.untouched.wat b/tests/compiler/rc/global-init.untouched.wat new file mode 100644 index 00000000..b6d82717 --- /dev/null +++ b/tests/compiler/rc/global-init.untouched.wat @@ -0,0 +1,2245 @@ +(module + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (memory $0 1) + (data (i32.const 8) "\00\00\00\00\01\00\00\00\10\00\00\00\00\00\00\00") + (data (i32.const 24) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 80) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 128) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 184) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 240) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 296) "\10\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $rc/global-init/a (mut i32) (i32.const 0)) + (global $rc/global-init/b (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 296)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 432)) + (export "memory" (memory $0)) + (start $start) + (func $rc/global-init/getRef (; 4 ;) (type $FUNCSIG$i) (result i32) + i32.const 24 + call $~lib/rt/purerc/__retain + ) + (func $start:rc/global-init (; 5 ;) (type $FUNCSIG$v) + call $rc/global-init/getRef + global.set $rc/global-init/a + call $rc/global-init/getRef + global.set $rc/global-init/b + i32.const 0 + global.get $rc/global-init/a + call $~lib/rt/purerc/__retainRelease + global.set $rc/global-init/a + i32.const 0 + global.get $rc/global-init/b + call $~lib/rt/purerc/__retainRelease + global.set $rc/global-init/b + ) + (func $start (; 6 ;) (type $FUNCSIG$v) + call $start:rc/global-init + ) + (func $~lib/rt/purerc/increment (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/removeBlock (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/freeBlock (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 144 + i32.const 200 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/tlsf/addMemory (; 13 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 14 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 256 + i32.const 96 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 96 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.copy (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 22 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__retainRelease (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.ne + if + global.get $~lib/builtins/HEAP_BASE + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + local.get $2 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + end + local.get $0 + ) + (func $~lib/rt/purerc/markGray (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/builtins/__visit_members (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 32 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/local-init.json b/tests/compiler/rc/local-init.json new file mode 100644 index 00000000..9f7878d4 --- /dev/null +++ b/tests/compiler/rc/local-init.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/rc/local-init.optimized.wat b/tests/compiler/rc/local-init.optimized.wat new file mode 100644 index 00000000..14fe8e42 --- /dev/null +++ b/tests/compiler/rc/local-init.optimized.wat @@ -0,0 +1,2246 @@ +(module + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (memory $0 1) + (data (i32.const 8) "\00\00\00\00\01\00\00\00\10\00\00\00\00\00\00\00") + (data (i32.const 24) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 72) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 128) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 184) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 240) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 296) "\11\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 296)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 440)) + (export "memory" (memory $0)) + (start $start) + (func $rc/local-init/getRef (; 4 ;) (type $FUNCSIG$i) (result i32) + i32.const 24 + call $~lib/rt/purerc/__retain + ) + (func $rc/local-init/Ref#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + ) + (func $start:rc/local-init (; 6 ;) (type $FUNCSIG$v) + (local $0 i32) + block + i32.const 24 + call $~lib/rt/purerc/__retain + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + call $rc/local-init/getRef + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + i32.const 0 + call $rc/local-init/Ref#constructor + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + ) + (func $start (; 7 ;) (type $FUNCSIG$v) + call $start:rc/local-init + ) + (func $~lib/rt/tlsf/removeBlock (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 10 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 11 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 88 + i32.const 40 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/purerc/increment (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 20 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 200 + i32.const 256 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__release (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/purerc/markGray (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/builtins/__visit_members (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 33 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/local-init.ts b/tests/compiler/rc/local-init.ts new file mode 100644 index 00000000..d15be658 --- /dev/null +++ b/tests/compiler/rc/local-init.ts @@ -0,0 +1,26 @@ +{ + // Normal assignment will retain and release. + + let a = /* __retain( */ "" /* ) */; + // __release(a) +} + +function getRef(): string { + return /* __retain( */ "" /* ) */; +} + +{ + // Assignment of a return value picks up its skipped autorelease + + let b = getRef(); + // __release(b); +} + +class Ref {} + +{ + // Assignment of an instantiation picks up its skipped autorelease + + let c = new Ref(); + // __release(c); +} diff --git a/tests/compiler/rc/local-init.untouched.wat b/tests/compiler/rc/local-init.untouched.wat new file mode 100644 index 00000000..14fe8e42 --- /dev/null +++ b/tests/compiler/rc/local-init.untouched.wat @@ -0,0 +1,2246 @@ +(module + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (memory $0 1) + (data (i32.const 8) "\00\00\00\00\01\00\00\00\10\00\00\00\00\00\00\00") + (data (i32.const 24) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 72) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 128) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 184) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 240) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 296) "\11\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 296)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 440)) + (export "memory" (memory $0)) + (start $start) + (func $rc/local-init/getRef (; 4 ;) (type $FUNCSIG$i) (result i32) + i32.const 24 + call $~lib/rt/purerc/__retain + ) + (func $rc/local-init/Ref#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + ) + (func $start:rc/local-init (; 6 ;) (type $FUNCSIG$v) + (local $0 i32) + block + i32.const 24 + call $~lib/rt/purerc/__retain + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + call $rc/local-init/getRef + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + i32.const 0 + call $rc/local-init/Ref#constructor + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + ) + (func $start (; 7 ;) (type $FUNCSIG$v) + call $start:rc/local-init + ) + (func $~lib/rt/tlsf/removeBlock (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 10 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 11 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 88 + i32.const 40 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/purerc/increment (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 20 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 200 + i32.const 256 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__release (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/purerc/markGray (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/builtins/__visit_members (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 33 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/logical-and-mismatch.json b/tests/compiler/rc/logical-and-mismatch.json new file mode 100644 index 00000000..9f7878d4 --- /dev/null +++ b/tests/compiler/rc/logical-and-mismatch.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/rc/logical-and-mismatch.optimized.wat b/tests/compiler/rc/logical-and-mismatch.optimized.wat new file mode 100644 index 00000000..a64a115c --- /dev/null +++ b/tests/compiler/rc/logical-and-mismatch.optimized.wat @@ -0,0 +1,2291 @@ +(module + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (memory $0 1) + (data (i32.const 8) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 64) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 112) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 168) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 224) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 280) "\11\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $rc/logical-and-mismatch/gloRef (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 280)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 424)) + (export "memory" (memory $0)) + (start $start) + (func $rc/logical-and-mismatch/Ref#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + ) + (func $rc/logical-and-mismatch/getRef (; 5 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $rc/logical-and-mismatch/Ref#constructor + ) + (func $~lib/rt/tlsf/removeBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/freeBlock (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 128 + i32.const 184 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/tlsf/addMemory (; 10 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 11 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 240 + i32.const 80 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.copy (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 19 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__release (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $start:rc/logical-and-mismatch (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + call $rc/logical-and-mismatch/Ref#constructor + global.set $rc/logical-and-mismatch/gloRef + block + call $rc/logical-and-mismatch/getRef + local.tee $0 + if (result i32) + global.get $rc/logical-and-mismatch/gloRef + call $~lib/rt/purerc/__retain + local.set $1 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + else + local.get $0 + end + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + global.get $rc/logical-and-mismatch/gloRef + local.tee $0 + if (result i32) + call $rc/logical-and-mismatch/getRef + else + local.get $0 + call $~lib/rt/purerc/__retain + end + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + call $rc/logical-and-mismatch/getRef + local.tee $0 + if (result i32) + call $rc/logical-and-mismatch/getRef + local.set $1 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + else + local.get $0 + end + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + global.get $rc/logical-and-mismatch/gloRef + local.tee $0 + if (result i32) + global.get $rc/logical-and-mismatch/gloRef + else + local.get $0 + end + call $~lib/rt/purerc/__retain + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + global.get $rc/logical-and-mismatch/gloRef + call $~lib/rt/purerc/__release + ) + (func $start (; 24 ;) (type $FUNCSIG$v) + call $start:rc/logical-and-mismatch + ) + (func $~lib/rt/purerc/increment (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/purerc/markGray (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/builtins/__visit_members (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 33 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/logical-and-mismatch.ts b/tests/compiler/rc/logical-and-mismatch.ts new file mode 100644 index 00000000..966c8b7c --- /dev/null +++ b/tests/compiler/rc/logical-and-mismatch.ts @@ -0,0 +1,29 @@ +class Ref {} + +function getRef(): Ref { + return new Ref(); +} + +var gloRef = new Ref(); + +{ + // Left skips autorelease, right doesn't + let a = /* t = */ getRef() && /* __release(t), */ gloRef; + // __release(a) +} +{ + // Right skips autorelease, left doesn't + let b = gloRef && getRef(); +} +{ + // Both skip autorelease, for completeness + let c = getRef() && getRef(); +} +{ + // Both don't + let d = gloRef && gloRef; +} + +// Unleak + +__release(changetype(gloRef)); diff --git a/tests/compiler/rc/logical-and-mismatch.untouched.wat b/tests/compiler/rc/logical-and-mismatch.untouched.wat new file mode 100644 index 00000000..a64a115c --- /dev/null +++ b/tests/compiler/rc/logical-and-mismatch.untouched.wat @@ -0,0 +1,2291 @@ +(module + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (memory $0 1) + (data (i32.const 8) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 64) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 112) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 168) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 224) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 280) "\11\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $rc/logical-and-mismatch/gloRef (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 280)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 424)) + (export "memory" (memory $0)) + (start $start) + (func $rc/logical-and-mismatch/Ref#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + ) + (func $rc/logical-and-mismatch/getRef (; 5 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $rc/logical-and-mismatch/Ref#constructor + ) + (func $~lib/rt/tlsf/removeBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/freeBlock (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 128 + i32.const 184 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/tlsf/addMemory (; 10 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 11 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 240 + i32.const 80 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.copy (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 19 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__release (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $start:rc/logical-and-mismatch (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + call $rc/logical-and-mismatch/Ref#constructor + global.set $rc/logical-and-mismatch/gloRef + block + call $rc/logical-and-mismatch/getRef + local.tee $0 + if (result i32) + global.get $rc/logical-and-mismatch/gloRef + call $~lib/rt/purerc/__retain + local.set $1 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + else + local.get $0 + end + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + global.get $rc/logical-and-mismatch/gloRef + local.tee $0 + if (result i32) + call $rc/logical-and-mismatch/getRef + else + local.get $0 + call $~lib/rt/purerc/__retain + end + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + call $rc/logical-and-mismatch/getRef + local.tee $0 + if (result i32) + call $rc/logical-and-mismatch/getRef + local.set $1 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + else + local.get $0 + end + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + global.get $rc/logical-and-mismatch/gloRef + local.tee $0 + if (result i32) + global.get $rc/logical-and-mismatch/gloRef + else + local.get $0 + end + call $~lib/rt/purerc/__retain + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + global.get $rc/logical-and-mismatch/gloRef + call $~lib/rt/purerc/__release + ) + (func $start (; 24 ;) (type $FUNCSIG$v) + call $start:rc/logical-and-mismatch + ) + (func $~lib/rt/purerc/increment (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/purerc/markGray (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/builtins/__visit_members (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 33 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/logical-or-mismatch.json b/tests/compiler/rc/logical-or-mismatch.json new file mode 100644 index 00000000..9f7878d4 --- /dev/null +++ b/tests/compiler/rc/logical-or-mismatch.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/rc/logical-or-mismatch.optimized.wat b/tests/compiler/rc/logical-or-mismatch.optimized.wat new file mode 100644 index 00000000..785c5a2a --- /dev/null +++ b/tests/compiler/rc/logical-or-mismatch.optimized.wat @@ -0,0 +1,2291 @@ +(module + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (memory $0 1) + (data (i32.const 8) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 64) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 112) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 168) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 224) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 280) "\11\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $rc/logical-or-mismatch/gloRef (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 280)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 424)) + (export "memory" (memory $0)) + (start $start) + (func $rc/logical-or-mismatch/Ref#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + ) + (func $rc/logical-or-mismatch/getRef (; 5 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $rc/logical-or-mismatch/Ref#constructor + ) + (func $~lib/rt/tlsf/removeBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/freeBlock (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 128 + i32.const 184 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/tlsf/addMemory (; 10 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 11 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 240 + i32.const 80 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.copy (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 19 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__release (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $start:rc/logical-or-mismatch (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + call $rc/logical-or-mismatch/Ref#constructor + global.set $rc/logical-or-mismatch/gloRef + block + call $rc/logical-or-mismatch/getRef + local.tee $0 + if (result i32) + local.get $0 + else + global.get $rc/logical-or-mismatch/gloRef + call $~lib/rt/purerc/__retain + local.set $1 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + end + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + global.get $rc/logical-or-mismatch/gloRef + local.tee $0 + if (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + else + call $rc/logical-or-mismatch/getRef + end + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + call $rc/logical-or-mismatch/getRef + local.tee $0 + if (result i32) + local.get $0 + else + call $rc/logical-or-mismatch/getRef + local.set $1 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + end + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + global.get $rc/logical-or-mismatch/gloRef + local.tee $0 + if (result i32) + local.get $0 + else + global.get $rc/logical-or-mismatch/gloRef + end + call $~lib/rt/purerc/__retain + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + global.get $rc/logical-or-mismatch/gloRef + call $~lib/rt/purerc/__release + ) + (func $start (; 24 ;) (type $FUNCSIG$v) + call $start:rc/logical-or-mismatch + ) + (func $~lib/rt/purerc/increment (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/purerc/markGray (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/builtins/__visit_members (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 33 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/logical-or-mismatch.ts b/tests/compiler/rc/logical-or-mismatch.ts new file mode 100644 index 00000000..ef5ae700 --- /dev/null +++ b/tests/compiler/rc/logical-or-mismatch.ts @@ -0,0 +1,29 @@ +class Ref {} + +function getRef(): Ref { + return new Ref(); +} + +var gloRef = new Ref(); + +{ + // Left skips autorelease, right doesn't + let a = /* t = */ getRef() || /* __release(t), */ gloRef; + // __release(a) +} +{ + // Right skips autorelease, left doesn't + let b = gloRef || getRef(); +} +{ + // Both skip autorelease, for completeness + let c = getRef() || getRef(); +} +{ + // Both don't + let d = gloRef || gloRef; +} + +// Unleak + +__release(changetype(gloRef)); diff --git a/tests/compiler/rc/logical-or-mismatch.untouched.wat b/tests/compiler/rc/logical-or-mismatch.untouched.wat new file mode 100644 index 00000000..785c5a2a --- /dev/null +++ b/tests/compiler/rc/logical-or-mismatch.untouched.wat @@ -0,0 +1,2291 @@ +(module + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (memory $0 1) + (data (i32.const 8) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 64) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 112) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 168) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 224) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 280) "\11\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $rc/logical-or-mismatch/gloRef (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 280)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 424)) + (export "memory" (memory $0)) + (start $start) + (func $rc/logical-or-mismatch/Ref#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + ) + (func $rc/logical-or-mismatch/getRef (; 5 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $rc/logical-or-mismatch/Ref#constructor + ) + (func $~lib/rt/tlsf/removeBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/freeBlock (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 128 + i32.const 184 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/tlsf/addMemory (; 10 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 11 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 240 + i32.const 80 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.copy (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 19 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__release (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $start:rc/logical-or-mismatch (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + call $rc/logical-or-mismatch/Ref#constructor + global.set $rc/logical-or-mismatch/gloRef + block + call $rc/logical-or-mismatch/getRef + local.tee $0 + if (result i32) + local.get $0 + else + global.get $rc/logical-or-mismatch/gloRef + call $~lib/rt/purerc/__retain + local.set $1 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + end + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + global.get $rc/logical-or-mismatch/gloRef + local.tee $0 + if (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + else + call $rc/logical-or-mismatch/getRef + end + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + call $rc/logical-or-mismatch/getRef + local.tee $0 + if (result i32) + local.get $0 + else + call $rc/logical-or-mismatch/getRef + local.set $1 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + end + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + block + global.get $rc/logical-or-mismatch/gloRef + local.tee $0 + if (result i32) + local.get $0 + else + global.get $rc/logical-or-mismatch/gloRef + end + call $~lib/rt/purerc/__retain + local.set $0 + local.get $0 + call $~lib/rt/purerc/__release + end + global.get $rc/logical-or-mismatch/gloRef + call $~lib/rt/purerc/__release + ) + (func $start (; 24 ;) (type $FUNCSIG$v) + call $start:rc/logical-or-mismatch + ) + (func $~lib/rt/purerc/increment (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/purerc/markGray (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/builtins/__visit_members (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 33 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/rereturn.optimized.wat b/tests/compiler/rc/rereturn.optimized.wat new file mode 100644 index 00000000..64a47d9c --- /dev/null +++ b/tests/compiler/rc/rereturn.optimized.wat @@ -0,0 +1,2626 @@ +(module + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 112) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 168) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 224) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 280) "\11\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 280)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 424)) + (export "memory" (memory $0)) + (export "__alloc" (func $~lib/rt/tlsf/__alloc)) + (export "__realloc" (func $~lib/rt/tlsf/__realloc)) + (export "__free" (func $~lib/rt/tlsf/__free)) + (export "__retain" (func $~lib/rt/purerc/__retain)) + (export "__release" (func $~lib/rt/purerc/__release)) + (export "__collect" (func $~lib/rt/purerc/__collect)) + (export "__instanceof" (func $~lib/rt/common/__instanceof)) + (export "__typeinfo" (func $~lib/rt/common/__typeinfo)) + (start $start) + (func $rc/rereturn/Ref#constructor (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + ) + (func $rc/rereturn/getRef (; 2 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $rc/rereturn/Ref#constructor + ) + (func $rc/rereturn/rereturnRef (; 3 ;) (type $FUNCSIG$i) (result i32) + call $rc/rereturn/getRef + ) + (func $start:rc/rereturn (; 4 ;) (type $FUNCSIG$v) + call $rc/rereturn/rereturnRef + call $~lib/rt/purerc/__release + ) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.copy (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/reallocateBlock (; 16 ;) (type $FUNCSIG$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) + (local $8 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $1 + i32.load + local.set $4 + local.get $4 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 491 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const -4 + i32.and + i32.le_u + if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + block $~lib/rt/tlsf/GETRIGHT|inlined.4 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $6 + local.get $6 + i32.load + local.set $7 + local.get $7 + i32.const 1 + i32.and + if + local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $7 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $5 + local.get $5 + local.get $3 + i32.ge_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return + end + end + local.get $0 + local.get $2 + call $~lib/rt/tlsf/allocateBlock + local.set $8 + local.get $8 + local.get $1 + i32.load offset=4 + i32.store offset=4 + local.get $8 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $8 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $8 + ) + (func $~lib/rt/tlsf/__realloc (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 552 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 553 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/rt/tlsf/freeBlock (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/__free (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 560 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/increment (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/common/__typeinfo (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 184 + i32.const 240 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/purerc/growRoots (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__release (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/purerc/markGray (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__collect (; 31 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + local.get $0 + local.set $1 + block $break|0 + block + local.get $1 + local.set $2 + global.get $~lib/rt/purerc/CUR + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $2 + i32.load + local.set $4 + local.get $4 + i32.load offset=4 + local.set $5 + local.get $5 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/purerc/markGray + local.get $1 + local.get $4 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else + local.get $5 + i32.const 1879048192 + i32.and + i32.const 0 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $5 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + end + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + global.set $~lib/rt/purerc/CUR + block $break|1 + local.get $0 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $5 + i32.load + call $~lib/rt/purerc/scan + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + block $break|2 + local.get $0 + local.set $5 + loop $repeat|2 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $5 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + local.get $4 + call $~lib/rt/purerc/collectWhite + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/common/__instanceof (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=8 + local.set $2 + global.get $~lib/builtins/RTTI_BASE + local.set $3 + local.get $2 + if (result i32) + local.get $2 + local.get $3 + i32.load + i32.le_u + else + i32.const 0 + end + if + loop $continue|0 + local.get $2 + local.get $1 + i32.eq + if + i32.const 1 + return + end + local.get $3 + local.get $2 + i32.const 8 + i32.mul + i32.add + i32.load offset=4 + local.tee $2 + br_if $continue|0 + end + end + i32.const 0 + ) + (func $start (; 33 ;) (type $FUNCSIG$v) + call $start:rc/rereturn + ) + (func $~lib/rt/purerc/__visit (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/builtins/__visit_members (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 36 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/rereturn.ts b/tests/compiler/rc/rereturn.ts new file mode 100644 index 00000000..bbf060bb --- /dev/null +++ b/tests/compiler/rc/rereturn.ts @@ -0,0 +1,13 @@ +// Validates that skipped autorelease state is preserved accross calls and returns. + +class Ref {} + +function getRef(): Ref { + return new Ref(); +} + +function rereturnRef(): Ref { + return getRef(); +} + +/* __release( */ rereturnRef() /* ) */; diff --git a/tests/compiler/rc/rereturn.untouched.wat b/tests/compiler/rc/rereturn.untouched.wat new file mode 100644 index 00000000..64a47d9c --- /dev/null +++ b/tests/compiler/rc/rereturn.untouched.wat @@ -0,0 +1,2626 @@ +(module + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 112) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 168) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 224) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 280) "\11\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 280)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 424)) + (export "memory" (memory $0)) + (export "__alloc" (func $~lib/rt/tlsf/__alloc)) + (export "__realloc" (func $~lib/rt/tlsf/__realloc)) + (export "__free" (func $~lib/rt/tlsf/__free)) + (export "__retain" (func $~lib/rt/purerc/__retain)) + (export "__release" (func $~lib/rt/purerc/__release)) + (export "__collect" (func $~lib/rt/purerc/__collect)) + (export "__instanceof" (func $~lib/rt/common/__instanceof)) + (export "__typeinfo" (func $~lib/rt/common/__typeinfo)) + (start $start) + (func $rc/rereturn/Ref#constructor (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + ) + (func $rc/rereturn/getRef (; 2 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $rc/rereturn/Ref#constructor + ) + (func $rc/rereturn/rereturnRef (; 3 ;) (type $FUNCSIG$i) (result i32) + call $rc/rereturn/getRef + ) + (func $start:rc/rereturn (; 4 ;) (type $FUNCSIG$v) + call $rc/rereturn/rereturnRef + call $~lib/rt/purerc/__release + ) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.copy (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/reallocateBlock (; 16 ;) (type $FUNCSIG$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) + (local $8 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $1 + i32.load + local.set $4 + local.get $4 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 491 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const -4 + i32.and + i32.le_u + if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + block $~lib/rt/tlsf/GETRIGHT|inlined.4 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $6 + local.get $6 + i32.load + local.set $7 + local.get $7 + i32.const 1 + i32.and + if + local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $7 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $5 + local.get $5 + local.get $3 + i32.ge_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return + end + end + local.get $0 + local.get $2 + call $~lib/rt/tlsf/allocateBlock + local.set $8 + local.get $8 + local.get $1 + i32.load offset=4 + i32.store offset=4 + local.get $8 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $8 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $8 + ) + (func $~lib/rt/tlsf/__realloc (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 552 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 553 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/rt/tlsf/freeBlock (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/__free (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 560 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/increment (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/common/__typeinfo (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 184 + i32.const 240 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/purerc/growRoots (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__release (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/purerc/markGray (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__collect (; 31 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + local.get $0 + local.set $1 + block $break|0 + block + local.get $1 + local.set $2 + global.get $~lib/rt/purerc/CUR + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $2 + i32.load + local.set $4 + local.get $4 + i32.load offset=4 + local.set $5 + local.get $5 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/purerc/markGray + local.get $1 + local.get $4 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else + local.get $5 + i32.const 1879048192 + i32.and + i32.const 0 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $5 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + end + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + global.set $~lib/rt/purerc/CUR + block $break|1 + local.get $0 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $5 + i32.load + call $~lib/rt/purerc/scan + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + block $break|2 + local.get $0 + local.set $5 + loop $repeat|2 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $5 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + local.get $4 + call $~lib/rt/purerc/collectWhite + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/common/__instanceof (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=8 + local.set $2 + global.get $~lib/builtins/RTTI_BASE + local.set $3 + local.get $2 + if (result i32) + local.get $2 + local.get $3 + i32.load + i32.le_u + else + i32.const 0 + end + if + loop $continue|0 + local.get $2 + local.get $1 + i32.eq + if + i32.const 1 + return + end + local.get $3 + local.get $2 + i32.const 8 + i32.mul + i32.add + i32.load offset=4 + local.tee $2 + br_if $continue|0 + end + end + i32.const 0 + ) + (func $start (; 33 ;) (type $FUNCSIG$v) + call $start:rc/rereturn + ) + (func $~lib/rt/purerc/__visit (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/builtins/__visit_members (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 36 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/ternary-mismatch.json b/tests/compiler/rc/ternary-mismatch.json new file mode 100644 index 00000000..9f7878d4 --- /dev/null +++ b/tests/compiler/rc/ternary-mismatch.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/rc/ternary-mismatch.optimized.wat b/tests/compiler/rc/ternary-mismatch.optimized.wat new file mode 100644 index 00000000..cab17a7b --- /dev/null +++ b/tests/compiler/rc/ternary-mismatch.optimized.wat @@ -0,0 +1,2262 @@ +(module + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (memory $0 1) + (data (i32.const 8) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 64) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 112) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 168) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 224) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 280) "\11\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $rc/ternary-mismatch/gloRef (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 280)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 424)) + (export "memory" (memory $0)) + (export "test1" (func $rc/ternary-mismatch/test1)) + (export "test2" (func $rc/ternary-mismatch/test2)) + (start $start) + (func $rc/ternary-mismatch/Ref#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + ) + (func $rc/ternary-mismatch/getRef (; 5 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $rc/ternary-mismatch/Ref#constructor + ) + (func $rc/ternary-mismatch/test1 (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + if (result i32) + call $rc/ternary-mismatch/getRef + else + global.get $rc/ternary-mismatch/gloRef + call $~lib/rt/purerc/__retain + end + ) + (func $rc/ternary-mismatch/test2 (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + if (result i32) + global.get $rc/ternary-mismatch/gloRef + call $~lib/rt/purerc/__retain + else + call $rc/ternary-mismatch/getRef + end + ) + (func $~lib/rt/tlsf/removeBlock (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/freeBlock (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 128 + i32.const 184 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/tlsf/addMemory (; 12 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 13 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 240 + i32.const 80 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 17 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.copy (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 21 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__release (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $start:rc/ternary-mismatch (; 25 ;) (type $FUNCSIG$v) + i32.const 0 + call $rc/ternary-mismatch/Ref#constructor + global.set $rc/ternary-mismatch/gloRef + i32.const 1 + call $rc/ternary-mismatch/test1 + call $~lib/rt/purerc/__release + i32.const 0 + call $rc/ternary-mismatch/test1 + call $~lib/rt/purerc/__release + i32.const 1 + call $rc/ternary-mismatch/test2 + call $~lib/rt/purerc/__release + i32.const 0 + call $rc/ternary-mismatch/test2 + call $~lib/rt/purerc/__release + global.get $rc/ternary-mismatch/gloRef + call $~lib/rt/purerc/__release + ) + (func $start (; 26 ;) (type $FUNCSIG$v) + call $start:rc/ternary-mismatch + ) + (func $~lib/rt/purerc/increment (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/purerc/markGray (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/builtins/__visit_members (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 35 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/ternary-mismatch.ts b/tests/compiler/rc/ternary-mismatch.ts new file mode 100644 index 00000000..efc51fe1 --- /dev/null +++ b/tests/compiler/rc/ternary-mismatch.ts @@ -0,0 +1,30 @@ +// Validates that an autorelease mismatch in the arms of a ternary expression +// is correctly resolved by lifting the respective other. + +class Ref {} + +function getRef(): Ref { + return new Ref(); +} + +var gloRef = new Ref(); + +export function test1(b: bool): Ref | null { + // ifThen skips autorelease, ifElse doesn't + return b ? getRef() : /* __retain( */ gloRef /* ) */; +} + +/* __release( */ test1(true) /* ) */; +/* __release( */ test1(false) /* ) */; + +export function test2(b: bool): Ref | null { + // ifElse skips autorelease, ifThen doesn't + return b ? /* __retain( */ gloRef /* ) */ : getRef(); +} + +/* __release( */ test2(true) /* ) */; +/* __release( */ test2(false) /* ) */; + +// Unleak + +__release(changetype(gloRef)); diff --git a/tests/compiler/rc/ternary-mismatch.untouched.wat b/tests/compiler/rc/ternary-mismatch.untouched.wat new file mode 100644 index 00000000..cab17a7b --- /dev/null +++ b/tests/compiler/rc/ternary-mismatch.untouched.wat @@ -0,0 +1,2262 @@ +(module + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (memory $0 1) + (data (i32.const 8) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 64) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 112) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 168) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 224) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 280) "\11\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $rc/ternary-mismatch/gloRef (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 280)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 424)) + (export "memory" (memory $0)) + (export "test1" (func $rc/ternary-mismatch/test1)) + (export "test2" (func $rc/ternary-mismatch/test2)) + (start $start) + (func $rc/ternary-mismatch/Ref#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + ) + (func $rc/ternary-mismatch/getRef (; 5 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $rc/ternary-mismatch/Ref#constructor + ) + (func $rc/ternary-mismatch/test1 (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + if (result i32) + call $rc/ternary-mismatch/getRef + else + global.get $rc/ternary-mismatch/gloRef + call $~lib/rt/purerc/__retain + end + ) + (func $rc/ternary-mismatch/test2 (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + if (result i32) + global.get $rc/ternary-mismatch/gloRef + call $~lib/rt/purerc/__retain + else + call $rc/ternary-mismatch/getRef + end + ) + (func $~lib/rt/tlsf/removeBlock (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/freeBlock (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 128 + i32.const 184 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/tlsf/addMemory (; 12 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 13 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 240 + i32.const 80 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 17 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.copy (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 21 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__release (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $start:rc/ternary-mismatch (; 25 ;) (type $FUNCSIG$v) + i32.const 0 + call $rc/ternary-mismatch/Ref#constructor + global.set $rc/ternary-mismatch/gloRef + i32.const 1 + call $rc/ternary-mismatch/test1 + call $~lib/rt/purerc/__release + i32.const 0 + call $rc/ternary-mismatch/test1 + call $~lib/rt/purerc/__release + i32.const 1 + call $rc/ternary-mismatch/test2 + call $~lib/rt/purerc/__release + i32.const 0 + call $rc/ternary-mismatch/test2 + call $~lib/rt/purerc/__release + global.get $rc/ternary-mismatch/gloRef + call $~lib/rt/purerc/__release + ) + (func $start (; 26 ;) (type $FUNCSIG$v) + call $start:rc/ternary-mismatch + ) + (func $~lib/rt/purerc/increment (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/purerc/markGray (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/builtins/__visit_members (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 35 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/retain-release-sanity.json b/tests/compiler/retain-release-sanity.json new file mode 100644 index 00000000..9f7878d4 --- /dev/null +++ b/tests/compiler/retain-release-sanity.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/retain-release-sanity.optimized.wat b/tests/compiler/retain-release-sanity.optimized.wat new file mode 100644 index 00000000..1d4dd54d --- /dev/null +++ b/tests/compiler/retain-release-sanity.optimized.wat @@ -0,0 +1,2714 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (memory $0 1) + (data (i32.const 8) "&\00\00\00\01\00\00\00\10\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 64) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 112) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s") + (data (i32.const 168) "\1a\00\00\00\01\00\00\00\10\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 220) "\01\00\00\00\10") + (data (i32.const 232) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00a") + (data (i32.const 256) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00b") + (data (i32.const 280) "\08\00\00\00\01\00\00\00\10\00\00\00\08\00\00\00n\00u\00l\00l") + (data (i32.const 304) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00d") + (data (i32.const 328) "\12\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00I\00\00\00\0e\00\00\00I\04\00\00\0e") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/started (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (export "main" (func $retain-release-sanity/main)) + (func $~lib/rt/tlsf/removeBlock (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $2 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 + local.get $3 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=20 + local.set $4 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $4 + i32.store offset=20 + end + local.get $4 + if + local.get $4 + local.get $5 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.get $1 + i32.eq + if + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 80 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 6 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 80 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 80 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 7 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + current_memory + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 480 + i32.const 0 + i32.store + i32.const 2048 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 480 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 480 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 480 + i32.const 2064 + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 480 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 0 + i32.const 80 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + current_memory + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + grow_memory + i32.const 0 + i32.lt_s + if + local.get $1 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 80 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 80 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 1 + i32.add + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.add + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $2 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 3 + i32.add + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $0 + i32.sub + i32.const 3 + i32.and + local.tee $1 + i32.sub + local.set $2 + local.get $0 + local.get $1 + i32.add + local.tee $0 + i32.const 0 + i32.store + local.get $2 + i32.const -4 + i32.and + local.tee $1 + local.get $0 + i32.add + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 4 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 12 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 16 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 20 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $2 + local.get $0 + i32.add + local.set $0 + local.get $1 + local.get $2 + i32.sub + local.set $1 + loop $continue|0 + local.get $1 + i32.const 32 + i32.ge_u + if + local.get $0 + i64.const 0 + i64.store + local.get $0 + i32.const 8 + i32.add + i64.const 0 + i64.store + local.get $0 + i32.const 16 + i32.add + i64.const 0 + i64.store + local.get $0 + i32.const 24 + i32.add + i64.const 0 + i64.store + local.get $1 + i32.const 32 + i32.sub + local.set $1 + local.get $0 + i32.const 32 + i32.add + local.set $0 + br $continue|0 + end + end + end + ) + (func $~lib/rt/purerc/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 480 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + i32.const 0 + i32.const 24 + i32.const 57 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + call $~lib/rt/tlsf/__alloc + local.tee $1 + local.get $0 + call $~lib/memory/memory.fill + local.get $1 + call $~lib/rt/purerc/__retain + ) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 268435452 + i32.gt_u + if + i32.const 0 + i32.const 24 + i32.const 14 + i32.const 56 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 2 + i32.shl + local.tee $2 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $0 + i32.eqz + if + i32.const 12 + i32.const 14 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + local.get $1 + i32.store + local.get $0 + local.get $1 + i32.store offset=4 + local.get $0 + local.get $2 + i32.store offset=8 + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 80 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/memory/memory.copy (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $2 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + local.get $0 + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $2 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $2 + i32.const 8 + i32.sub + local.set $2 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $2 + if + local.get $0 + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $2 + i32.add + i32.const 7 + i32.and + if + local.get $2 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + local.get $0 + i32.add + local.get $1 + local.get $2 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $2 + i32.const 8 + i32.ge_u + if + local.get $2 + i32.const 8 + i32.sub + local.tee $2 + local.get $0 + i32.add + local.get $1 + local.get $2 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $2 + if + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + local.get $0 + i32.add + local.get $1 + local.get $2 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 21 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/purerc/CUR + global.get $~lib/rt/purerc/ROOTS + local.tee $2 + i32.sub + local.tee $1 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + local.get $2 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + global.set $~lib/rt/purerc/ROOTS + local.get $0 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.tee $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + local.tee $3 + if (result i32) + local.get $3 + i32.const 328 + i32.load + i32.gt_u + else + i32.const 1 + end + if (result i32) + unreachable + else + local.get $3 + i32.const 3 + i32.shl + i32.const 328 + i32.add + i32.load + end + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + end + end + ) + (func $~lib/rt/purerc/__release (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 480 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/tlsf/reallocateBlock (; 25 ;) (type $FUNCSIG$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.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $1 + i32.load + local.tee $4 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 80 + i32.const 491 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const -4 + i32.and + i32.le_u + if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $6 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $4 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $5 + local.get $3 + i32.ge_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return + end + end + local.get $0 + local.get $2 + call $~lib/rt/tlsf/allocateBlock + local.tee $3 + local.get $1 + i32.load offset=4 + i32.store offset=4 + local.get $3 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + local.get $3 + ) + (func $~lib/rt/tlsf/__realloc (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 552 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 553 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/array/ensureSize (; 27 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + local.get $0 + i32.load offset=8 + local.tee $2 + i32.const 2 + i32.shr_u + i32.gt_u + if + local.get $1 + i32.const 268435452 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 184 + i32.const 14 + i32.const 47 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load + local.tee $4 + local.get $1 + i32.const 2 + i32.shl + local.tee $3 + call $~lib/rt/tlsf/__realloc + local.tee $1 + local.get $2 + i32.add + local.get $3 + local.get $2 + i32.sub + call $~lib/memory/memory.fill + local.get $1 + local.get $4 + i32.ne + if + local.get $0 + local.get $1 + call $~lib/rt/purerc/__retain + i32.store + local.get $0 + local.get $1 + i32.store offset=4 + end + local.get $0 + local.get $3 + i32.store offset=8 + end + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/array/Array#push (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + local.get $0 + i32.load offset=12 + local.tee $1 + i32.const 1 + i32.add + local.tee $2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.const 123 + i32.store + local.get $0 + local.get $2 + i32.store offset=12 + ) + (func $~lib/array/Array#pop (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=12 + local.tee $1 + i32.const 1 + i32.lt_s + if + i32.const 0 + i32.const 184 + i32.const 250 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.sub + local.tee $1 + i32.const 2 + i32.shl + i32.add + i32.load + drop + local.get $0 + local.get $1 + i32.store offset=12 + ) + (func $~lib/rt/purerc/__retainRelease (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $1 + i32.ne + if + local.get $0 + i32.const 480 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + i32.const 480 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + end + local.get $0 + ) + (func $~lib/array/Array<~lib/string/String>#push (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + i32.const 232 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $0 + i32.load offset=12 + local.tee $1 + i32.const 1 + i32.add + local.tee $2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.tee $1 + i32.const 232 + local.get $1 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $0 + local.get $2 + i32.store offset=12 + i32.const 232 + call $~lib/rt/purerc/__release + ) + (func $~lib/string/String#concat (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + block (result i32) + local.get $1 + i32.eqz + if + i32.const 296 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + end + local.get $1 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + i32.const 1 + i32.shl + local.tee $4 + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + i32.const 1 + i32.shl + local.tee $3 + i32.add + local.tee $2 + i32.eqz + end + if + i32.const 232 + call $~lib/rt/purerc/__retain + local.set $0 + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 + return + end + local.get $2 + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.tee $2 + local.get $0 + local.get $3 + call $~lib/memory/memory.copy + local.get $2 + local.get $3 + i32.add + local.get $1 + local.get $4 + call $~lib/memory/memory.copy + local.get $2 + call $~lib/rt/purerc/__retain + local.set $0 + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 + ) + (func $~lib/string/String.__concat (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.const 296 + local.get $0 + select + local.get $1 + call $~lib/string/String#concat + local.tee $2 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + ) + (func $~lib/rt/purerc/markGray (; 34 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 36 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__collect (; 38 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.tee $5 + local.tee $2 + local.set $3 + global.get $~lib/rt/purerc/CUR + local.set $0 + loop $repeat|0 + block $break|0 + local.get $3 + local.get $0 + i32.ge_u + br_if $break|0 + local.get $3 + i32.load + local.tee $4 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/purerc/markGray + local.get $2 + local.get $4 + i32.store + local.get $2 + i32.const 4 + i32.add + local.set $2 + else + i32.const 0 + local.get $1 + i32.const 268435455 + i32.and + i32.eqz + local.get $1 + i32.const 1879048192 + i32.and + select + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $1 + i32.const 2147483647 + i32.and + i32.store offset=4 + end + end + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $repeat|0 + end + end + local.get $2 + global.set $~lib/rt/purerc/CUR + local.get $5 + local.set $0 + loop $repeat|1 + block $break|1 + local.get $0 + local.get $2 + i32.ge_u + br_if $break|1 + local.get $0 + i32.load + call $~lib/rt/purerc/scan + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $repeat|1 + end + end + local.get $5 + local.set $0 + loop $repeat|2 + block $break|2 + local.get $0 + local.get $2 + i32.ge_u + br_if $break|2 + local.get $0 + i32.load + local.tee $1 + local.get $1 + i32.load offset=4 + i32.const 2147483647 + i32.and + i32.store offset=4 + local.get $1 + call $~lib/rt/purerc/collectWhite + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $repeat|2 + end + end + local.get $5 + global.set $~lib/rt/purerc/CUR + ) + (func $start:retain-release-sanity (; 39 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 16 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + i32.const 3 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.tee $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 3 + i32.store offset=12 + local.get $0 + call $~lib/rt/purerc/__retain + local.tee $1 + call $~lib/array/Array#push + local.get $1 + call $~lib/array/Array#push + local.get $1 + call $~lib/array/Array#pop + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 + local.set $1 + loop $repeat|0 + local.get $1 + i32.const 10 + i32.lt_s + if + i32.const 16 + i32.const 18 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + i32.const 0 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.tee $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + call $~lib/rt/purerc/__retain + local.set $3 + i32.const 0 + local.set $2 + loop $repeat|1 + local.get $2 + i32.const 10 + i32.lt_s + if + local.get $3 + call $~lib/array/Array<~lib/string/String>#push + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|1 + end + end + local.get $0 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + end + end + i32.const 248 + call $~lib/rt/purerc/__retain + local.tee $0 + i32.const 272 + call $~lib/string/String.__concat + local.tee $1 + call $~lib/rt/purerc/__retain + local.tee $2 + i32.const 320 + call $~lib/string/String.__concat + local.set $3 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + call $~lib/rt/purerc/__collect + ) + (func $retain-release-sanity/main (; 40 ;) (type $FUNCSIG$v) + global.get $~lib/started + i32.eqz + if + call $start:retain-release-sanity + i32.const 1 + global.set $~lib/started + end + ) + (func $~lib/rt/purerc/__visit (; 41 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 480 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/purerc/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/purerc/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/purerc/collectWhite + br $break|0 + end + i32.const 0 + i32.const 128 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/array/Array<~lib/string/String>#__traverse (; 42 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=4 + local.tee $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + local.get $1 + call $~lib/builtins/__visit_members + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + ) + (func $~lib/builtins/__visit_members (; 43 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $invalid + block $~lib/array/Array<~lib/string/String> + block $~lib/array/Array + block $~lib/string/String + block $~lib/arraybuffer/ArrayBuffer + block $~lib/arraybuffer/ArrayBufferView + block $~lib/number/F64 + block $~lib/number/F32 + block $~lib/number/Bool + block $~lib/number/Usize + block $~lib/number/U64 + block $~lib/number/U32 + block $~lib/number/U16 + block $~lib/number/U8 + block $~lib/number/Isize + block $~lib/number/I64 + block $~lib/number/I32 + block $~lib/number/I16 + block $~lib/number/I8 + local.get $0 + i32.const 8 + i32.sub + i32.load + i32.const 1 + i32.sub + br_table $~lib/number/I8 $~lib/number/I16 $~lib/number/I32 $~lib/number/I64 $~lib/number/Isize $~lib/number/U8 $~lib/number/U16 $~lib/number/U32 $~lib/number/U64 $~lib/number/Usize $~lib/number/Bool $~lib/number/F32 $~lib/number/F64 $~lib/arraybuffer/ArrayBufferView $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/array/Array $~lib/array/Array<~lib/string/String> $invalid + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + local.get $1 + call $~lib/builtins/__visit_members + end + return + end + return + end + return + end + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + return + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__traverse + return + end + unreachable + ) + (func $null (; 44 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/retain-release-sanity.ts b/tests/compiler/retain-release-sanity.ts new file mode 100644 index 00000000..919d13dd --- /dev/null +++ b/tests/compiler/retain-release-sanity.ts @@ -0,0 +1,21 @@ +@start export function main(): void {} +{ + let arr: i32[] = new Array(3); + arr.push(123); + arr.push(123); + arr.pop(); +} +{ + for (let i = 0; i < 10; ++i) { + let arr = new Array(); + for (let j = 0; j < 10; ++j) { + arr.push(""); + } + } +} +{ + let a = "a"; + let c = a + "b"; + c + "d"; +} +__collect(); diff --git a/tests/compiler/retain-release-sanity.untouched.wat b/tests/compiler/retain-release-sanity.untouched.wat new file mode 100644 index 00000000..98465e7d --- /dev/null +++ b/tests/compiler/retain-release-sanity.untouched.wat @@ -0,0 +1,3412 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (memory $0 1) + (data (i32.const 8) "&\00\00\00\01\00\00\00\10\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 64) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 112) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 168) "\1a\00\00\00\01\00\00\00\10\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 216) "\00\00\00\00\01\00\00\00\10\00\00\00\00\00\00\00") + (data (i32.const 232) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00a\00") + (data (i32.const 256) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00b\00") + (data (i32.const 280) "\08\00\00\00\01\00\00\00\10\00\00\00\08\00\00\00n\00u\00l\00l\00") + (data (i32.const 304) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00d\00") + (data (i32.const 328) "\12\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00I\00\00\00\0e\00\00\00I\04\00\00\0e\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/started (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 328)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 480)) + (export "memory" (memory $0)) + (export "main" (func $retain-release-sanity/main)) + (func $~lib/rt/tlsf/removeBlock (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $3 + local.get $0 + local.get $9 + i32.const 2 + i32.shl + i32.add + local.get $3 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 6 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 16 + i32.const 16 + i32.add + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 7 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 0 + i32.const 80 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.4 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 16 + i32.const 16 + i32.add + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $0 + local.get $1 + i32.store8 + local.get $0 + local.get $2 + i32.add + i32.const 1 + i32.sub + local.get $1 + i32.store8 + local.get $2 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $0 + i32.const 1 + i32.add + local.get $1 + i32.store8 + local.get $0 + i32.const 2 + i32.add + local.get $1 + i32.store8 + local.get $0 + local.get $2 + i32.add + i32.const 2 + i32.sub + local.get $1 + i32.store8 + local.get $0 + local.get $2 + i32.add + i32.const 3 + i32.sub + local.get $1 + i32.store8 + local.get $2 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $0 + i32.const 3 + i32.add + local.get $1 + i32.store8 + local.get $0 + local.get $2 + i32.add + i32.const 4 + i32.sub + local.get $1 + i32.store8 + local.get $2 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $0 + i32.sub + i32.const 3 + i32.and + local.set $5 + local.get $0 + local.get $5 + i32.add + local.set $0 + local.get $2 + local.get $5 + i32.sub + local.set $2 + local.get $2 + i32.const -4 + i32.and + local.set $2 + i32.const -1 + i32.const 255 + i32.div_u + local.get $1 + i32.const 255 + i32.and + i32.mul + local.set $4 + local.get $0 + local.get $4 + i32.store + local.get $0 + local.get $2 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store + local.get $2 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $4 + i32.store + local.get $0 + local.get $2 + i32.add + i32.const 12 + i32.sub + local.get $4 + i32.store + local.get $0 + local.get $2 + i32.add + i32.const 8 + i32.sub + local.get $4 + i32.store + local.get $2 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.store + local.get $0 + i32.const 16 + i32.add + local.get $4 + i32.store + local.get $0 + i32.const 20 + i32.add + local.get $4 + i32.store + local.get $0 + i32.const 24 + i32.add + local.get $4 + i32.store + local.get $0 + local.get $2 + i32.add + i32.const 28 + i32.sub + local.get $4 + i32.store + local.get $0 + local.get $2 + i32.add + i32.const 24 + i32.sub + local.get $4 + i32.store + local.get $0 + local.get $2 + i32.add + i32.const 20 + i32.sub + local.get $4 + i32.store + local.get $0 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.get $4 + i32.store + i32.const 24 + local.get $0 + i32.const 4 + i32.and + i32.add + local.set $5 + local.get $0 + local.get $5 + i32.add + local.set $0 + local.get $2 + local.get $5 + i32.sub + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $6 + block $break|0 + loop $continue|0 + local.get $2 + i32.const 32 + i32.ge_u + if + local.get $0 + local.get $6 + i64.store + local.get $0 + i32.const 8 + i32.add + local.get $6 + i64.store + local.get $0 + i32.const 16 + i32.add + local.get $6 + i64.store + local.get $0 + i32.const 24 + i32.add + local.get $6 + i64.store + local.get $2 + i32.const 32 + i32.sub + local.set $2 + local.get $0 + i32.const 32 + i32.add + local.set $0 + br $continue|0 + end + end + end + end + ) + (func $~lib/rt/purerc/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 1073741808 + i32.gt_u + if + i32.const 0 + i32.const 24 + i32.const 57 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 15 + call $~lib/rt/tlsf/__alloc + local.set $2 + local.get $2 + i32.const 0 + local.get $1 + call $~lib/memory/memory.fill + local.get $2 + call $~lib/rt/purerc/__retain + ) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 18 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.const 1073741808 + local.get $2 + i32.shr_u + i32.gt_u + if + i32.const 0 + i32.const 24 + i32.const 14 + i32.const 56 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + local.get $1 + local.get $2 + i32.shl + local.tee $1 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $3 + local.set $4 + block (result i32) + local.get $0 + i32.eqz + if + i32.const 12 + i32.const 14 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + end + local.get $4 + i32.store + local.get $0 + local.get $4 + i32.store offset=4 + local.get $0 + local.get $1 + i32.store offset=8 + local.get $0 + ) + (func $~lib/array/Array#constructor (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 16 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + end + local.get $1 + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.tee $2 + local.set $0 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 20 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if (result i32) + unreachable + else + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + end + ) + (func $~lib/memory/memory.copy (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $2 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $2 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $2 + i32.const 8 + i32.sub + local.set $2 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $2 + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|2 + end + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $0 + local.get $2 + i32.add + i32.const 7 + i32.and + if + local.get $2 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $0 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + i32.add + local.get $1 + local.get $2 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $2 + i32.const 8 + i32.ge_u + if + local.get $2 + i32.const 8 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.add + local.get $1 + local.get $2 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $2 + if + local.get $0 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + i32.add + local.get $1 + local.get $2 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__release (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/tlsf/reallocateBlock (; 27 ;) (type $FUNCSIG$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) + (local $8 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $1 + i32.load + local.set $4 + local.get $4 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 491 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.le_u + if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + block $~lib/rt/tlsf/GETRIGHT|inlined.4 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $6 + local.get $6 + i32.load + local.set $7 + local.get $7 + i32.const 1 + i32.and + if + local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $7 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $5 + local.get $5 + local.get $3 + i32.ge_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return + end + end + local.get $0 + local.get $2 + call $~lib/rt/tlsf/allocateBlock + local.set $8 + local.get $8 + local.get $1 + i32.load offset=4 + i32.store offset=4 + local.get $8 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $8 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + local.get $8 + ) + (func $~lib/rt/tlsf/__realloc (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 552 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 553 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/array/ensureSize (; 29 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=8 + local.set $3 + local.get $1 + local.get $3 + local.get $2 + i32.shr_u + i32.gt_u + if + local.get $1 + i32.const 1073741808 + local.get $2 + i32.shr_u + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/__release + block + i32.const 0 + i32.const 184 + i32.const 14 + i32.const 47 + call $~lib/builtins/abort + unreachable + unreachable + end + unreachable + end + local.get $0 + i32.load + local.set $4 + local.get $1 + local.get $2 + i32.shl + local.set $5 + local.get $4 + local.get $5 + call $~lib/rt/tlsf/__realloc + local.set $6 + local.get $6 + local.get $3 + i32.add + i32.const 0 + local.get $5 + local.get $3 + i32.sub + call $~lib/memory/memory.fill + local.get $6 + local.get $4 + i32.ne + if + local.get $0 + local.get $6 + call $~lib/rt/purerc/__retain + i32.store + local.get $0 + local.get $6 + i32.store offset=4 + end + local.get $0 + local.get $5 + i32.store offset=8 + end + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/array/Array#push (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.add + local.set $3 + local.get $0 + local.get $3 + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.get $2 + i32.const 2 + i32.shl + i32.add + local.get $1 + i32.store + local.get $0 + local.get $3 + i32.store offset=12 + local.get $3 + ) + (func $~lib/array/Array#pop (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=12 + local.set $1 + local.get $1 + i32.const 1 + i32.lt_s + if + i32.const 0 + i32.const 184 + i32.const 250 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.sub + local.tee $1 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $2 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $2 + ) + (func $~lib/array/Array<~lib/string/String>#constructor (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 16 + i32.const 18 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + end + local.get $1 + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.tee $2 + local.set $0 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $1 + if + local.get $2 + call $~lib/rt/purerc/__release + block + i32.const 0 + i32.const 184 + i32.const 56 + i32.const 20 + call $~lib/builtins/abort + unreachable + unreachable + end + unreachable + end + local.get $0 + local.get $1 + i32.store offset=12 + local.get $0 + ) + (func $~lib/rt/purerc/__retainRelease (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.ne + if + global.get $~lib/builtins/HEAP_BASE + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + local.get $2 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + end + local.get $0 + ) + (func $~lib/array/Array<~lib/string/String>#push (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.add + local.set $3 + local.get $0 + local.get $3 + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.get $2 + i32.const 2 + i32.shl + i32.add + local.set $4 + local.get $4 + local.get $1 + local.get $4 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $0 + local.get $3 + i32.store offset=12 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + ) + (func $~lib/string/String#get:length (; 35 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/string/String#concat (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $1 + i32.const 0 + i32.eq + if + i32.const 296 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + end + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $2 + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $3 + local.get $2 + local.get $3 + i32.add + local.set $4 + local.get $4 + i32.const 0 + i32.eq + if + i32.const 232 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 + return + end + local.get $4 + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $6 + local.get $6 + local.get $0 + local.get $2 + call $~lib/memory/memory.copy + local.get $6 + local.get $2 + i32.add + local.get $1 + local.get $3 + call $~lib/memory/memory.copy + local.get $6 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 + ) + (func $~lib/string/String.__concat (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.const 296 + local.get $0 + i32.const 0 + i32.ne + select + local.get $1 + call $~lib/string/String#concat + local.tee $2 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + ) + (func $~lib/rt/purerc/markGray (; 38 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 39 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 40 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 41 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__collect (; 42 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + local.get $0 + local.set $1 + block $break|0 + block + local.get $1 + local.set $2 + global.get $~lib/rt/purerc/CUR + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $2 + i32.load + local.set $4 + local.get $4 + i32.load offset=4 + local.set $5 + local.get $5 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/purerc/markGray + local.get $1 + local.get $4 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else + local.get $5 + i32.const 1879048192 + i32.and + i32.const 0 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $5 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + end + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + global.set $~lib/rt/purerc/CUR + block $break|1 + local.get $0 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $5 + i32.load + call $~lib/rt/purerc/scan + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + block $break|2 + local.get $0 + local.set $5 + loop $repeat|2 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $5 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + local.get $4 + call $~lib/rt/purerc/collectWhite + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + global.set $~lib/rt/purerc/CUR + ) + (func $start:retain-release-sanity (; 43 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + block + i32.const 0 + i32.const 3 + call $~lib/array/Array#constructor + local.tee $0 + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 + i32.const 123 + call $~lib/array/Array#push + drop + local.get $1 + i32.const 123 + call $~lib/array/Array#push + drop + local.get $1 + call $~lib/array/Array#pop + drop + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + end + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 + local.get $1 + i32.const 10 + i32.lt_s + i32.eqz + br_if $break|0 + i32.const 0 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#constructor + local.tee $0 + call $~lib/rt/purerc/__retain + local.set $2 + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 10 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $2 + i32.const 232 + call $~lib/array/Array<~lib/string/String>#push + drop + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + unreachable + end + unreachable + end + block + i32.const 248 + call $~lib/rt/purerc/__retain + local.set $2 + local.get $2 + i32.const 272 + call $~lib/string/String.__concat + local.tee $0 + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 + i32.const 320 + call $~lib/string/String.__concat + local.tee $3 + drop + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + end + call $~lib/rt/purerc/__collect + ) + (func $retain-release-sanity/main (; 44 ;) (type $FUNCSIG$v) + global.get $~lib/started + i32.eqz + if + call $start + i32.const 1 + global.set $~lib/started + end + ) + (func $start (; 45 ;) (type $FUNCSIG$v) + call $start:retain-release-sanity + ) + (func $~lib/rt/purerc/__visit (; 46 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/array/Array#__traverse (; 47 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/array/Array<~lib/string/String>#__traverse (; 48 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + local.get $4 + local.get $1 + call $~lib/builtins/__visit_members + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/builtins/__visit_members (; 49 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $invalid + block $~lib/array/Array<~lib/string/String> + block $~lib/array/Array + block $~lib/string/String + block $~lib/arraybuffer/ArrayBuffer + block $~lib/arraybuffer/ArrayBufferView + block $~lib/number/F64 + block $~lib/number/F32 + block $~lib/number/Bool + block $~lib/number/Usize + block $~lib/number/U64 + block $~lib/number/U32 + block $~lib/number/U16 + block $~lib/number/U8 + block $~lib/number/Isize + block $~lib/number/I64 + block $~lib/number/I32 + block $~lib/number/I16 + block $~lib/number/I8 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $invalid $~lib/number/I8 $~lib/number/I16 $~lib/number/I32 $~lib/number/I64 $~lib/number/Isize $~lib/number/U8 $~lib/number/U16 $~lib/number/U32 $~lib/number/U64 $~lib/number/Usize $~lib/number/Bool $~lib/number/F32 $~lib/number/F64 $~lib/arraybuffer/ArrayBufferView $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/array/Array $~lib/array/Array<~lib/string/String> $invalid + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + return + end + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + local.get $2 + local.get $1 + call $~lib/builtins/__visit_members + end + return + end + return + end + return + end + local.get $0 + local.get $1 + call $~lib/array/Array#__traverse + return + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__traverse + return + end + unreachable + ) + (func $null (; 50 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/retain-release.optimized.wat b/tests/compiler/retain-release.optimized.wat index a29987c5..82aea40b 100644 --- a/tests/compiler/retain-release.optimized.wat +++ b/tests/compiler/retain-release.optimized.wat @@ -1,101 +1,535 @@ (module - (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$v (func)) + (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00r\00e\00t\00a\00i\00n\00-\00r\00e\00l\00e\00a\00s\00e\00.\00t\00s") + (data (i32.const 8) "\n\00\00\00\01\00\00\00\10\00\00\00\n\00\00\00e\00r\00r\00o\00r\00") + (data (i32.const 40) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00r\00e\00t\00a\00i\00n\00-\00r\00e\00l\00e\00a\00s\00e\00.\00t\00s\00") (table $0 1 funcref) - (elem (i32.const 0) $retain-release/receiveRef) + (elem (i32.const 0) $null) + (global $retain-release/REF (mut i32) (i32.const 0)) (global $retain-release/glo (mut i32) (i32.const 0)) - (global $~lib/rt/index-stub/startOffset (mut i32) (i32.const 0)) - (global $~lib/rt/index-stub/offset (mut i32) (i32.const 0)) + (global $retain-release/TARGET (mut i32) (i32.const 0)) (global $~lib/argc (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 92)) (export "memory" (memory $0)) (export "returnRef" (func $retain-release/returnRef)) (export "receiveRef" (func $retain-release/receiveRef)) - (export "receiveRefDrop" (func $retain-release/receiveRef)) - (export "receiveRefRetain" (func $retain-release/receiveRef)) + (export "receiveRefDrop" (func $retain-release/receiveRefDrop)) + (export "receiveRefRetain" (func $retain-release/receiveRefRetain)) (export "takeRef" (func $retain-release/takeRef)) - (export "provideRef" (func $retain-release/receiveRef)) + (export "provideRef" (func $retain-release/provideRef)) (export "takeReturnRef" (func $retain-release/takeReturnRef)) - (export "provideReceiveRef" (func $retain-release/receiveRef)) + (export "provideReceiveRef" (func $retain-release/provideReceiveRef)) (export "newRef" (func $retain-release/newRef)) (export "assignGlobal" (func $retain-release/assignGlobal)) (export "assignField" (func $retain-release/assignField)) - (export "scopeBlock" (func $retain-release/receiveRef)) - (export "scopeBlockToUninitialized" (func $retain-release/receiveRef)) - (export "scopeBlockToInitialized" (func $retain-release/receiveRef)) - (export "scopeBlockToConditional" (func $retain-release/takeRef)) - (export "scopeTopLevelUninitialized" (func $retain-release/receiveRef)) - (export "scopeTopLevelInitialized" (func $retain-release/receiveRef)) - (export "scopeTopLevelConditional" (func $retain-release/takeRef)) - (export "scopeIf" (func $retain-release/takeRef)) - (export "scopeIfElse" (func $retain-release/takeRef)) - (export "scopeWhile" (func $retain-release/takeRef)) - (export "scopeDo" (func $retain-release/takeRef)) - (export "scopeFor" (func $retain-release/takeRef)) - (export "scopeBreak" (func $retain-release/takeRef)) - (export "scopeContinue" (func $retain-release/takeRef)) + (export "scopeBlock" (func $retain-release/scopeBlock)) + (export "scopeBlockToUninitialized" (func $retain-release/scopeBlockToUninitialized)) + (export "scopeBlockToInitialized" (func $retain-release/scopeBlockToInitialized)) + (export "scopeBlockToConditional" (func $retain-release/scopeBlockToConditional)) + (export "scopeTopLevelUninitialized" (func $retain-release/scopeTopLevelUninitialized)) + (export "scopeTopLevelInitialized" (func $retain-release/scopeTopLevelInitialized)) + (export "scopeTopLevelConditional" (func $retain-release/scopeTopLevelConditional)) + (export "scopeIf" (func $retain-release/scopeIf)) + (export "scopeIfElse" (func $retain-release/scopeIfElse)) + (export "scopeWhile" (func $retain-release/scopeWhile)) + (export "scopeDo" (func $retain-release/scopeDo)) + (export "scopeFor" (func $retain-release/scopeFor)) + (export "scopeBreak" (func $retain-release/scopeBreak)) + (export "scopeContinue" (func $retain-release/scopeContinue)) (export "scopeThrow" (func $retain-release/scopeThrow)) (export "scopeUnreachable" (func $retain-release/scopeUnreachable)) - (export "callInline" (func $retain-release/receiveRef)) - (export "provideRefInline" (func $retain-release/receiveRef)) - (export "receiveRefInline" (func $retain-release/receiveRef)) - (export "receiveRefInlineDrop" (func $retain-release/receiveRef)) + (export "callInline" (func $retain-release/callInline)) + (export "provideRefInline" (func $retain-release/provideRefInline)) + (export "receiveRefInline" (func $retain-release/receiveRefInline)) + (export "receiveRefInlineDrop" (func $retain-release/receiveRefInlineDrop)) (export "provideRefIndirect" (func $retain-release/provideRefIndirect)) (export "receiveRefIndirect" (func $retain-release/receiveRefIndirect)) - (export "receiveRefIndirectDrop" (func $retain-release/receiveRefIndirect)) + (export "receiveRefIndirectDrop" (func $retain-release/receiveRefIndirectDrop)) (start $start) - (func $retain-release/returnRef (; 1 ;) (type $FUNCSIG$i) (result i32) - i32.const 0 - ) - (func $retain-release/receiveRef (; 2 ;) (type $FUNCSIG$v) - nop - ) - (func $retain-release/takeRef (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $retain-release/takeReturnRef (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $retain-release/Ref#constructor (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 17 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end local.get $0 ) - (func $~lib/rt/index-stub/__alloc (; 5 ;) (type $FUNCSIG$i) (result i32) + (func $retain-release/Target#constructor (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 18 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + ) + (func $start:retain-release (; 3 ;) (type $FUNCSIG$v) + i32.const 0 + call $retain-release/Ref#constructor + global.set $retain-release/REF + i32.const 0 + call $retain-release/Target#constructor + global.set $retain-release/TARGET + ) + (func $retain-release/returnRef (; 4 ;) (type $FUNCSIG$i) (result i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + ) + (func $retain-release/receiveRef (; 5 ;) (type $FUNCSIG$v) + (local $0 i32) + call $retain-release/returnRef + local.tee $0 + i32.eqz + drop + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/receiveRefDrop (; 6 ;) (type $FUNCSIG$v) + call $retain-release/returnRef + call $~lib/rt/stub/__release + ) + (func $retain-release/receiveRefRetain (; 7 ;) (type $FUNCSIG$v) + (local $0 i32) + call $retain-release/returnRef + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/takeRef (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/provideRef (; 9 ;) (type $FUNCSIG$v) + global.get $retain-release/REF + call $retain-release/takeRef + ) + (func $retain-release/takeReturnRef (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + ) + (func $retain-release/provideReceiveRef (; 11 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $retain-release/takeReturnRef + local.tee $0 + i32.eqz + drop + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/newRef (; 12 ;) (type $FUNCSIG$v) + i32.const 0 + call $retain-release/Ref#constructor + call $~lib/rt/stub/__release + ) + (func $retain-release/assignGlobal (; 13 ;) (type $FUNCSIG$v) + global.get $retain-release/REF + global.get $retain-release/glo + call $~lib/rt/stub/__retainRelease + global.set $retain-release/glo + ) + (func $retain-release/assignField (; 14 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/TARGET + local.tee $0 + global.get $retain-release/REF + local.get $0 + i32.load + call $~lib/rt/stub/__retainRelease + i32.store + ) + (func $retain-release/scopeBlock (; 15 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeBlockToUninitialized (; 16 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + i32.const 0 + local.set $0 + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + local.get $0 + call $~lib/rt/stub/__retainRelease + local.set $0 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeBlockToInitialized (; 17 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + local.get $0 + call $~lib/rt/stub/__retainRelease + local.set $0 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeBlockToConditional (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + i32.const 0 + local.set $1 + local.get $0 + if + global.get $retain-release/REF + local.get $1 + call $~lib/rt/stub/__retainRelease + local.set $1 + end + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/stub/__retainRelease + local.set $1 + local.get $2 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeTopLevelUninitialized (; 19 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeTopLevelInitialized (; 20 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeTopLevelConditional (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + i32.const 0 + local.set $1 + local.get $0 + if + global.get $retain-release/REF + local.get $1 + call $~lib/rt/stub/__retainRelease + local.set $1 + end + local.get $1 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeIf (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + end + ) + (func $retain-release/scopeIfElse (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + else + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + end + ) + (func $retain-release/scopeWhile (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + br $continue|0 + end + end + ) + (func $retain-release/scopeDo (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + block + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + end + local.get $0 + br_if $continue|0 + end + ) + (func $retain-release/scopeFor (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + block $break|0 + loop $repeat|0 + local.get $0 + i32.eqz + br_if $break|0 + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $retain-release/scopeBreak (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + block $break|0 + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + br $break|0 + end + end + end + ) + (func $retain-release/scopeContinue (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + br $continue|0 + end + end + ) + (func $retain-release/scopeThrow (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + block + i32.const 24 + i32.const 56 + i32.const 310 + i32.const 4 + call $~lib/builtins/abort + unreachable + unreachable + end + unreachable + end + end + ) + (func $retain-release/scopeUnreachable (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + unreachable + local.get $1 + call $~lib/rt/stub/__release + br $continue|0 + end + end + ) + (func $retain-release/callInline (; 31 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/provideRefInline (; 32 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/receiveRefInline (; 33 ;) (type $FUNCSIG$v) + (local $0 i32) + block $retain-release/returnRefInline|inlined.0 (result i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + end + local.tee $0 + i32.eqz + drop + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/receiveRefInlineDrop (; 34 ;) (type $FUNCSIG$v) + block $retain-release/returnRefInline|inlined.1 (result i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + end + call $~lib/rt/stub/__release + ) + (func $retain-release/provideRefIndirect (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 1 + global.set $~lib/argc + global.get $retain-release/REF + local.get $0 + call_indirect (type $FUNCSIG$vi) + ) + (func $retain-release/receiveRefIndirect (; 36 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + block (result i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + call_indirect (type $FUNCSIG$i) + local.tee $1 + end + i32.eqz + drop + local.get $1 + call $~lib/rt/stub/__release + ) + (func $retain-release/receiveRefIndirectDrop (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + call_indirect (type $FUNCSIG$i) + call $~lib/rt/stub/__release + ) + (func $start (; 38 ;) (type $FUNCSIG$v) + call $start:retain-release + ) + (func $~lib/rt/stub/__alloc (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - global.get $~lib/rt/index-stub/offset + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + unreachable + end + global.get $~lib/rt/stub/offset i32.const 16 i32.add - local.tee $1 - i32.const 16 + local.set $2 + local.get $2 + local.get $0 + local.tee $3 + i32.const 1 + local.tee $4 + local.get $3 + local.get $4 + i32.gt_u + select i32.add - i32.const -16 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor i32.and - local.tee $0 + local.set $5 current_memory - local.tee $2 + local.set $6 + local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if + local.get $5 local.get $2 - local.get $0 - local.get $1 i32.sub i32.const 65535 i32.add - i32.const -65536 + i32.const 65535 + i32.const -1 + i32.xor i32.and i32.const 16 i32.shr_u - local.tee $3 - local.get $2 + local.set $3 + local.get $6 + local.tee $4 local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select + local.set $4 + local.get $4 grow_memory i32.const 0 i32.lt_s @@ -109,70 +543,29 @@ end end end - local.get $0 - global.set $~lib/rt/index-stub/offset - local.get $1 + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 i32.const 16 i32.sub - local.tee $0 - i32.const 17 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 + local.set $8 + local.get $8 local.get $1 - ) - (func $retain-release/newRef (; 6 ;) (type $FUNCSIG$v) - call $~lib/rt/index-stub/__alloc - drop - ) - (func $retain-release/assignGlobal (; 7 ;) (type $FUNCSIG$v) - i32.const 0 - global.set $retain-release/glo - ) - (func $retain-release/assignField (; 8 ;) (type $FUNCSIG$v) - i32.const 0 - i32.load - drop - i32.const 0 - i32.const 0 - i32.store - ) - (func $retain-release/scopeThrow (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.store offset=8 + local.get $8 local.get $0 - if - i32.const 0 - i32.const 24 - i32.const 306 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.store offset=12 + local.get $2 ) - (func $retain-release/scopeUnreachable (; 10 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/stub/__retain (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - if - unreachable - end ) - (func $retain-release/provideRefIndirect (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) - i32.const 1 - global.set $~lib/argc - i32.const 0 + (func $~lib/rt/stub/__retainRelease (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - call_indirect (type $FUNCSIG$vi) ) - (func $retain-release/receiveRefIndirect (; 12 ;) (type $FUNCSIG$vi) (param $0 i32) - i32.const 0 - global.set $~lib/argc - local.get $0 - call_indirect (type $FUNCSIG$i) - drop + (func $~lib/rt/stub/__release (; 42 ;) (type $FUNCSIG$vi) (param $0 i32) + nop ) - (func $start (; 13 ;) (type $FUNCSIG$v) - i32.const 64 - global.set $~lib/rt/index-stub/startOffset - global.get $~lib/rt/index-stub/startOffset - global.set $~lib/rt/index-stub/offset + (func $null (; 43 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/retain-release.ts b/tests/compiler/retain-release.ts index 0f4b8453..c5ad2e5b 100644 --- a/tests/compiler/retain-release.ts +++ b/tests/compiler/retain-release.ts @@ -1,5 +1,10 @@ class Ref {} +// FIXME: Comments are outdated due to various optimizations the compiler performs now. +// Instead, the tests that make sense should be moved to rc/XY + +var REF = new Ref(); + export function returnRef(): Ref { // Returning a reference must retain it because it could otherwise drop to @@ -7,7 +12,7 @@ export function returnRef(): Ref { // with RC=1 when this local becomes released at the end of the function. See // scope tests below. - return /* __retain( */ changetype(0) /* ) */; + return /* __retain( */ REF /* ) */; } export function receiveRef(): void { @@ -64,7 +69,7 @@ export function provideRef(): void { // for different reasons. It is likely that there are smart optimizations of // this case. - takeRef(changetype(0)); + takeRef(REF); } export function takeReturnRef(ref: Ref): Ref { @@ -85,7 +90,7 @@ export function provideReceiveRef(): void { // Combined case of providing and receiving a reference, with no additional // logic compared to the base cases above. - !/* TEMP = */ takeReturnRef(changetype(0)); + !/* TEMP = */ takeReturnRef(REF); // __release(TEMP) } @@ -107,17 +112,19 @@ export function assignGlobal(): void { // Assigning a reference to a global first retains it before releasing the // previously stored reference. - glo = /* __retainRelease( */ changetype(0) /* , glo) */; + glo = /* __retainRelease( */ REF /* , glo) */; } class Target { fld: Ref; } +var TARGET = new Target(); + export function assignField(): void { // Similar to the assignGlobal case, assigning a reference to a field first // retains it before releasing the previously stored reference. - changetype(0).fld = /* __retainRelease( */ changetype(0) /* , fld) */; + TARGET.fld = /* __retainRelease( */ REF /* , fld) */; } export function scopeBlock(): void { @@ -128,7 +135,7 @@ export function scopeBlock(): void { // releasing it even if the original reference is still in use. { - let $0 = /* __retain( */changetype(0) /* } */; + let $0 = /* __retain( */ REF /* } */; // __release($0) } } @@ -142,7 +149,7 @@ export function scopeBlockToUninitialized(): void { var $0: Ref; // uninitialized, so no AUTORELEASE yet { - let $1 = /* __retain( */ changetype(0) /* } */; + let $1 = /* __retain( */ REF /* } */; $0 = /* __retain( */ $1 /* ) */; // __release($1) } @@ -156,9 +163,9 @@ export function scopeBlockToInitialized(): void { // same reason of not prematurely dropping to RC=0 even though the original // reference is still in use. - var $0: Ref = /* __retain( */ changetype(0) /* ) */; + var $0: Ref = /* __retain( */ REF /* ) */; { - let $1 = /* __retain( */ changetype(0) /* } */; + let $1 = /* __retain( */ REF /* } */; $0 = /* __retainRelease( */ $1 /* , $0) */; // __release($1) } @@ -173,10 +180,10 @@ export function scopeBlockToConditional(cond: bool): void { var $0: Ref; if (cond) { - $0 = /* __retain( */ changetype(0) /* ) */; // now AUTORELEASE + $0 = /* __retain( */ REF /* ) */; // now AUTORELEASE } { - let $1 = /* __retain( */ changetype(0) /* } */; + let $1 = /* __retain( */ REF /* } */; $0 = /* __retainRelease( */ $1 /* , $0) */; // __release($1) } @@ -200,7 +207,7 @@ export function scopeTopLevelInitialized(): void { // which I'd prefer because it hints the user at a portion of code that might // contain other errors. - var $0: Ref = /* __retain( */ changetype(0) /* ) */; + var $0: Ref = /* __retain( */ REF /* ) */; // __release($0) } @@ -213,7 +220,7 @@ export function scopeTopLevelConditional(cond: bool): void { var $0: Ref; if (cond) { - $0 = /* __retain( */ changetype(0) /* ) */; // now AUTORELEASE + $0 = /* __retain( */ REF /* ) */; // now AUTORELEASE } // __release($0) } @@ -223,7 +230,7 @@ export function scopeIf(cond: bool): void { // Validates that `if` scopes behave like blocks. if (cond) { - let $0: Ref = /* __retain( */ changetype(0) /* ) */; + let $0: Ref = /* __retain( */ REF /* ) */; // __release($0) } } @@ -233,10 +240,10 @@ export function scopeIfElse(cond: bool): void { // Validates that `else` scopes behave like blocks. if (cond) { - let $0: Ref = /* __retain( */ changetype(0) /* ) */; + let $0: Ref = /* __retain( */ REF /* ) */; // __release($0) } else { - let $0: Ref = /* __retain( */ changetype(0) /* ) */; + let $0: Ref = /* __retain( */ REF /* ) */; // __release($0) } } @@ -246,7 +253,7 @@ export function scopeWhile(cond: bool): void { // Validates that `while` scopes behave like blocks. while (cond) { - let $0: Ref = /* __retain( */ changetype(0) /* ) */; + let $0: Ref = /* __retain( */ REF /* ) */; // __release($0) } } @@ -256,7 +263,7 @@ export function scopeDo(cond: bool): void { // Validates that `do` scopes behave like blocks. do { - let $0: Ref = /* __retain( */ changetype(0) /* ) */; + let $0: Ref = /* __retain( */ REF /* ) */; // __release($0) } while (cond); } @@ -266,7 +273,7 @@ export function scopeFor(cond: bool): void { // Validates that `for` scopes behave like blocks. for (; cond; ) { - let $0: Ref = /* __retain( */ changetype(0) /* ) */; + let $0: Ref = /* __retain( */ REF /* ) */; // __release($0) } } @@ -277,7 +284,7 @@ export function scopeBreak(cond: bool): void { // releases are performed afterwards. while (cond) { - let $0: Ref = /* __retain( */ changetype(0) /* ) */; + let $0: Ref = /* __retain( */ REF /* ) */; // __release($0) break; } @@ -289,7 +296,7 @@ export function scopeContinue(cond: bool): void { // releases are performed afterwards. while (cond) { - let $0: Ref = /* __retain( */ changetype(0) /* ) */; + let $0: Ref = /* __retain( */ REF /* ) */; // __release($0) continue; } @@ -301,7 +308,7 @@ export function scopeThrow(cond: bool): void { // releases are performed afterwards. while (cond) { - let $0: Ref = /* __retain( */ changetype(0) /* ) */; + let $0: Ref = /* __retain( */ REF /* ) */; // __release($0) throw new Error("error"); } @@ -315,7 +322,7 @@ export function scopeUnreachable(cond: bool): void { // instruction (i.e. after the program has crashed). while (cond) { - let $0: Ref = /* __retain( */ changetype(0) /* ) */; + let $0: Ref = /* __retain( */ REF /* ) */; // __release($0) unreachable(); } @@ -327,7 +334,7 @@ function scopeInline(): void { // Inlined function bodies should behave like normal scopes. - var $0 = /* __retain( */ changetype(0) /* ) */; + var $0 = /* __retain( */ REF /* ) */; // __release($0) } @@ -353,7 +360,7 @@ export function provideRefInline(): void { // The provideRef case but inline. Should do nothing to the arguments while // hosting the inlined retain and release. - takeRefInline(changetype(0)); + takeRefInline(REF); } // @ts-ignore: decorator @@ -362,7 +369,7 @@ function returnRefInline(): Ref { // The returnRef case but inline. - return /* __retain( */ changetype(0) /* ) */; + return /* __retain( */ REF /* ) */; } export function receiveRefInline(): void { @@ -389,7 +396,7 @@ export function provideRefIndirect(fn: (ref: Ref) => void): void { // An indirect call should behave just like a direct call, that is not insert // anything when providing a reference. - fn(changetype(0)); + fn(REF); } export function receiveRefIndirect(fn: () => Ref): void { diff --git a/tests/compiler/retain-release.untouched.wat b/tests/compiler/retain-release.untouched.wat index dd39de0b..82aea40b 100644 --- a/tests/compiler/retain-release.untouched.wat +++ b/tests/compiler/retain-release.untouched.wat @@ -1,20 +1,23 @@ (module - (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$v (func)) + (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00r\00e\00t\00a\00i\00n\00-\00r\00e\00l\00e\00a\00s\00e\00.\00t\00s\00") + (data (i32.const 8) "\n\00\00\00\01\00\00\00\10\00\00\00\n\00\00\00e\00r\00r\00o\00r\00") + (data (i32.const 40) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00r\00e\00t\00a\00i\00n\00-\00r\00e\00l\00e\00a\00s\00e\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) + (global $retain-release/REF (mut i32) (i32.const 0)) (global $retain-release/glo (mut i32) (i32.const 0)) - (global $~lib/rt/index-stub/startOffset (mut i32) (i32.const 0)) - (global $~lib/rt/index-stub/offset (mut i32) (i32.const 0)) + (global $retain-release/TARGET (mut i32) (i32.const 0)) (global $~lib/argc (mut i32) (i32.const 0)) - (global $~lib/builtins/HEAP_BASE i32 (i32.const 60)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 92)) (export "memory" (memory $0)) (export "returnRef" (func $retain-release/returnRef)) (export "receiveRef" (func $retain-release/receiveRef)) @@ -51,69 +54,418 @@ (export "receiveRefIndirect" (func $retain-release/receiveRefIndirect)) (export "receiveRefIndirectDrop" (func $retain-release/receiveRefIndirectDrop)) (start $start) - (func $~lib/rt/index-stub/__retain (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $retain-release/Ref#constructor (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 17 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end local.get $0 ) - (func $retain-release/returnRef (; 2 ;) (type $FUNCSIG$i) (result i32) + (func $retain-release/Target#constructor (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 18 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 i32.const 0 - call $~lib/rt/index-stub/__retain + i32.store + local.get $0 ) - (func $~lib/rt/index-stub/__release (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) - nop + (func $start:retain-release (; 3 ;) (type $FUNCSIG$v) + i32.const 0 + call $retain-release/Ref#constructor + global.set $retain-release/REF + i32.const 0 + call $retain-release/Target#constructor + global.set $retain-release/TARGET ) - (func $retain-release/receiveRef (; 4 ;) (type $FUNCSIG$v) + (func $retain-release/returnRef (; 4 ;) (type $FUNCSIG$i) (result i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + ) + (func $retain-release/receiveRef (; 5 ;) (type $FUNCSIG$v) (local $0 i32) call $retain-release/returnRef local.tee $0 i32.eqz drop local.get $0 - call $~lib/rt/index-stub/__release + call $~lib/rt/stub/__release ) - (func $retain-release/receiveRefDrop (; 5 ;) (type $FUNCSIG$v) + (func $retain-release/receiveRefDrop (; 6 ;) (type $FUNCSIG$v) call $retain-release/returnRef - call $~lib/rt/index-stub/__release + call $~lib/rt/stub/__release ) - (func $retain-release/receiveRefRetain (; 6 ;) (type $FUNCSIG$v) + (func $retain-release/receiveRefRetain (; 7 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 i32) call $retain-release/returnRef - local.tee $0 - call $~lib/rt/index-stub/__retain - local.set $1 + local.set $0 local.get $0 - call $~lib/rt/index-stub/__release - local.get $1 - call $~lib/rt/index-stub/__release + call $~lib/rt/stub/__release ) - (func $retain-release/takeRef (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $retain-release/takeRef (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 - call $~lib/rt/index-stub/__retain + call $~lib/rt/stub/__retain drop local.get $0 - call $~lib/rt/index-stub/__release + call $~lib/rt/stub/__release ) - (func $retain-release/provideRef (; 8 ;) (type $FUNCSIG$v) - i32.const 0 + (func $retain-release/provideRef (; 9 ;) (type $FUNCSIG$v) + global.get $retain-release/REF call $retain-release/takeRef ) - (func $retain-release/takeReturnRef (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $retain-release/takeReturnRef (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/rt/index-stub/__retain + call $~lib/rt/stub/__retain drop local.get $0 ) - (func $retain-release/provideReceiveRef (; 10 ;) (type $FUNCSIG$v) + (func $retain-release/provideReceiveRef (; 11 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + global.get $retain-release/REF call $retain-release/takeReturnRef local.tee $0 i32.eqz drop local.get $0 - call $~lib/rt/index-stub/__release + call $~lib/rt/stub/__release ) - (func $~lib/rt/index-stub/__alloc (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $retain-release/newRef (; 12 ;) (type $FUNCSIG$v) + i32.const 0 + call $retain-release/Ref#constructor + call $~lib/rt/stub/__release + ) + (func $retain-release/assignGlobal (; 13 ;) (type $FUNCSIG$v) + global.get $retain-release/REF + global.get $retain-release/glo + call $~lib/rt/stub/__retainRelease + global.set $retain-release/glo + ) + (func $retain-release/assignField (; 14 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/TARGET + local.tee $0 + global.get $retain-release/REF + local.get $0 + i32.load + call $~lib/rt/stub/__retainRelease + i32.store + ) + (func $retain-release/scopeBlock (; 15 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeBlockToUninitialized (; 16 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + local.set $0 + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + local.get $0 + call $~lib/rt/stub/__retainRelease + local.set $0 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeBlockToInitialized (; 17 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + local.get $0 + call $~lib/rt/stub/__retainRelease + local.set $0 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeBlockToConditional (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + i32.const 0 + local.set $1 + local.get $0 + if + global.get $retain-release/REF + local.get $1 + call $~lib/rt/stub/__retainRelease + local.set $1 + end + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/stub/__retainRelease + local.set $1 + local.get $2 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeTopLevelUninitialized (; 19 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeTopLevelInitialized (; 20 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeTopLevelConditional (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + i32.const 0 + local.set $1 + local.get $0 + if + global.get $retain-release/REF + local.get $1 + call $~lib/rt/stub/__retainRelease + local.set $1 + end + local.get $1 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeIf (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + end + ) + (func $retain-release/scopeIfElse (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + else + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + end + ) + (func $retain-release/scopeWhile (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + br $continue|0 + end + end + ) + (func $retain-release/scopeDo (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + block + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + end + local.get $0 + br_if $continue|0 + end + ) + (func $retain-release/scopeFor (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + block $break|0 + loop $repeat|0 + local.get $0 + i32.eqz + br_if $break|0 + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $retain-release/scopeBreak (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + block $break|0 + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + br $break|0 + end + end + end + ) + (func $retain-release/scopeContinue (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + br $continue|0 + end + end + ) + (func $retain-release/scopeThrow (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + block + i32.const 24 + i32.const 56 + i32.const 310 + i32.const 4 + call $~lib/builtins/abort + unreachable + unreachable + end + unreachable + end + end + ) + (func $retain-release/scopeUnreachable (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + unreachable + local.get $1 + call $~lib/rt/stub/__release + br $continue|0 + end + end + ) + (func $retain-release/callInline (; 31 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/provideRefInline (; 32 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/receiveRefInline (; 33 ;) (type $FUNCSIG$v) + (local $0 i32) + block $retain-release/returnRefInline|inlined.0 (result i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + end + local.tee $0 + i32.eqz + drop + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/receiveRefInlineDrop (; 34 ;) (type $FUNCSIG$v) + block $retain-release/returnRefInline|inlined.1 (result i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + end + call $~lib/rt/stub/__release + ) + (func $retain-release/provideRefIndirect (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 1 + global.set $~lib/argc + global.get $retain-release/REF + local.get $0 + call_indirect (type $FUNCSIG$vi) + ) + (func $retain-release/receiveRefIndirect (; 36 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + block (result i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + call_indirect (type $FUNCSIG$i) + local.tee $1 + end + i32.eqz + drop + local.get $1 + call $~lib/rt/stub/__release + ) + (func $retain-release/receiveRefIndirectDrop (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + call_indirect (type $FUNCSIG$i) + call $~lib/rt/stub/__release + ) + (func $start (; 38 ;) (type $FUNCSIG$v) + call $start:retain-release + ) + (func $~lib/rt/stub/__alloc (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -127,7 +479,7 @@ if unreachable end - global.get $~lib/rt/index-stub/offset + global.get $~lib/rt/stub/offset i32.const 16 i32.add local.set $2 @@ -192,7 +544,7 @@ end end local.get $5 - global.set $~lib/rt/index-stub/offset + global.set $~lib/rt/stub/offset local.get $2 i32.const 16 i32.sub @@ -205,346 +557,15 @@ i32.store offset=12 local.get $2 ) - (func $retain-release/Ref#constructor (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 0 - i32.const 17 - call $~lib/rt/index-stub/__alloc - local.set $0 - end + (func $~lib/rt/stub/__retain (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 ) - (func $retain-release/newRef (; 13 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 0 - call $retain-release/Ref#constructor - local.tee $0 - drop - local.get $0 - call $~lib/rt/index-stub/__release - ) - (func $~lib/rt/index-stub/__retainRelease (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/stub/__retainRelease (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 ) - (func $retain-release/assignGlobal (; 15 ;) (type $FUNCSIG$v) - i32.const 0 - global.get $retain-release/glo - call $~lib/rt/index-stub/__retainRelease - global.set $retain-release/glo - ) - (func $retain-release/assignField (; 16 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 0 - local.tee $0 - i32.const 0 - local.get $0 - i32.load - call $~lib/rt/index-stub/__retainRelease - i32.store - ) - (func $retain-release/scopeBlock (; 17 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $0 - local.get $0 - call $~lib/rt/index-stub/__release - ) - (func $retain-release/scopeBlockToUninitialized (; 18 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - local.get $1 - call $~lib/rt/index-stub/__retain - local.set $0 - local.get $1 - call $~lib/rt/index-stub/__release - local.get $0 - call $~lib/rt/index-stub/__release - ) - (func $retain-release/scopeBlockToInitialized (; 19 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $0 - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - local.get $1 - local.get $0 - call $~lib/rt/index-stub/__retainRelease - local.set $0 - local.get $1 - call $~lib/rt/index-stub/__release - local.get $0 - call $~lib/rt/index-stub/__release - ) - (func $retain-release/scopeBlockToConditional (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - if - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - end - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $2 - local.get $2 - local.get $1 - call $~lib/rt/index-stub/__retainRelease - local.set $1 - local.get $2 - call $~lib/rt/index-stub/__release - local.get $1 - call $~lib/rt/index-stub/__release - ) - (func $retain-release/scopeTopLevelUninitialized (; 21 ;) (type $FUNCSIG$v) - (local $0 i32) + (func $~lib/rt/stub/__release (; 42 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $retain-release/scopeTopLevelInitialized (; 22 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $0 - local.get $0 - call $~lib/rt/index-stub/__release - ) - (func $retain-release/scopeTopLevelConditional (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - local.get $0 - if - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - end - local.get $1 - call $~lib/rt/index-stub/__release - ) - (func $retain-release/scopeIf (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - local.get $0 - if - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - local.get $1 - call $~lib/rt/index-stub/__release - end - ) - (func $retain-release/scopeIfElse (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - local.get $0 - if - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - local.get $1 - call $~lib/rt/index-stub/__release - else - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - local.get $1 - call $~lib/rt/index-stub/__release - end - ) - (func $retain-release/scopeWhile (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - loop $continue|0 - local.get $0 - if - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - local.get $1 - call $~lib/rt/index-stub/__release - br $continue|0 - end - end - ) - (func $retain-release/scopeDo (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - loop $continue|0 - block - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - local.get $1 - call $~lib/rt/index-stub/__release - end - local.get $0 - br_if $continue|0 - end - ) - (func $retain-release/scopeFor (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - block $break|0 - loop $repeat|0 - local.get $0 - i32.eqz - br_if $break|0 - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - local.get $1 - call $~lib/rt/index-stub/__release - br $repeat|0 - unreachable - end - unreachable - end - ) - (func $retain-release/scopeBreak (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - block $break|0 - loop $continue|0 - local.get $0 - if - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - local.get $1 - call $~lib/rt/index-stub/__release - br $break|0 - end - end - end - ) - (func $retain-release/scopeContinue (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - loop $continue|0 - local.get $0 - if - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - local.get $1 - call $~lib/rt/index-stub/__release - br $continue|0 - end - end - ) - (func $retain-release/scopeThrow (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - loop $continue|0 - local.get $0 - if - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - local.get $1 - call $~lib/rt/index-stub/__release - block - i32.const 0 - i32.const 24 - i32.const 306 - i32.const 4 - call $~lib/builtins/abort - unreachable - unreachable - end - unreachable - end - end - ) - (func $retain-release/scopeUnreachable (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - loop $continue|0 - local.get $0 - if - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $1 - unreachable - local.get $1 - call $~lib/rt/index-stub/__release - br $continue|0 - end - end - ) - (func $retain-release/callInline (; 33 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $0 - local.get $0 - call $~lib/rt/index-stub/__release - ) - (func $retain-release/provideRefInline (; 34 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 0 - call $~lib/rt/index-stub/__retain - local.set $0 - local.get $0 - call $~lib/rt/index-stub/__release - ) - (func $retain-release/receiveRefInline (; 35 ;) (type $FUNCSIG$v) - (local $0 i32) - block $retain-release/returnRefInline|inlined.0 (result i32) - i32.const 0 - call $~lib/rt/index-stub/__retain - end - local.tee $0 - i32.eqz - drop - local.get $0 - call $~lib/rt/index-stub/__release - ) - (func $retain-release/receiveRefInlineDrop (; 36 ;) (type $FUNCSIG$v) - block $retain-release/returnRefInline|inlined.1 (result i32) - i32.const 0 - call $~lib/rt/index-stub/__retain - end - call $~lib/rt/index-stub/__release - ) - (func $retain-release/provideRefIndirect (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) - i32.const 1 - global.set $~lib/argc - i32.const 0 - local.get $0 - call_indirect (type $FUNCSIG$vi) - ) - (func $retain-release/receiveRefIndirect (; 38 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - block (result i32) - i32.const 0 - global.set $~lib/argc - local.get $0 - call_indirect (type $FUNCSIG$i) - local.tee $1 - end - i32.eqz - drop - local.get $1 - call $~lib/rt/index-stub/__release - ) - (func $retain-release/receiveRefIndirectDrop (; 39 ;) (type $FUNCSIG$vi) (param $0 i32) - i32.const 0 - global.set $~lib/argc - local.get $0 - call_indirect (type $FUNCSIG$i) - call $~lib/rt/index-stub/__release - ) - (func $start (; 40 ;) (type $FUNCSIG$v) - global.get $~lib/builtins/HEAP_BASE - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - global.set $~lib/rt/index-stub/startOffset - global.get $~lib/rt/index-stub/startOffset - global.set $~lib/rt/index-stub/offset - ) - (func $null (; 41 ;) (type $FUNCSIG$v) + (func $null (; 43 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/runtime-full.optimized.wat b/tests/compiler/runtime-full.optimized.wat index 77069b64..cf7afd43 100644 --- a/tests/compiler/runtime-full.optimized.wat +++ b/tests/compiler/runtime-full.optimized.wat @@ -9,13 +9,20 @@ (type $FUNCSIG$vi (func (param i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\1e\00\00\00\00\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") - (data (i32.const 56) "\"\00\00\00\00\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s") - (data (i32.const 112) "\10\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08") + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 112) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 168) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 224) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 280) "\10\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 280)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 416)) (export "memory" (memory $0)) (export "__alloc" (func $~lib/rt/tlsf/__alloc)) (export "__realloc" (func $~lib/rt/tlsf/__realloc)) @@ -30,9 +37,16 @@ (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) local.get $1 i32.load - local.tee $3 + local.set $2 + local.get $2 i32.const 1 i32.and i32.eqz @@ -44,14 +58,17 @@ call $~lib/builtins/abort unreachable end - local.get $3 - i32.const -4 + local.get $2 + i32.const 3 + i32.const -1 + i32.xor i32.and - local.tee $2 + local.set $3 + local.get $3 i32.const 16 i32.ge_u if (result i32) - local.get $2 + local.get $3 i32.const 1073741808 i32.lt_u else @@ -66,37 +83,44 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $3 i32.const 256 i32.lt_u - if (result i32) - local.get $2 + if + i32.const 0 + local.set $4 + local.get $3 i32.const 4 i32.shr_u - local.set $2 - i32.const 0 + local.set $5 else - local.get $2 i32.const 31 - local.get $2 + local.get $3 i32.clz i32.sub - local.tee $3 + local.set $4 + local.get $3 + local.get $4 i32.const 4 i32.sub i32.shr_u - i32.const 16 + i32.const 1 + i32.const 4 + i32.shl i32.xor - local.set $2 - local.get $3 - i32.const 7 + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 i32.sub + i32.sub + local.set $4 end - local.tee $3 + local.get $4 i32.const 23 i32.lt_u if (result i32) - local.get $2 + local.get $5 i32.const 16 i32.lt_u else @@ -112,76 +136,111 @@ unreachable end local.get $1 - i32.load offset=20 - local.set $4 - local.get $1 i32.load offset=16 - local.tee $5 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 if - local.get $5 - local.get $4 + local.get $6 + local.get $7 i32.store offset=20 end - local.get $4 + local.get $7 if - local.get $4 - local.get $5 + local.get $7 + local.get $6 i32.store offset=16 end - local.get $3 - i32.const 4 - i32.shl - local.get $2 - i32.add - i32.const 2 - i32.shl - local.get $0 - i32.add - i32.load offset=96 local.get $1 - i32.eq - if - local.get $3 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 i32.const 4 i32.shl - local.get $2 + local.get $8 i32.add i32.const 2 i32.shl - local.get $0 i32.add - local.get $4 - i32.store offset=96 - local.get $4 + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 i32.eqz if - local.get $3 - i32.const 2 - i32.shl - local.get $0 - i32.add - local.get $3 - i32.const 2 - i32.shl - local.get $0 - i32.add - i32.load offset=4 - i32.const 1 - local.get $2 - i32.shl - i32.const -1 - i32.xor - i32.and - local.tee $1 - i32.store offset=4 - local.get $1 + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 i32.eqz if local.get $0 local.get $0 i32.load i32.const 1 - local.get $3 + local.get $4 i32.shl i32.const -1 i32.xor @@ -198,6 +257,12 @@ (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) local.get $1 i32.eqz if @@ -210,7 +275,8 @@ end local.get $1 i32.load - local.tee $3 + local.set $2 + local.get $2 i32.const 1 i32.and i32.eqz @@ -222,30 +288,43 @@ call $~lib/builtins/abort unreachable end - local.get $1 - i32.const 16 - i32.add - local.get $1 + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 i32.load - i32.const -4 - i32.and - i32.add - local.tee $4 - i32.load - local.tee $5 + local.set $5 + local.get $5 i32.const 1 i32.and if - local.get $3 - i32.const -4 + local.get $2 + i32.const 3 + i32.const -1 + i32.xor i32.and i32.const 16 i32.add local.get $5 - i32.const -4 + i32.const 3 + i32.const -1 + i32.xor i32.and i32.add - local.tee $2 + local.set $3 + local.get $3 i32.const 1073741808 i32.lt_u if @@ -253,37 +332,50 @@ local.get $4 call $~lib/rt/tlsf/removeBlock local.get $1 - local.get $3 + local.get $2 i32.const 3 i32.and - local.get $2 + local.get $3 i32.or - local.tee $3 + local.tee $2 i32.store - local.get $1 - i32.const 16 - i32.add - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.tee $4 + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 i32.load local.set $5 end end - local.get $3 + local.get $2 i32.const 2 i32.and if - local.get $1 - i32.const 4 - i32.sub + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 i32.load - local.tee $2 - i32.load - local.tee $6 + local.set $6 + local.get $6 i32.const 1 i32.and i32.eqz @@ -296,48 +388,54 @@ unreachable end local.get $6 - i32.const -4 + i32.const 3 + i32.const -1 + i32.xor i32.and i32.const 16 i32.add - local.get $3 - i32.const -4 + local.get $2 + i32.const 3 + i32.const -1 + i32.xor i32.and i32.add - local.tee $7 + local.set $7 + local.get $7 i32.const 1073741808 i32.lt_u - if (result i32) + if local.get $0 - local.get $2 + local.get $3 call $~lib/rt/tlsf/removeBlock - local.get $2 + local.get $3 local.get $6 i32.const 3 i32.and local.get $7 i32.or - local.tee $3 + local.tee $2 i32.store - local.get $2 - else - local.get $1 + local.get $3 + local.set $1 end - local.set $1 end local.get $4 local.get $5 i32.const 2 i32.or i32.store - local.get $3 - i32.const -4 + local.get $2 + i32.const 3 + i32.const -1 + i32.xor i32.and - local.tee $2 + local.set $8 + local.get $8 i32.const 16 i32.ge_u if (result i32) - local.get $2 + local.get $8 i32.const 1073741808 i32.lt_u else @@ -352,13 +450,14 @@ call $~lib/builtins/abort unreachable end - local.get $4 local.get $1 i32.const 16 i32.add - local.get $2 + local.get $8 i32.add - i32.ne + local.get $4 + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -372,37 +471,44 @@ i32.sub local.get $1 i32.store - local.get $2 + local.get $8 i32.const 256 i32.lt_u - if (result i32) - local.get $2 + if + i32.const 0 + local.set $9 + local.get $8 i32.const 4 i32.shr_u - local.set $4 - i32.const 0 + local.set $10 else - local.get $2 i32.const 31 - local.get $2 + local.get $8 i32.clz i32.sub - local.tee $2 + local.set $9 + local.get $8 + local.get $9 i32.const 4 i32.sub i32.shr_u - i32.const 16 + i32.const 1 + i32.const 4 + i32.shl i32.xor - local.set $4 - local.get $2 - i32.const 7 + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 i32.sub + i32.sub + local.set $9 end - local.tee $3 + local.get $9 i32.const 23 i32.lt_u if (result i32) - local.get $4 + local.get $10 i32.const 16 i32.lt_u else @@ -417,83 +523,124 @@ call $~lib/builtins/abort unreachable end - local.get $3 - i32.const 4 - i32.shl - local.get $4 - i32.add - i32.const 2 - i32.shl - local.get $0 - i32.add - i32.load offset=96 - local.set $2 + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 local.get $1 i32.const 0 i32.store offset=16 local.get $1 - local.get $2 + local.get $11 i32.store offset=20 - local.get $2 + local.get $11 if - local.get $2 + local.get $11 local.get $1 i32.store offset=16 end - local.get $3 - i32.const 4 - i32.shl - local.get $4 - i32.add - i32.const 2 - i32.shl - local.get $0 - i32.add - local.get $1 - i32.store offset=96 + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end local.get $0 local.get $0 i32.load i32.const 1 - local.get $3 + local.get $9 i32.shl i32.or i32.store - local.get $3 - i32.const 2 - i32.shl - local.get $0 - i32.add - local.get $3 - i32.const 2 - i32.shl - local.get $0 - i32.add - i32.load offset=4 - i32.const 1 - local.get $4 - i32.shl - i32.or - i32.store offset=4 + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end ) - (func $~lib/rt/tlsf/addMemory (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (; 3 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - local.get $2 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $1 - i32.const 15 - i32.and - i32.eqz - i32.const 0 + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) local.get $1 local.get $2 i32.le_u - select - select + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end i32.eqz if i32.const 0 @@ -503,15 +650,23 @@ call $~lib/builtins/abort unreachable end - local.get $0 - i32.load offset=1568 - local.tee $3 + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 if local.get $1 - local.get $3 + local.get $4 i32.const 16 i32.add - i32.lt_u + i32.ge_u + i32.eqz if i32.const 0 i32.const 24 @@ -523,23 +678,26 @@ local.get $1 i32.const 16 i32.sub - local.get $3 + local.get $4 i32.eq if - local.get $3 - i32.load - local.set $4 local.get $1 i32.const 16 i32.sub local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop end else local.get $1 local.get $0 i32.const 1572 i32.add - i32.lt_u + i32.ge_u + i32.eqz if i32.const 0 i32.const 24 @@ -552,54 +710,101 @@ local.get $2 local.get $1 i32.sub - local.tee $2 + local.set $6 + local.get $6 i32.const 48 i32.lt_u if + i32.const 0 return end - local.get $1 - local.get $4 + local.get $6 i32.const 2 - i32.and - local.get $2 - i32.const 32 + i32.const 16 + i32.mul i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 i32.const 1 i32.or + local.get $5 + i32.const 2 + i32.and i32.or i32.store - local.get $1 + local.get $8 i32.const 0 i32.store offset=16 - local.get $1 + local.get $8 i32.const 0 i32.store offset=20 local.get $1 - local.get $2 + local.get $6 i32.add i32.const 16 i32.sub - local.tee $2 + local.set $4 + local.get $4 + i32.const 0 i32.const 2 + i32.or i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end local.get $0 - local.get $2 - i32.store offset=1568 - local.get $0 - local.get $1 + local.get $8 call $~lib/rt/tlsf/insertBlock + i32.const 1 ) (func $~lib/rt/tlsf/initializeRoot (; 4 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - i32.const 1 + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 current_memory - local.tee $0 + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 i32.gt_s if (result i32) - i32.const 1 - local.get $0 + local.get $2 + local.get $1 i32.sub grow_memory i32.const 0 @@ -610,75 +815,118 @@ if unreachable end - i32.const 256 + local.get $0 + local.set $3 + local.get $3 i32.const 0 i32.store - i32.const 1824 - i32.const 0 - i32.store - i32.const 0 - local.set $0 - loop $repeat|0 - block $break|0 - local.get $0 + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 i32.const 23 - i32.ge_u + i32.lt_u + i32.eqz br_if $break|0 - local.get $0 - i32.const 2 - i32.shl - i32.const 256 - i32.add - i32.const 0 - i32.store offset=4 - i32.const 0 - local.set $1 - loop $repeat|1 - block $break|1 - local.get $1 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 i32.const 16 - i32.ge_u + i32.lt_u + i32.eqz br_if $break|1 - local.get $0 - i32.const 4 - i32.shl - local.get $1 - i32.add - i32.const 2 - i32.shl - i32.const 256 - i32.add - i32.const 0 - i32.store offset=96 - local.get $1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 i32.const 1 i32.add - local.set $1 + local.set $5 br $repeat|1 + unreachable end + unreachable end - local.get $0 + local.get $4 i32.const 1 i32.add - local.set $0 + local.set $4 br $repeat|0 + unreachable end + unreachable end - i32.const 256 - i32.const 1840 + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and current_memory i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - i32.const 256 + drop + local.get $3 global.set $~lib/rt/tlsf/ROOT ) (func $~lib/rt/tlsf/prepareSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) local.get $0 i32.const 1073741808 i32.ge_u if - i32.const 0 + i32.const 72 i32.const 24 i32.const 446 i32.const 29 @@ -688,64 +936,83 @@ local.get $0 i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and - local.tee $0 - i32.const 16 - local.get $0 + local.tee $1 i32.const 16 + local.tee $2 + local.get $1 + local.get $2 i32.gt_u select ) (func $~lib/rt/tlsf/searchBlock (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) local.get $1 i32.const 256 i32.lt_u - if (result i32) + if + i32.const 0 + local.set $2 local.get $1 i32.const 4 i32.shr_u - local.set $1 - i32.const 0 + local.set $3 else local.get $1 i32.const 536870904 i32.lt_u - if + if (result i32) + local.get $1 i32.const 1 i32.const 27 local.get $1 i32.clz i32.sub i32.shl - local.get $1 i32.add i32.const 1 i32.sub - local.set $1 + else + local.get $1 end - local.get $1 + local.set $4 i32.const 31 - local.get $1 + local.get $4 i32.clz i32.sub - local.tee $2 + local.set $2 + local.get $4 + local.get $2 i32.const 4 i32.sub i32.shr_u - i32.const 16 + i32.const 1 + i32.const 4 + i32.shl i32.xor - local.set $1 + local.set $3 local.get $2 - i32.const 7 + i32.const 8 + i32.const 1 i32.sub + i32.sub + local.set $2 end - local.tee $2 + local.get $2 i32.const 23 i32.lt_u if (result i32) - local.get $1 + local.get $3 i32.const 16 i32.lt_u else @@ -760,49 +1027,62 @@ call $~lib/builtins/abort unreachable end - local.get $2 - i32.const 2 - i32.shl - local.get $0 - i32.add - i32.load offset=4 - i32.const -1 - local.get $1 - i32.shl - i32.and - local.tee $1 - if (result i32) - local.get $1 - i32.ctz + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 local.get $2 - i32.const 4 - i32.shl - i32.add + local.set $4 + local.get $5 + local.get $4 i32.const 2 i32.shl - local.get $0 i32.add - i32.load offset=96 - else + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if local.get $0 i32.load + i32.const 0 i32.const -1 + i32.xor local.get $2 i32.const 1 i32.add i32.shl i32.and - local.tee $1 - if (result i32) - local.get $1 + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 i32.ctz - local.tee $1 - i32.const 2 - i32.shl - local.get $0 - i32.add - i32.load offset=4 - local.tee $2 + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 i32.eqz if i32.const 0 @@ -812,43 +1092,85 @@ call $~lib/builtins/abort unreachable end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 local.get $2 + local.set $5 + local.get $6 i32.ctz - local.get $1 + local.set $4 + local.get $8 + local.get $5 i32.const 4 i32.shl + local.get $4 i32.add i32.const 2 i32.shl - local.get $0 i32.add i32.load offset=96 - else - i32.const 0 end + local.set $7 end + local.get $7 ) (func $~lib/rt/tlsf/growMemory (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) current_memory - local.tee $2 + local.set $2 local.get $1 i32.const 65535 i32.add - i32.const -65536 + i32.const 65535 + i32.const -1 + i32.xor i32.and i32.const 16 i32.shr_u - local.tee $1 + local.set $3 local.get $2 - local.get $1 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select + local.set $6 + local.get $6 grow_memory i32.const 0 i32.lt_s if - local.get $1 + local.get $3 grow_memory i32.const 0 i32.lt_s @@ -856,24 +1178,30 @@ unreachable end end + current_memory + local.set $7 local.get $0 local.get $2 i32.const 16 i32.shl - current_memory + local.get $7 i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory + drop ) (func $~lib/rt/tlsf/prepareBlock (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) local.get $1 i32.load local.set $3 local.get $2 i32.const 15 i32.and + i32.eqz + i32.eqz if i32.const 0 i32.const 24 @@ -883,19 +1211,22 @@ unreachable end local.get $3 - i32.const -4 + i32.const 3 + i32.const -1 + i32.xor i32.and local.get $2 i32.sub - local.tee $4 + local.set $4 + local.get $4 i32.const 32 i32.ge_u if local.get $1 + local.get $2 local.get $3 i32.const 2 i32.and - local.get $2 i32.or i32.store local.get $1 @@ -903,7 +1234,8 @@ i32.add local.get $2 i32.add - local.tee $1 + local.set $5 + local.get $5 local.get $4 i32.const 16 i32.sub @@ -911,32 +1243,48 @@ i32.or i32.store local.get $0 - local.get $1 + local.get $5 call $~lib/rt/tlsf/insertBlock else local.get $1 local.get $3 - i32.const -2 + i32.const 1 + i32.const -1 + i32.xor i32.and i32.store - local.get $1 - i32.const 16 - i32.add - local.get $1 + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end i32.load - i32.const -4 - i32.and - i32.add - local.get $1 - i32.const 16 - i32.add - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - i32.load - i32.const -3 + i32.const 2 + i32.const -1 + i32.xor i32.and i32.store end @@ -944,21 +1292,24 @@ (func $~lib/rt/tlsf/allocateBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - local.get $0 local.get $1 call $~lib/rt/tlsf/prepareSize - local.tee $3 + local.set $2 + local.get $0 + local.get $2 call $~lib/rt/tlsf/searchBlock - local.tee $2 + local.set $3 + local.get $3 i32.eqz if local.get $0 - local.get $3 + local.get $2 call $~lib/rt/tlsf/growMemory local.get $0 - local.get $3 + local.get $2 call $~lib/rt/tlsf/searchBlock - local.tee $2 + local.set $3 + local.get $3 i32.eqz if i32.const 0 @@ -969,12 +1320,15 @@ unreachable end end - local.get $2 - i32.load - i32.const -4 - i32.and local.get $3 - i32.lt_u + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz if i32.const 0 i32.const 24 @@ -983,206 +1337,245 @@ call $~lib/builtins/abort unreachable end - local.get $2 - i32.const 1 + local.get $3 + i32.const 0 i32.store offset=4 - local.get $2 + local.get $3 local.get $1 i32.store offset=12 local.get $0 - local.get $2 + local.get $3 call $~lib/rt/tlsf/removeBlock local.get $0 - local.get $2 local.get $3 - call $~lib/rt/tlsf/prepareBlock local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 ) (func $~lib/rt/tlsf/__alloc (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) global.get $~lib/rt/tlsf/ROOT - local.tee $2 - if (result i32) - local.get $2 - else + local.set $2 + local.get $2 + i32.eqz + if call $~lib/rt/tlsf/initializeRoot global.get $~lib/rt/tlsf/ROOT + local.set $2 end + local.get $2 local.get $0 call $~lib/rt/tlsf/allocateBlock - local.tee $0 + local.set $3 + local.get $3 local.get $1 i32.store offset=8 - local.get $0 + local.get $3 i32.const 16 i32.add ) (func $~lib/memory/memory.copy (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) block $~lib/util/memory/memmove|inlined.0 local.get $0 + local.set $5 local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 i32.eq - br_if $~lib/util/memory/memmove|inlined.0 - local.get $0 - local.get $1 + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 i32.lt_u if - local.get $1 + local.get $4 i32.const 7 i32.and - local.get $0 + local.get $5 i32.const 7 i32.and i32.eq if - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - br_if $~lib/util/memory/memmove|inlined.0 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - br $continue|0 + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end end end - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 + block $break|1 + loop $continue|1 + local.get $3 i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - br $continue|1 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end end end end - loop $continue|2 - local.get $2 - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 + block $break|2 + loop $continue|2 local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|2 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end end end else - local.get $1 + local.get $4 i32.const 7 i32.and - local.get $0 + local.get $5 i32.const 7 i32.and i32.eq if - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - br_if $~lib/util/memory/memmove|inlined.0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|3 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end end end - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $2 + block $break|4 + loop $continue|4 + local.get $3 i32.const 8 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - br $continue|4 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end end end end - loop $continue|5 - local.get $2 - if - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end end end end @@ -1193,14 +1586,19 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $2 call $~lib/rt/tlsf/prepareSize local.set $3 local.get $1 i32.load - local.tee $4 + local.set $4 + local.get $4 i32.const 1 i32.and + i32.eqz + i32.eqz if i32.const 0 i32.const 24 @@ -1225,30 +1623,43 @@ local.get $1 return end - local.get $1 - i32.const 16 - i32.add - local.get $1 + block $~lib/rt/tlsf/GETRIGHT|inlined.4 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $6 + local.get $6 i32.load - i32.const -4 - i32.and - i32.add - local.tee $6 - i32.load - local.tee $5 + local.set $7 + local.get $7 i32.const 1 i32.and if local.get $4 - i32.const -4 + i32.const 3 + i32.const -1 + i32.xor i32.and i32.const 16 i32.add - local.get $5 - i32.const -4 + local.get $7 + i32.const 3 + i32.const -1 + i32.xor i32.and i32.add - local.tee $5 + local.set $5 + local.get $5 local.get $3 i32.ge_u if @@ -1276,15 +1687,16 @@ local.get $0 local.get $2 call $~lib/rt/tlsf/allocateBlock - local.tee $3 + local.set $8 + local.get $8 local.get $1 i32.load offset=4 i32.store offset=4 - local.get $3 + local.get $8 local.get $1 i32.load offset=8 i32.store offset=8 - local.get $3 + local.get $8 i32.const 16 i32.add local.get $1 @@ -1300,7 +1712,7 @@ local.get $0 local.get $1 call $~lib/rt/tlsf/insertBlock - local.get $3 + local.get $8 ) (func $~lib/rt/tlsf/__realloc (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) global.get $~lib/rt/tlsf/ROOT @@ -1308,23 +1720,27 @@ if i32.const 0 i32.const 24 - i32.const 550 + i32.const 552 i32.const 13 call $~lib/builtins/abort unreachable end local.get $0 - i32.const 15 - i32.and - i32.eqz i32.const 0 - local.get $0 - select + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end i32.eqz if i32.const 0 i32.const 24 - i32.const 551 + i32.const 553 i32.const 2 call $~lib/builtins/abort unreachable @@ -1342,13 +1758,16 @@ (local $2 i32) local.get $1 i32.load - local.tee $2 + local.set $2 + local.get $2 i32.const 1 i32.and + i32.eqz + i32.eqz if i32.const 0 i32.const 24 - i32.const 529 + i32.const 530 i32.const 2 call $~lib/builtins/abort unreachable @@ -1368,23 +1787,27 @@ if i32.const 0 i32.const 24 - i32.const 558 + i32.const 560 i32.const 13 call $~lib/builtins/abort unreachable end local.get $0 - i32.const 15 - i32.and - i32.eqz i32.const 0 - local.get $0 - select + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end i32.eqz if i32.const 0 i32.const 24 - i32.const 559 + i32.const 561 i32.const 2 call $~lib/builtins/abort unreachable @@ -1399,18 +1822,24 @@ (local $1 i32) local.get $0 i32.load offset=4 - local.tee $1 - i32.const -268435456 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor i32.and local.get $1 i32.const 1 i32.add - i32.const -268435456 + i32.const 268435455 + i32.const -1 + i32.xor i32.and - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 72 + i32.const 128 i32.const 103 i32.const 2 call $~lib/builtins/abort @@ -1421,10 +1850,24 @@ i32.const 1 i32.add i32.store offset=4 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end ) (func $~lib/rt/purerc/__retain (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 248 + global.get $~lib/builtins/HEAP_BASE i32.gt_u if local.get $0 @@ -1435,66 +1878,84 @@ local.get $0 ) (func $~lib/rt/common/__typeinfo (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 local.get $0 + i32.eqz if (result i32) + i32.const 1 + else local.get $0 - i32.const 112 + local.get $1 i32.load i32.gt_u - else - i32.const 1 end - if (result i32) + if + i32.const 184 + i32.const 240 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 3 - i32.shl - i32.const 112 - i32.add - i32.load end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load ) (func $~lib/rt/purerc/growRoots (; 19 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) - global.get $~lib/rt/purerc/CUR + (local $4 i32) + (local $5 i32) global.get $~lib/rt/purerc/ROOTS - local.tee $2 - i32.sub - local.tee $1 - i32.const 1 - i32.shl - local.tee $0 - i32.const 256 + local.set $0 + global.get $~lib/rt/purerc/CUR local.get $0 - i32.const 256 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select - local.tee $3 + local.set $4 + local.get $4 i32.const 0 call $~lib/rt/tlsf/__alloc - local.tee $0 - local.get $2 + local.set $5 + local.get $5 + local.get $0 local.get $1 call $~lib/memory/memory.copy - local.get $0 + local.get $5 global.set $~lib/rt/purerc/ROOTS - local.get $0 + local.get $5 local.get $1 i32.add global.set $~lib/rt/purerc/CUR - local.get $0 - local.get $3 + local.get $5 + local.get $4 i32.add global.set $~lib/rt/purerc/END ) (func $~lib/rt/purerc/appendRoot (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) global.get $~lib/rt/purerc/CUR - local.tee $1 + local.set $1 + local.get $1 global.get $~lib/rt/purerc/END i32.ge_u if @@ -1513,13 +1974,28 @@ (func $~lib/rt/purerc/decrement (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 i32) - (local $3 i32) local.get $0 i32.load offset=4 - local.tee $1 + local.set $1 + local.get $1 i32.const 268435455 i32.and - local.tee $2 + local.set $2 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 i32.const 1 i32.eq if @@ -1531,66 +2007,47 @@ local.get $1 i32.const -2147483648 i32.and + i32.eqz if - local.get $0 - i32.const -2147483648 - i32.store offset=4 - else global.get $~lib/rt/tlsf/ROOT local.get $0 call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 end else local.get $2 i32.const 0 - i32.le_u + i32.gt_u + i32.eqz if i32.const 0 - i32.const 72 - i32.const 119 + i32.const 128 + i32.const 123 i32.const 15 call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=8 - local.tee $3 - if (result i32) - local.get $3 - i32.const 112 - i32.load - i32.gt_u - else - i32.const 1 - end - if (result i32) - unreachable - else - local.get $3 - i32.const 3 - i32.shl - i32.const 112 - i32.add - i32.load - end + call $~lib/rt/common/__typeinfo i32.const 8 i32.and + i32.eqz if local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.get $1 - i32.const -268435456 - i32.and + i32.const -2147483648 + i32.const 805306368 i32.or - i32.store offset=4 - else - local.get $0 local.get $2 i32.const 1 i32.sub - i32.const -1342177280 i32.or i32.store offset=4 local.get $1 @@ -1601,12 +2058,24 @@ local.get $0 call $~lib/rt/purerc/appendRoot end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 end end ) (func $~lib/rt/purerc/__release (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 - i32.const 248 + global.get $~lib/builtins/HEAP_BASE i32.gt_u if local.get $0 @@ -1619,7 +2088,8 @@ (local $1 i32) local.get $0 i32.load offset=4 - local.tee $1 + local.set $1 + local.get $1 i32.const 1879048192 i32.and i32.const 268435456 @@ -1627,7 +2097,9 @@ if local.get $0 local.get $1 - i32.const -1879048193 + i32.const 1879048192 + i32.const -1 + i32.xor i32.and i32.const 268435456 i32.or @@ -1643,8 +2115,12 @@ local.get $0 local.get $0 i32.load offset=4 - i32.const -1879048193 + i32.const 1879048192 + i32.const -1 + i32.xor i32.and + i32.const 0 + i32.or i32.store offset=4 local.get $0 i32.const 16 @@ -1656,7 +2132,8 @@ (local $1 i32) local.get $0 i32.load offset=4 - local.tee $1 + local.set $1 + local.get $1 i32.const 1879048192 i32.and i32.const 268435456 @@ -1673,7 +2150,9 @@ else local.get $0 local.get $1 - i32.const -1879048193 + i32.const 1879048192 + i32.const -1 + i32.xor i32.and i32.const 536870912 i32.or @@ -1690,7 +2169,8 @@ (local $1 i32) local.get $0 i32.load offset=4 - local.tee $1 + local.set $1 + local.get $1 i32.const 1879048192 i32.and i32.const 536870912 @@ -1722,28 +2202,35 @@ (local $4 i32) (local $5 i32) global.get $~lib/rt/purerc/ROOTS - local.tee $5 - local.tee $2 - local.set $3 - global.get $~lib/rt/purerc/CUR local.set $0 - loop $repeat|0 - block $break|0 + local.get $0 + local.set $1 + block $break|0 + block + local.get $1 + local.set $2 + global.get $~lib/rt/purerc/CUR + local.set $3 + end + loop $repeat|0 + local.get $2 local.get $3 - local.get $0 - i32.ge_u + i32.lt_u + i32.eqz br_if $break|0 - local.get $3 + local.get $2 i32.load - local.tee $4 + local.set $4 + local.get $4 i32.load offset=4 - local.tee $1 + local.set $5 + local.get $5 i32.const 1879048192 i32.and i32.const 805306368 i32.eq if (result i32) - local.get $1 + local.get $5 i32.const 268435455 i32.and i32.const 0 @@ -1754,99 +2241,121 @@ if local.get $4 call $~lib/rt/purerc/markGray - local.get $2 + local.get $1 local.get $4 i32.store - local.get $2 + local.get $1 i32.const 4 i32.add - local.set $2 + local.set $1 else - i32.const 0 - local.get $1 - i32.const 268435455 - i32.and - i32.eqz - local.get $1 + local.get $5 i32.const 1879048192 i32.and - select + i32.const 0 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end if global.get $~lib/rt/tlsf/ROOT local.get $4 call $~lib/rt/tlsf/freeBlock else local.get $4 - local.get $1 - i32.const 2147483647 + local.get $5 + i32.const -2147483648 + i32.const -1 + i32.xor i32.and i32.store offset=4 end end - local.get $3 + local.get $2 i32.const 4 i32.add - local.set $3 + local.set $2 br $repeat|0 + unreachable end + unreachable end - local.get $2 + local.get $1 global.set $~lib/rt/purerc/CUR - local.get $5 - local.set $0 - loop $repeat|1 - block $break|1 - local.get $0 - local.get $2 - i32.ge_u + block $break|1 + local.get $0 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz br_if $break|1 - local.get $0 + local.get $5 i32.load call $~lib/rt/purerc/scan - local.get $0 + local.get $5 i32.const 4 i32.add - local.set $0 + local.set $5 br $repeat|1 + unreachable end + unreachable end - local.get $5 - local.set $0 - loop $repeat|2 - block $break|2 - local.get $0 - local.get $2 - i32.ge_u - br_if $break|2 - local.get $0 - i32.load - local.tee $1 + block $break|2 + local.get $0 + local.set $5 + loop $repeat|2 + local.get $5 local.get $1 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $5 + i32.load + local.set $4 + local.get $4 + local.get $4 i32.load offset=4 - i32.const 2147483647 + i32.const -2147483648 + i32.const -1 + i32.xor i32.and i32.store offset=4 - local.get $1 + local.get $4 call $~lib/rt/purerc/collectWhite - local.get $0 + local.get $5 i32.const 4 i32.add - local.set $0 + local.set $5 br $repeat|2 + unreachable end + unreachable end - local.get $5 + local.get $0 global.set $~lib/rt/purerc/CUR ) (func $~lib/rt/common/__instanceof (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) local.get $0 i32.const 16 i32.sub i32.load offset=8 - local.tee $0 + local.set $2 + global.get $~lib/builtins/RTTI_BASE + local.set $3 + local.get $2 if (result i32) - local.get $0 - i32.const 112 + local.get $2 + local.get $3 i32.load i32.le_u else @@ -1854,28 +2363,30 @@ end if loop $continue|0 - local.get $0 + local.get $2 local.get $1 i32.eq if i32.const 1 return end - local.get $0 - i32.const 3 - i32.shl - i32.const 112 + local.get $3 + local.get $2 + i32.const 8 + i32.mul i32.add i32.load offset=4 - local.tee $0 + local.tee $2 br_if $continue|0 end end i32.const 0 ) (func $~lib/rt/purerc/__visit (; 29 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) local.get $0 - i32.const 248 + global.get $~lib/builtins/HEAP_BASE i32.lt_u if return @@ -1883,178 +2394,205 @@ local.get $0 i32.const 16 i32.sub - local.set $0 + local.set $2 block $break|0 block $case5|0 block $case4|0 block $case3|0 block $case2|0 block $case1|0 - local.get $1 - i32.const 1 - i32.ne - if + block $case0|0 local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 i32.const 2 i32.eq br_if $case1|0 - block $tablify|0 - local.get $1 - i32.const 3 - i32.sub - br_table $case2|0 $case3|0 $case4|0 $tablify|0 - end + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 br $case5|0 end - local.get $0 - call $~lib/rt/purerc/decrement - br $break|0 - end - local.get $0 - i32.load offset=4 - i32.const 268435455 - i32.and - i32.const 0 - i32.le_u - if - i32.const 0 - i32.const 72 - i32.const 74 - i32.const 17 - call $~lib/builtins/abort + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end unreachable end - local.get $0 - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - i32.store offset=4 - local.get $0 - call $~lib/rt/purerc/markGray - br $break|0 + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable end - local.get $0 - call $~lib/rt/purerc/scan - br $break|0 - end - local.get $0 - i32.load offset=4 - local.tee $1 - i32.const -268435456 - i32.and - local.get $1 - i32.const 1 - i32.add - i32.const -268435456 - i32.and - i32.ne - if - i32.const 0 - i32.const 72 - i32.const 85 - i32.const 6 - call $~lib/builtins/abort unreachable end - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.store offset=4 - local.get $1 - i32.const 1879048192 - i32.and - if - local.get $0 - call $~lib/rt/purerc/scanBlack + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable end - br $break|0 + unreachable end - local.get $0 - call $~lib/rt/purerc/collectWhite - br $break|0 + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable end i32.const 0 - i32.const 72 - i32.const 96 - i32.const 24 - call $~lib/builtins/abort - unreachable + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end end ) (func $~lib/builtins/__visit_members (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - block $invalid - block $~lib/string/String - block $~lib/arraybuffer/ArrayBuffer - block $~lib/arraybuffer/ArrayBufferView - block $~lib/number/F64 - block $~lib/number/F32 - block $~lib/number/Bool - block $~lib/number/Usize - block $~lib/number/U64 - block $~lib/number/U32 - block $~lib/number/U16 - block $~lib/number/U8 - block $~lib/number/Isize - block $~lib/number/I64 - block $~lib/number/I32 - block $~lib/number/I16 - block $~lib/number/I8 - local.get $0 - i32.const 8 - i32.sub - i32.load - i32.const 1 - i32.sub - br_table $~lib/number/I8 $~lib/number/I16 $~lib/number/I32 $~lib/number/I64 $~lib/number/Isize $~lib/number/U8 $~lib/number/U16 $~lib/number/U32 $~lib/number/U64 $~lib/number/Usize $~lib/number/Bool $~lib/number/F32 $~lib/number/F64 $~lib/arraybuffer/ArrayBufferView $~lib/arraybuffer/ArrayBuffer $~lib/string/String $invalid - end - return - end - return - end - return - end - return - end - return - end - return - end - return - end - return - end - return - end - return - end - return - end - return + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit end return + unreachable end - local.get $0 - i32.load - local.tee $0 - if - local.get $0 - local.get $1 - call $~lib/rt/purerc/__visit - local.get $0 - local.get $1 - call $~lib/builtins/__visit_members - end - return + unreachable + unreachable end - return + unreachable + unreachable end - return + unreachable end - unreachable ) (func $null (; 31 ;) (type $FUNCSIG$v) - nop ) ) diff --git a/tests/compiler/runtime-full.untouched.wat b/tests/compiler/runtime-full.untouched.wat index 80845036..cf7afd43 100644 --- a/tests/compiler/runtime-full.untouched.wat +++ b/tests/compiler/runtime-full.untouched.wat @@ -9,17 +9,20 @@ (type $FUNCSIG$vi (func (param i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\1e\00\00\00\00\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") - (data (i32.const 56) "\"\00\00\00\00\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") - (data (i32.const 112) "\10\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 112) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 168) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 224) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 280) "\10\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) - (global $~lib/builtins/RTTI_BASE i32 (i32.const 112)) - (global $~lib/builtins/HEAP_BASE i32 (i32.const 248)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 280)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 416)) (export "memory" (memory $0)) (export "__alloc" (func $~lib/rt/tlsf/__alloc)) (export "__realloc" (func $~lib/rt/tlsf/__realloc)) @@ -151,7 +154,7 @@ i32.store offset=16 end local.get $1 - block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) local.get $0 local.set $10 local.get $4 @@ -520,7 +523,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) local.get $0 local.set $3 local.get $9 @@ -581,6 +584,10 @@ i32.or i32.store block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) local.get $0 local.set $13 @@ -597,13 +604,13 @@ local.get $10 i32.shl i32.or - local.set $3 - local.get $0 - local.get $9 + local.set $7 + local.get $3 + local.get $6 i32.const 2 i32.shl i32.add - local.get $3 + local.get $7 i32.store offset=4 end ) @@ -705,11 +712,7 @@ i32.sub local.set $6 local.get $6 - i32.const 16 - i32.const 16 - i32.add - i32.const 16 - i32.add + i32.const 48 i32.lt_u if i32.const 0 @@ -923,7 +926,7 @@ i32.const 1073741808 i32.ge_u if - i32.const 0 + i32.const 72 i32.const 24 i32.const 446 i32.const 29 @@ -1089,7 +1092,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) local.get $0 local.set $9 local.get $2 @@ -1111,7 +1114,7 @@ local.set $7 end else - block $~lib/rt/tlsf/GETHEAD|inlined.4 (result i32) + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) local.get $0 local.set $8 local.get $2 @@ -1216,9 +1219,7 @@ i32.sub local.set $4 local.get $4 - i32.const 16 - i32.const 16 - i32.add + i32.const 32 i32.ge_u if local.get $1 @@ -1337,7 +1338,7 @@ unreachable end local.get $3 - i32.const 1 + i32.const 0 i32.store offset=4 local.get $3 local.get $1 @@ -1378,55 +1379,62 @@ (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) block $~lib/util/memory/memmove|inlined.0 local.get $0 + local.set $5 local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 i32.eq if br $~lib/util/memory/memmove|inlined.0 end - local.get $0 - local.get $1 + local.get $5 + local.get $4 i32.lt_u if - local.get $1 + local.get $4 i32.const 7 i32.and - local.get $0 + local.get $5 i32.const 7 i32.and i32.eq if block $break|0 loop $continue|0 - local.get $0 + local.get $5 i32.const 7 i32.and if - local.get $2 + local.get $3 i32.eqz if br $~lib/util/memory/memmove|inlined.0 end - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 block (result i32) - local.get $0 - local.tee $5 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $5 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $5 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $5 + local.set $4 + local.get $6 end i32.load8_u i32.store8 @@ -1436,26 +1444,26 @@ end block $break|1 loop $continue|1 - local.get $2 + local.get $3 i32.const 8 i32.ge_u if - local.get $0 - local.get $1 + local.get $5 + local.get $4 i64.load i64.store - local.get $2 + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 + local.set $3 + local.get $5 i32.const 8 i32.add - local.set $0 - local.get $1 + local.set $5 + local.get $4 i32.const 8 i32.add - local.set $1 + local.set $4 br $continue|1 end end @@ -1463,64 +1471,64 @@ end block $break|2 loop $continue|2 - local.get $2 + local.get $3 if block (result i32) - local.get $0 - local.tee $5 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $5 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $5 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $5 + local.set $4 + local.get $6 end i32.load8_u i32.store8 - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 br $continue|2 end end end else - local.get $1 + local.get $4 i32.const 7 i32.and - local.get $0 + local.get $5 i32.const 7 i32.and i32.eq if block $break|3 loop $continue|3 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 7 i32.and if - local.get $2 + local.get $3 i32.eqz if br $~lib/util/memory/memmove|inlined.0 end - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i32.load8_u i32.store8 @@ -1530,19 +1538,19 @@ end block $break|4 loop $continue|4 - local.get $2 + local.get $3 i32.const 8 i32.ge_u if - local.get $2 + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 - local.get $2 + local.set $3 + local.get $5 + local.get $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i64.load i64.store @@ -1553,16 +1561,16 @@ end block $break|5 loop $continue|5 - local.get $2 + local.get $3 if - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i32.load8_u i32.store8 @@ -1601,9 +1609,7 @@ end local.get $3 local.get $4 - i32.const 3 - i32.const -1 - i32.xor + i32.const -4 i32.and i32.le_u if @@ -1714,7 +1720,7 @@ if i32.const 0 i32.const 24 - i32.const 550 + i32.const 552 i32.const 13 call $~lib/builtins/abort unreachable @@ -1734,7 +1740,7 @@ if i32.const 0 i32.const 24 - i32.const 551 + i32.const 553 i32.const 2 call $~lib/builtins/abort unreachable @@ -1761,7 +1767,7 @@ if i32.const 0 i32.const 24 - i32.const 529 + i32.const 530 i32.const 2 call $~lib/builtins/abort unreachable @@ -1781,7 +1787,7 @@ if i32.const 0 i32.const 24 - i32.const 558 + i32.const 560 i32.const 13 call $~lib/builtins/abort unreachable @@ -1801,7 +1807,7 @@ if i32.const 0 i32.const 24 - i32.const 559 + i32.const 561 i32.const 2 call $~lib/builtins/abort unreachable @@ -1833,7 +1839,7 @@ i32.eqz if i32.const 0 - i32.const 72 + i32.const 128 i32.const 103 i32.const 2 call $~lib/builtins/abort @@ -1844,6 +1850,20 @@ i32.const 1 i32.add i32.store offset=4 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end ) (func $~lib/rt/purerc/__retain (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -1871,16 +1891,20 @@ i32.load i32.gt_u end - if (result i32) + if + i32.const 184 + i32.const 240 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort unreachable - else - local.get $1 - local.get $0 - i32.const 8 - i32.mul - i32.add - i32.load end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load ) (func $~lib/rt/purerc/growRoots (; 19 ;) (type $FUNCSIG$v) (local $0 i32) @@ -1957,6 +1981,20 @@ i32.const 268435455 i32.and local.set $2 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end local.get $2 i32.const 1 i32.eq @@ -1990,8 +2028,8 @@ i32.eqz if i32.const 0 - i32.const 72 - i32.const 119 + i32.const 128 + i32.const 123 i32.const 15 call $~lib/builtins/abort unreachable @@ -2406,7 +2444,7 @@ i32.eqz if i32.const 0 - i32.const 72 + i32.const 128 i32.const 74 i32.const 17 call $~lib/builtins/abort @@ -2453,7 +2491,7 @@ i32.eqz if i32.const 0 - i32.const 72 + i32.const 128 i32.const 85 i32.const 6 call $~lib/builtins/abort @@ -2490,7 +2528,7 @@ i32.eqz if i32.const 0 - i32.const 72 + i32.const 128 i32.const 96 i32.const 24 call $~lib/builtins/abort @@ -2500,73 +2538,60 @@ ) (func $~lib/builtins/__visit_members (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - block $invalid - block $~lib/string/String - block $~lib/arraybuffer/ArrayBuffer - block $~lib/arraybuffer/ArrayBufferView - block $~lib/number/F64 - block $~lib/number/F32 - block $~lib/number/Bool - block $~lib/number/Usize - block $~lib/number/U64 - block $~lib/number/U32 - block $~lib/number/U16 - block $~lib/number/U8 - block $~lib/number/Isize - block $~lib/number/I64 - block $~lib/number/I32 - block $~lib/number/I16 - block $~lib/number/I8 - local.get $0 - i32.const 8 - i32.sub - i32.load - br_table $invalid $~lib/number/I8 $~lib/number/I16 $~lib/number/I32 $~lib/number/I64 $~lib/number/Isize $~lib/number/U8 $~lib/number/U16 $~lib/number/U32 $~lib/number/U64 $~lib/number/Usize $~lib/number/Bool $~lib/number/F32 $~lib/number/F64 $~lib/arraybuffer/ArrayBufferView $~lib/arraybuffer/ArrayBuffer $~lib/string/String $invalid - end - return - end - return - end - return - end - return - end - return - end - return - end - return - end - return - end - return - end - return - end - return - end - return + block + end + block $switch$1$leave + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit end return + unreachable end - local.get $0 - i32.load - local.tee $2 - if - local.get $2 - local.get $1 - call $~lib/rt/purerc/__visit - local.get $2 - local.get $1 - call $~lib/builtins/__visit_members - end - return + unreachable + unreachable end - return + unreachable + unreachable end - return + unreachable end - unreachable ) (func $null (; 31 ;) (type $FUNCSIG$v) ) diff --git a/tests/compiler/runtime-stub.optimized.wat b/tests/compiler/runtime-stub.optimized.wat index c2549cf7..a386e913 100644 --- a/tests/compiler/runtime-stub.optimized.wat +++ b/tests/compiler/runtime-stub.optimized.wat @@ -4,73 +4,98 @@ (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$v (func)) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08") - (global $stub/startOffset (mut i32) (i32.const 0)) - (global $stub/offset (mut i32) (i32.const 0)) + (data (i32.const 8) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 64) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 120) "\10\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 120)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 256)) (export "memory" (memory $0)) - (export "__alloc" (func $stub/__alloc)) - (export "__realloc" (func $stub/__realloc)) - (export "__free" (func $stub/__free)) - (export "__retain" (func $stub/__retain)) - (export "__release" (func $stub/__free)) - (export "__collect" (func $stub/__collect)) + (export "__alloc" (func $~lib/rt/stub/__alloc)) + (export "__realloc" (func $~lib/rt/stub/__realloc)) + (export "__free" (func $~lib/rt/stub/__free)) + (export "__retain" (func $~lib/rt/stub/__retain)) + (export "__release" (func $~lib/rt/stub/__release)) + (export "__collect" (func $~lib/rt/stub/__collect)) (export "__instanceof" (func $~lib/rt/common/__instanceof)) (export "__typeinfo" (func $~lib/rt/common/__typeinfo)) (start $start) - (func $stub/__alloc (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 i32.const 1073741808 i32.gt_u if unreachable end - global.get $stub/offset + global.get $~lib/rt/stub/offset i32.const 16 i32.add + local.set $2 + local.get $2 + local.get $0 local.tee $3 - local.get $0 - i32.const 1 - local.get $0 i32.const 1 + local.tee $4 + local.get $3 + local.get $4 i32.gt_u select i32.add i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and - local.tee $2 + local.set $5 current_memory - local.tee $4 + local.set $6 + local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 + local.get $5 local.get $2 - local.get $3 i32.sub i32.const 65535 i32.add - i32.const -65536 + i32.const 65535 + i32.const -1 + i32.xor i32.and i32.const 16 i32.shr_u - local.tee $5 + local.set $3 + local.get $6 + local.tee $4 + local.get $3 + local.tee $7 local.get $4 - local.get $5 + local.get $7 i32.gt_s select + local.set $4 + local.get $4 grow_memory i32.const 0 i32.lt_s if - local.get $5 + local.get $3 grow_memory i32.const 0 i32.lt_s @@ -79,211 +104,251 @@ end end end + local.get $5 + global.set $~lib/rt/stub/offset local.get $2 - global.set $stub/offset - local.get $3 i32.const 16 i32.sub - local.tee $2 + local.set $8 + local.get $8 local.get $1 i32.store offset=8 - local.get $2 + local.get $8 local.get $0 i32.store offset=12 - local.get $3 + local.get $2 ) - (func $~lib/memory/memory.copy (; 1 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 2 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) block $~lib/util/memory/memmove|inlined.0 local.get $0 + local.set $5 local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 i32.eq - br_if $~lib/util/memory/memmove|inlined.0 - local.get $0 - local.get $1 + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 i32.lt_u if - local.get $1 + local.get $4 i32.const 7 i32.and - local.get $0 + local.get $5 i32.const 7 i32.and i32.eq if - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - br_if $~lib/util/memory/memmove|inlined.0 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - br $continue|0 + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end end end - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 + block $break|1 + loop $continue|1 + local.get $3 i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - br $continue|1 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end end end end - loop $continue|2 - local.get $2 - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 + block $break|2 + loop $continue|2 local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|2 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end end end else - local.get $1 + local.get $4 i32.const 7 i32.and - local.get $0 + local.get $5 i32.const 7 i32.and i32.eq if - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - br_if $~lib/util/memory/memmove|inlined.0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|3 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end end end - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $2 + block $break|4 + loop $continue|4 + local.get $3 i32.const 8 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - br $continue|4 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end end end end - loop $continue|5 - local.get $2 - if - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end end end end end ) - (func $stub/__realloc (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/stub/__realloc (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - local.get $1 + (local $4 i32) local.get $0 i32.const 16 i32.sub - local.tee $2 + local.set $2 + local.get $2 i32.load offset=12 - local.tee $3 + local.set $3 + local.get $1 + local.get $3 i32.gt_u if local.get $1 local.get $2 i32.load offset=8 - call $stub/__alloc - local.tee $1 + call $~lib/rt/stub/__alloc + local.set $4 + local.get $4 local.get $0 local.get $3 call $~lib/memory/memory.copy - local.get $1 + local.get $4 local.set $0 else local.get $2 @@ -292,24 +357,32 @@ end local.get $0 ) - (func $stub/__free (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/stub/__free (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $stub/__retain (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/stub/__retain (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 ) - (func $stub/__collect (; 5 ;) (type $FUNCSIG$v) + (func $~lib/rt/stub/__release (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $~lib/rt/common/__instanceof (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/stub/__collect (; 7 ;) (type $FUNCSIG$v) + nop + ) + (func $~lib/rt/common/__instanceof (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) local.get $0 i32.const 16 i32.sub i32.load offset=8 - local.tee $0 + local.set $2 + global.get $~lib/builtins/RTTI_BASE + local.set $3 + local.get $2 if (result i32) - local.get $0 - i32.const 8 + local.get $2 + local.get $3 i32.load i32.le_u else @@ -317,50 +390,66 @@ end if loop $continue|0 - local.get $0 + local.get $2 local.get $1 i32.eq if i32.const 1 return end - local.get $0 - i32.const 3 - i32.shl + local.get $3 + local.get $2 i32.const 8 + i32.mul i32.add i32.load offset=4 - local.tee $0 + local.tee $2 br_if $continue|0 end end i32.const 0 ) - (func $~lib/rt/common/__typeinfo (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/common/__typeinfo (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 local.get $0 + i32.eqz if (result i32) + i32.const 1 + else local.get $0 - i32.const 8 + local.get $1 i32.load i32.gt_u - else - i32.const 1 end - if (result i32) + if + i32.const 24 + i32.const 80 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 3 - i32.shl - i32.const 8 - i32.add - i32.load end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load ) - (func $start (; 8 ;) (type $FUNCSIG$v) - i32.const 144 - global.set $stub/startOffset - global.get $stub/startOffset - global.set $stub/offset + (func $start (; 10 ;) (type $FUNCSIG$v) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + ) + (func $null (; 11 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/runtime-stub.untouched.wat b/tests/compiler/runtime-stub.untouched.wat index 027f47e5..a386e913 100644 --- a/tests/compiler/runtime-stub.untouched.wat +++ b/tests/compiler/runtime-stub.untouched.wat @@ -4,25 +4,29 @@ (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$v (func)) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") + (data (i32.const 8) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 64) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 120) "\10\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $stub/startOffset (mut i32) (i32.const 0)) - (global $stub/offset (mut i32) (i32.const 0)) - (global $~lib/builtins/RTTI_BASE i32 (i32.const 8)) - (global $~lib/builtins/HEAP_BASE i32 (i32.const 144)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 120)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 256)) (export "memory" (memory $0)) - (export "__alloc" (func $stub/__alloc)) - (export "__realloc" (func $stub/__realloc)) - (export "__free" (func $stub/__free)) - (export "__retain" (func $stub/__retain)) - (export "__release" (func $stub/__release)) - (export "__collect" (func $stub/__collect)) + (export "__alloc" (func $~lib/rt/stub/__alloc)) + (export "__realloc" (func $~lib/rt/stub/__realloc)) + (export "__free" (func $~lib/rt/stub/__free)) + (export "__retain" (func $~lib/rt/stub/__retain)) + (export "__release" (func $~lib/rt/stub/__release)) + (export "__collect" (func $~lib/rt/stub/__collect)) (export "__instanceof" (func $~lib/rt/common/__instanceof)) (export "__typeinfo" (func $~lib/rt/common/__typeinfo)) (start $start) - (func $stub/__alloc (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -36,7 +40,7 @@ if unreachable end - global.get $stub/offset + global.get $~lib/rt/stub/offset i32.const 16 i32.add local.set $2 @@ -101,7 +105,7 @@ end end local.get $5 - global.set $stub/offset + global.set $~lib/rt/stub/offset local.get $2 i32.const 16 i32.sub @@ -114,59 +118,66 @@ i32.store offset=12 local.get $2 ) - (func $~lib/memory/memory.copy (; 1 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 2 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) block $~lib/util/memory/memmove|inlined.0 local.get $0 + local.set $5 local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 i32.eq if br $~lib/util/memory/memmove|inlined.0 end - local.get $0 - local.get $1 + local.get $5 + local.get $4 i32.lt_u if - local.get $1 + local.get $4 i32.const 7 i32.and - local.get $0 + local.get $5 i32.const 7 i32.and i32.eq if block $break|0 loop $continue|0 - local.get $0 + local.get $5 i32.const 7 i32.and if - local.get $2 + local.get $3 i32.eqz if br $~lib/util/memory/memmove|inlined.0 end - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 block (result i32) - local.get $0 - local.tee $5 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $5 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $5 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $5 + local.set $4 + local.get $6 end i32.load8_u i32.store8 @@ -176,26 +187,26 @@ end block $break|1 loop $continue|1 - local.get $2 + local.get $3 i32.const 8 i32.ge_u if - local.get $0 - local.get $1 + local.get $5 + local.get $4 i64.load i64.store - local.get $2 + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 + local.set $3 + local.get $5 i32.const 8 i32.add - local.set $0 - local.get $1 + local.set $5 + local.get $4 i32.const 8 i32.add - local.set $1 + local.set $4 br $continue|1 end end @@ -203,64 +214,64 @@ end block $break|2 loop $continue|2 - local.get $2 + local.get $3 if block (result i32) - local.get $0 - local.tee $5 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $5 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $5 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $5 + local.set $4 + local.get $6 end i32.load8_u i32.store8 - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 br $continue|2 end end end else - local.get $1 + local.get $4 i32.const 7 i32.and - local.get $0 + local.get $5 i32.const 7 i32.and i32.eq if block $break|3 loop $continue|3 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 7 i32.and if - local.get $2 + local.get $3 i32.eqz if br $~lib/util/memory/memmove|inlined.0 end - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i32.load8_u i32.store8 @@ -270,19 +281,19 @@ end block $break|4 loop $continue|4 - local.get $2 + local.get $3 i32.const 8 i32.ge_u if - local.get $2 + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 - local.get $2 + local.set $3 + local.get $5 + local.get $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i64.load i64.store @@ -293,16 +304,16 @@ end block $break|5 loop $continue|5 - local.get $2 + local.get $3 if - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i32.load8_u i32.store8 @@ -313,7 +324,7 @@ end end ) - (func $stub/__realloc (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/stub/__realloc (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -331,7 +342,7 @@ local.get $1 local.get $2 i32.load offset=8 - call $stub/__alloc + call $~lib/rt/stub/__alloc local.set $4 local.get $4 local.get $0 @@ -346,19 +357,19 @@ end local.get $0 ) - (func $stub/__free (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/stub/__free (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $stub/__retain (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/stub/__retain (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 ) - (func $stub/__release (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/stub/__release (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $stub/__collect (; 6 ;) (type $FUNCSIG$v) + (func $~lib/rt/stub/__collect (; 7 ;) (type $FUNCSIG$v) nop ) - (func $~lib/rt/common/__instanceof (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/common/__instanceof (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -398,7 +409,7 @@ end i32.const 0 ) - (func $~lib/rt/common/__typeinfo (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/common/__typeinfo (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) global.get $~lib/builtins/RTTI_BASE local.set $1 @@ -412,18 +423,22 @@ i32.load i32.gt_u end - if (result i32) + if + i32.const 24 + i32.const 80 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort unreachable - else - local.get $1 - local.get $0 - i32.const 8 - i32.mul - i32.add - i32.load end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load ) - (func $start (; 9 ;) (type $FUNCSIG$v) + (func $start (; 10 ;) (type $FUNCSIG$v) global.get $~lib/builtins/HEAP_BASE i32.const 15 i32.add @@ -431,10 +446,10 @@ i32.const -1 i32.xor i32.and - global.set $stub/startOffset - global.get $stub/startOffset - global.set $stub/offset + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset ) - (func $null (; 10 ;) (type $FUNCSIG$v) + (func $null (; 11 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/simd.optimized.wat b/tests/compiler/simd.optimized.wat index 78cef421..7c5760a2 100644 --- a/tests/compiler/simd.optimized.wat +++ b/tests/compiler/simd.optimized.wat @@ -1,8 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 1) - (data (i32.const 8) "\11\00\00\00\0e") - (data (i32.const 24) "s\00i\00m\00d\00.\00t\00s") + (data (i32.const 8) "\0e\00\00\00\01\00\00\00\11\00\00\00\0e\00\00\00s\00i\00m\00d\00.\00t\00s\00") (export "memory" (memory $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop diff --git a/tests/compiler/simd.untouched.wat b/tests/compiler/simd.untouched.wat index a90a70d5..35b341fe 100644 --- a/tests/compiler/simd.untouched.wat +++ b/tests/compiler/simd.untouched.wat @@ -3,7 +3,7 @@ (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\11\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00s\00i\00m\00d\00.\00t\00s\00") + (data (i32.const 8) "\0e\00\00\00\01\00\00\00\11\00\00\00\0e\00\00\00s\00i\00m\00d\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/ASC_FEATURE_SIMD i32 (i32.const 0)) diff --git a/tests/compiler/static-this.optimized.wat b/tests/compiler/static-this.optimized.wat index ab59dfb0..66ab3781 100644 --- a/tests/compiler/static-this.optimized.wat +++ b/tests/compiler/static-this.optimized.wat @@ -1,17 +1,23 @@ (module + (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\1c") - (data (i32.const 24) "s\00t\00a\00t\00i\00c\00-\00t\00h\00i\00s\00.\00t\00s") + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\10\00\00\00\1c\00\00\00s\00t\00a\00t\00i\00c\00-\00t\00h\00i\00s\00.\00t\00s\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) (global $static-this/Foo.bar (mut i32) (i32.const 42)) (export "memory" (memory $0)) (start $start) - (func $start (; 1 ;) (type $FUNCSIG$v) + (func $static-this/Foo.getBar (; 1 ;) (type $FUNCSIG$i) (result i32) global.get $static-this/Foo.bar + ) + (func $start:static-this (; 2 ;) (type $FUNCSIG$v) + call $static-this/Foo.getBar i32.const 42 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -21,7 +27,9 @@ unreachable end ) - (func $null (; 2 ;) (type $FUNCSIG$v) - nop + (func $start (; 3 ;) (type $FUNCSIG$v) + call $start:static-this + ) + (func $null (; 4 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/static-this.untouched.wat b/tests/compiler/static-this.untouched.wat index 839a41d1..66ab3781 100644 --- a/tests/compiler/static-this.untouched.wat +++ b/tests/compiler/static-this.untouched.wat @@ -4,7 +4,7 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\1c\00\00\00\00\00\00\00\00\00\00\00s\00t\00a\00t\00i\00c\00-\00t\00h\00i\00s\00.\00t\00s\00") + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\10\00\00\00\1c\00\00\00s\00t\00a\00t\00i\00c\00-\00t\00h\00i\00s\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $static-this/Foo.bar (mut i32) (i32.const 42)) diff --git a/tests/compiler/std/array.json b/tests/compiler/std/array.json index b1da366f..0c036aee 100644 --- a/tests/compiler/std/array.json +++ b/tests/compiler/std/array.json @@ -1,5 +1,6 @@ { "asc_flags": [ - "--runtime none" + "--runtime full", + "--use ASC_RTRACE=1" ] } \ No newline at end of file diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index d488ca16..9cf78a70 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -2,1285 +2,2576 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$fiii (func (param i32 i32 i32) (result f32))) (type $FUNCSIG$fii (func (param i32 i32) (result f32))) (type $FUNCSIG$d (func (result f64))) (type $FUNCSIG$vj (func (param i64))) + (type $FUNCSIG$jj (func (param i64) (result i64))) (type $FUNCSIG$iff (func (param f32 f32) (result i32))) + (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$idd (func (param f64 f64) (result i32))) (type $FUNCSIG$dii (func (param i32 i32) (result f64))) (type $FUNCSIG$id (func (param f64) (result i32))) + (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) (type $FUNCSIG$iid (func (param i32 f64) (result i32))) + (type $FUNCSIG$jii (func (param i32 i32) (result i64))) (type $FUNCSIG$iijijiji (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $FUNCSIG$iiid (func (param i32 i32 f64) (result i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$viji (func (param i32 i64 i32))) (type $FUNCSIG$iiij (func (param i32 i32 i64) (result i32))) - (type $FUNCSIG$v (func)) - (type $FUNCSIG$i (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00&") - (data (i32.const 24) "~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 64) "\10\00\00\00(") - (data (i32.const 80) "~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s") - (data (i32.const 120) "\10\00\00\00\06") - (data (i32.const 136) "a\00b\00c") - (data (i32.const 144) "\10\00\00\00\18") - (data (i32.const 160) "s\00t\00d\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 184) "\0f\00\00\00\05") - (data (i32.const 200) "\01\02\03\04\05") - (data (i32.const 208) "\14\00\00\00\10") - (data (i32.const 224) "\c8\00\00\00\c8\00\00\00\05\00\00\00\05") - (data (i32.const 240) "\0f\00\00\00\05") - (data (i32.const 256) "\01\01\01\04\05") - (data (i32.const 264) "\10\00\00\00\1a") - (data (i32.const 280) "~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 312) "\0f\00\00\00\05") - (data (i32.const 336) "\0f\00\00\00\05") - (data (i32.const 352) "\01\01") - (data (i32.const 360) "\0f\00\00\00\05") - (data (i32.const 376) "\01\01\00\02\02") - (data (i32.const 384) "\0f\00\00\00\05") - (data (i32.const 400) "\01\01\00\02\02") - (data (i32.const 408) "\0f\00\00\00\14") - (data (i32.const 424) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 448) "\15\00\00\00\10") - (data (i32.const 464) "\a8\01\00\00\a8\01\00\00\14\00\00\00\05") - (data (i32.const 480) "\0f\00\00\00\14") - (data (i32.const 496) "\01\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00\05") - (data (i32.const 520) "\0f\00\00\00\14") - (data (i32.const 560) "\0f\00\00\00\14") - (data (i32.const 576) "\01\00\00\00\01") - (data (i32.const 600) "\0f\00\00\00\14") - (data (i32.const 616) "\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02") - (data (i32.const 640) "\0f\00\00\00\14") - (data (i32.const 656) "\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02") - (data (i32.const 680) "\0f") - (data (i32.const 696) "\0f") - (data (i32.const 712) "\11\00\00\00\10") - (data (i32.const 728) "\c8\02\00\00\c8\02") - (data (i32.const 744) "\0f\00\00\00\14") - (data (i32.const 760) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 784) "\0f\00\00\00\14") - (data (i32.const 800) "\04\00\00\00\05\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 824) "\0f\00\00\00\14") - (data (i32.const 840) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 864) "\0f\00\00\00\14") - (data (i32.const 880) "\01\00\00\00\04\00\00\00\05\00\00\00\04\00\00\00\05") - (data (i32.const 904) "\0f\00\00\00\14") - (data (i32.const 920) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 944) "\0f\00\00\00\14") - (data (i32.const 960) "\01\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\05") - (data (i32.const 984) "\0f\00\00\00\14") - (data (i32.const 1000) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1024) "\0f\00\00\00\14") - (data (i32.const 1040) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1064) "\0f\00\00\00\14") - (data (i32.const 1080) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1104) "\0f\00\00\00\14") - (data (i32.const 1120) "\04\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1144) "\0f\00\00\00\14") - (data (i32.const 1160) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1184) "\0f\00\00\00\14") - (data (i32.const 1200) "\01\00\00\00\04\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1224) "\0f\00\00\00\14") - (data (i32.const 1240) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1264) "\0f\00\00\00\14") - (data (i32.const 1280) "\01\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00\05") - (data (i32.const 1304) "\0f\00\00\00\14") - (data (i32.const 1320) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1344) "\0f\00\00\00\14") - (data (i32.const 1360) "\04\00\00\00\05\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1384) "\0f\00\00\00\14") - (data (i32.const 1400) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1424) "\0f\00\00\00\14") - (data (i32.const 1440) "\04\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1464) "\0f\00\00\00\14") - (data (i32.const 1480) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1504) "\0f\00\00\00\14") - (data (i32.const 1520) "\01\00\00\00\03\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1544) "\0f\00\00\00\14") - (data (i32.const 1560) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1584) "\0f\00\00\00\14") - (data (i32.const 1600) "\01\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00\05") - (data (i32.const 1624) "\0f\00\00\00\14") - (data (i32.const 1640) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1664) "\0f\00\00\00\14") - (data (i32.const 1680) "\01\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\05") - (data (i32.const 1704) "\0f\00\00\00\14") - (data (i32.const 1720) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1744) "\11\00\00\00\10") - (data (i32.const 1760) "\b8\06\00\00\b8\06\00\00\14\00\00\00\05") - (data (i32.const 1776) "\0f\00\00\00\14") - (data (i32.const 1792) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1816) "\0f") - (data (i32.const 1832) "\0f\00\00\00\14") - (data (i32.const 1848) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1872) "\0f\00\00\00\0c") - (data (i32.const 1888) "\03\00\00\00\04\00\00\00\05") - (data (i32.const 1904) "\0f\00\00\00\08") - (data (i32.const 1920) "\01\00\00\00\02") - (data (i32.const 1928) "\0f\00\00\00\14") - (data (i32.const 1944) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1968) "\0f\00\00\00\08") - (data (i32.const 1984) "\03\00\00\00\04") - (data (i32.const 1992) "\0f\00\00\00\0c") - (data (i32.const 2008) "\01\00\00\00\02\00\00\00\05") - (data (i32.const 2024) "\0f\00\00\00\14") - (data (i32.const 2040) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2064) "\0f\00\00\00\04") - (data (i32.const 2080) "\01") - (data (i32.const 2088) "\0f\00\00\00\10") - (data (i32.const 2104) "\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2120) "\0f\00\00\00\14") - (data (i32.const 2136) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2160) "\0f\00\00\00\04") - (data (i32.const 2176) "\05") - (data (i32.const 2184) "\0f\00\00\00\10") - (data (i32.const 2200) "\01\00\00\00\02\00\00\00\03\00\00\00\04") - (data (i32.const 2216) "\0f\00\00\00\14") - (data (i32.const 2232) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2256) "\0f\00\00\00\08") - (data (i32.const 2272) "\04\00\00\00\05") - (data (i32.const 2280) "\0f\00\00\00\0c") - (data (i32.const 2296) "\01\00\00\00\02\00\00\00\03") - (data (i32.const 2312) "\0f\00\00\00\14") - (data (i32.const 2328) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2352) "\0f\00\00\00\04") - (data (i32.const 2368) "\04") - (data (i32.const 2376) "\0f\00\00\00\10") - (data (i32.const 2392) "\01\00\00\00\02\00\00\00\03\00\00\00\05") - (data (i32.const 2408) "\0f\00\00\00\14") - (data (i32.const 2424) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2448) "\0f\00\00\00\04") - (data (i32.const 2464) "\01") - (data (i32.const 2472) "\0f\00\00\00\10") - (data (i32.const 2488) "\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2504) "\0f\00\00\00\14") - (data (i32.const 2520) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2544) "\0f") - (data (i32.const 2560) "\0f\00\00\00\14") - (data (i32.const 2576) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2600) "\0f\00\00\00\14") - (data (i32.const 2616) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2640) "\0f") - (data (i32.const 2656) "\0f\00\00\00\14") - (data (i32.const 2672) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2696) "\0f\00\00\00\14") - (data (i32.const 2712) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2736) "\0f") - (data (i32.const 2752) "\0f\00\00\00\14") - (data (i32.const 2768) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2792) "\0f\00\00\00\14") - (data (i32.const 2808) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2832) "\0f") - (data (i32.const 2848) "\0f\00\00\00\14") - (data (i32.const 2864) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2888) "\0f\00\00\00\14") - (data (i32.const 2904) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2928) "\0f") - (data (i32.const 2944) "\0f\00\00\00\14") - (data (i32.const 2960) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2984) "\10\00\00\00\18") - (data (i32.const 3000) "~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s") - (data (i32.const 3024) "\10\00\00\00\ac") - (data (i32.const 3040) "A\00B\00C\00D\00E\00F\00G\00H\00I\00J\00K\00L\00M\00N\00O\00P\00Q\00R\00S\00T\00U\00V\00W\00X\00Y\00Z\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\000\001\002\003\004\005\006\007\008\009\00_\00-\00,\00.\00+\00/\00\\\00[\00]\00{\00}\00(\00)\00<\00>\00*\00&\00$\00%\00^\00@\00#\00!\00?") - (data (i32.const 3216) "\0f\00\00\00 ") - (data (i32.const 3234) "\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f") - (data (i32.const 3264) "\16\00\00\00\10") - (data (i32.const 3280) "\a0\0c\00\00\a0\0c\00\00 \00\00\00\08") - (data (i32.const 3296) "\0f\00\00\00 ") - (data (i32.const 3314) "\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f") - (data (i32.const 3344) "\0f\00\00\00@") - (data (i32.const 3366) "\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?") - (data (i32.const 3406) "\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f") - (data (i32.const 3424) "\17\00\00\00\10") - (data (i32.const 3440) " \0d\00\00 \0d\00\00@\00\00\00\08") - (data (i32.const 3456) "\0f\00\00\00@") - (data (i32.const 3478) "\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf") - (data (i32.const 3510) "\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f") - (data (i32.const 3536) "\0f\00\00\00\14") - (data (i32.const 3552) "\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02") - (data (i32.const 3576) "\11\00\00\00\10") - (data (i32.const 3592) "\e0\0d\00\00\e0\0d\00\00\14\00\00\00\05") - (data (i32.const 3608) "\0f\00\00\00\14") - (data (i32.const 3624) "\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02") - (data (i32.const 3648) "\0f\00\00\00\14") - (data (i32.const 3664) "\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02") - (data (i32.const 3688) "\15\00\00\00\10") - (data (i32.const 3704) "P\0e\00\00P\0e\00\00\14\00\00\00\05") - (data (i32.const 3720) "\0f\00\00\00\14") - (data (i32.const 3740) "\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff") - (data (i32.const 3760) "\0f") - (data (i32.const 3776) "\11\00\00\00\10") - (data (i32.const 3792) "\c0\0e\00\00\c0\0e") - (data (i32.const 3808) "\0f\00\00\00\04") - (data (i32.const 3824) "\01") - (data (i32.const 3832) "\11\00\00\00\10") - (data (i32.const 3848) "\f0\0e\00\00\f0\0e\00\00\04\00\00\00\01") - (data (i32.const 3864) "\0f\00\00\00\08") - (data (i32.const 3880) "\02\00\00\00\01") - (data (i32.const 3888) "\11\00\00\00\10") - (data (i32.const 3904) "(\0f\00\00(\0f\00\00\08\00\00\00\02") - (data (i32.const 3920) "\0f\00\00\00\10") - (data (i32.const 3936) "\03\00\00\00\02\00\00\00\01") - (data (i32.const 3952) "\11\00\00\00\10") - (data (i32.const 3968) "`\0f\00\00`\0f\00\00\10\00\00\00\04") - (data (i32.const 3984) "\0f\00\00\00\10") - (data (i32.const 4004) "\01\00\00\00\02\00\00\00\03") - (data (i32.const 4016) "\11\00\00\00\10") - (data (i32.const 4032) "\a0\0f\00\00\a0\0f\00\00\10\00\00\00\04") - (data (i32.const 4048) "\0f\00\00\00\04") - (data (i32.const 4064) "\01") - (data (i32.const 4072) "\0f\00\00\00\08") - (data (i32.const 4088) "\01\00\00\00\02") - (data (i32.const 4096) "\10\00\00\00\02") - (data (i32.const 4112) "a") - (data (i32.const 4120) "\10\00\00\00\02") - (data (i32.const 4136) "b") - (data (i32.const 4144) "\10\00\00\00\04") - (data (i32.const 4160) "a\00b") - (data (i32.const 4168) "\10\00\00\00\04") - (data (i32.const 4184) "b\00a") - (data (i32.const 4192) "\10") - (data (i32.const 4208) "\0f\00\00\00\1c") - (data (i32.const 4224) "\10\10\00\00(\10\00\00\10\10\00\00@\10\00\00X\10\00\00p\10") - (data (i32.const 4256) "\1b\00\00\00\10") - (data (i32.const 4272) "\80\10\00\00\80\10\00\00\1c\00\00\00\07") - (data (i32.const 4288) "\0f\00\00\00\1c") - (data (i32.const 4304) "p\10\00\00\10\10\00\00\10\10\00\00@\10\00\00(\10\00\00X\10") - (data (i32.const 4336) "\1b\00\00\00\10") - (data (i32.const 4352) "\d0\10\00\00\d0\10\00\00\1c\00\00\00\07") - (data (i32.const 4368) "\10\00\00\00\1c") - (data (i32.const 4384) "~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 4416) "\10\00\00\00\08") - (data (i32.const 4432) "n\00u\00l\00l") - (data (i32.const 4440) "\0f\00\00\00\02") - (data (i32.const 4456) "\01") - (data (i32.const 4464) "\10\00\00\00\08") - (data (i32.const 4480) "t\00r\00u\00e") - (data (i32.const 4488) "\10\00\00\00\n") - (data (i32.const 4504) "f\00a\00l\00s\00e") - (data (i32.const 4520) "\10\00\00\00\02") - (data (i32.const 4536) ",") - (data (i32.const 4544) "\0f\00\00\00\02") - (data (i32.const 4560) "\01") - (data (i32.const 4568) "\10\00\00\00\14") - (data (i32.const 4584) "t\00r\00u\00e\00,\00f\00a\00l\00s\00e") - (data (i32.const 4608) "\0f\00\00\00\0c") - (data (i32.const 4624) "\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") - (data (i32.const 4640) "\10\00\00\00\02") - (data (i32.const 4656) "0") - (data (i32.const 4664) "\0f\00\00\00\90\01") - (data (i32.const 4680) "0\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009") - (data (i32.const 5080) "\15\00\00\00\10") - (data (i32.const 5096) "H\12\00\00H\12\00\00\90\01\00\00d") - (data (i32.const 5112) "\0f\00\00\00\0c") - (data (i32.const 5128) "\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") - (data (i32.const 5144) "\10\00\00\00\n") - (data (i32.const 5160) "1\00-\002\00-\003") - (data (i32.const 5176) "\0f\00\00\00\0c") - (data (i32.const 5192) "\01\00\00\00\02\00\00\00\03") - (data (i32.const 5208) "\10\00\00\00\02") - (data (i32.const 5224) "-") - (data (i32.const 5232) "\0f\00\00\00\0c") - (data (i32.const 5248) "\01\00\00\00\02\00\00\00\03") - (data (i32.const 5264) "\0f\00\00\00\08") - (data (i32.const 5283) "\80\00\00\00\80") - (data (i32.const 5288) "\10\00\00\00\04") - (data (i32.const 5304) "_\00_") - (data (i32.const 5312) "\0f\00\00\00\08") - (data (i32.const 5331) "\80\00\00\00\80") - (data (i32.const 5336) "\10\00\00\000") - (data (i32.const 5352) "-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008") - (data (i32.const 5400) "\0f\00\00\000") - (data (i32.const 5430) "\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") - (data (i32.const 5464) "\10\00\00\00\04") - (data (i32.const 5480) ",\00 ") - (data (i32.const 5488) "\10\00\00\00\06") - (data (i32.const 5504) "0\00.\000") - (data (i32.const 5512) "\10\00\00\00\06") - (data (i32.const 5528) "N\00a\00N") - (data (i32.const 5536) "\10\00\00\00\12") - (data (i32.const 5552) "-\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 5576) "\10\00\00\00\10") - (data (i32.const 5592) "I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 5608) "\0f\00\00\00\b8\02") - (data (i32.const 5624) "\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\00*\00&\00$\00%\00^\00@\00#\00!\00?\00") + (data (i32.const 3344) " \00\00\00\01\00\00\00\0f\00\00\00 \00\00\00\00\00\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f") + (data (i32.const 3392) " \00\00\00\01\00\00\00\0f\00\00\00 \00\00\00\00\00\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f") + (data (i32.const 3440) "@\00\00\00\01\00\00\00\0f\00\00\00@\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f") + (data (i32.const 3520) "@\00\00\00\01\00\00\00\0f\00\00\00@\00\00\00\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f") + (data (i32.const 3600) "\14\00\00\00\01\00\00\00\0f\00\00\00\14\00\00\00\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02\00\00\00") + (data (i32.const 3640) "\14\00\00\00\01\00\00\00\0f\00\00\00\14\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 3680) "\14\00\00\00\01\00\00\00\0f\00\00\00\14\00\00\00\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02\00\00\00") + (data (i32.const 3720) "\14\00\00\00\01\00\00\00\0f\00\00\00\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff") + (data (i32.const 3760) "\00\00\00\00\01\00\00\00\0f\00\00\00\00\00\00\00") + (data (i32.const 3776) "\04\00\00\00\01\00\00\00\0f\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 3800) "\08\00\00\00\01\00\00\00\0f\00\00\00\08\00\00\00\02\00\00\00\01\00\00\00") + (data (i32.const 3824) "\10\00\00\00\01\00\00\00\0f\00\00\00\10\00\00\00\03\00\00\00\02\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 3856) "\10\00\00\00\01\00\00\00\0f\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") + (data (i32.const 3888) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00P\00R\00N\00G\00 \00m\00u\00s\00t\00 \00b\00e\00 \00s\00e\00e\00d\00e\00d\00.\00") + (data (i32.const 3944) "\04\00\00\00\01\00\00\00\0f\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 3968) "\08\00\00\00\01\00\00\00\0f\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 3992) "^\00\00\00\01\00\00\00\10\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00") + (data (i32.const 4104) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 4160) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00a\00") + (data (i32.const 4184) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00b\00") + (data (i32.const 4208) "\04\00\00\00\01\00\00\00\10\00\00\00\04\00\00\00a\00b\00") + (data (i32.const 4232) "\04\00\00\00\01\00\00\00\10\00\00\00\04\00\00\00b\00a\00") + (data (i32.const 4256) "\00\00\00\00\01\00\00\00\10\00\00\00\00\00\00\00") + (data (i32.const 4272) "\1c\00\00\00\01\00\00\00\0f\00\00\00\1c\00\00\00P\10\00\00h\10\00\00P\10\00\00\80\10\00\00\98\10\00\00\b0\10\00\00\00\00\00\00") + (data (i32.const 4320) "\1c\00\00\00\01\00\00\00\0f\00\00\00\1c\00\00\00\b0\10\00\00P\10\00\00P\10\00\00\80\10\00\00h\10\00\00\98\10\00\00\00\00\00\00") + (data (i32.const 4368) "\1c\00\00\00\01\00\00\00\10\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") + (data (i32.const 4416) "\08\00\00\00\01\00\00\00\10\00\00\00\08\00\00\00n\00u\00l\00l\00") + (data (i32.const 4440) "\02\00\00\00\01\00\00\00\0f\00\00\00\02\00\00\00\01\00") + (data (i32.const 4464) "\08\00\00\00\01\00\00\00\10\00\00\00\08\00\00\00t\00r\00u\00e\00") + (data (i32.const 4488) "\n\00\00\00\01\00\00\00\10\00\00\00\n\00\00\00f\00a\00l\00s\00e\00") + (data (i32.const 4520) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00,\00") + (data (i32.const 4544) "\14\00\00\00\01\00\00\00\10\00\00\00\14\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e\00") + (data (i32.const 4584) "\0c\00\00\00\01\00\00\00\0f\00\00\00\0c\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") + (data (i32.const 4616) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\000\00") + (data (i32.const 4640) "\90\01\00\00\01\00\00\00\0f\00\00\00\90\01\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00") + (data (i32.const 5056) "\10\00\00\00\01\00\00\00\15\00\00\00\10\00\00\000\12\00\000\12\00\00\90\01\00\00d\00\00\00") + (data (i32.const 5088) "\n\00\00\00\01\00\00\00\10\00\00\00\n\00\00\001\00-\002\00-\003\00") + (data (i32.const 5120) "\0c\00\00\00\01\00\00\00\0f\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") + (data (i32.const 5152) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00-\00") + (data (i32.const 5176) "\08\00\00\00\01\00\00\00\0f\00\00\00\08\00\00\00\00\00\00\80\00\00\00\80") + (data (i32.const 5200) "\04\00\00\00\01\00\00\00\10\00\00\00\04\00\00\00_\00_\00") + (data (i32.const 5224) "0\00\00\00\01\00\00\00\10\00\00\000\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008\00") + (data (i32.const 5288) "0\00\00\00\01\00\00\00\0f\00\00\000\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") + (data (i32.const 5352) "\04\00\00\00\01\00\00\00\10\00\00\00\04\00\00\00,\00 \00") + (data (i32.const 5376) "\06\00\00\00\01\00\00\00\10\00\00\00\06\00\00\000\00.\000\00") + (data (i32.const 5400) "\06\00\00\00\01\00\00\00\10\00\00\00\06\00\00\00N\00a\00N\00") + (data (i32.const 5424) "\12\00\00\00\01\00\00\00\10\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") + (data (i32.const 5464) "\10\00\00\00\01\00\00\00\10\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") + (data (i32.const 5496) "\b8\02\00\00\01\00\00\00\0f\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $start:std/array~anonymous|47 $start:std/array~anonymous|48 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (elem (i32.const 0) $null $start:std/array~anonymous|0 $start:std/array~anonymous|1 $start:std/array~anonymous|2 $start:std/array~anonymous|3 $start:std/array~anonymous|4 $start:std/array~anonymous|5 $start:std/array~anonymous|6 $start:std/array~anonymous|7 $start:std/array~anonymous|8 $start:std/array~anonymous|9 $start:std/array~anonymous|10 $start:std/array~anonymous|11 $start:std/array~anonymous|12 $start:std/array~anonymous|13 $start:std/array~anonymous|14 $start:std/array~anonymous|15 $start:std/array~anonymous|16 $start:std/array~anonymous|17 $start:std/array~anonymous|18 $start:std/array~anonymous|19 $start:std/array~anonymous|20 $start:std/array~anonymous|21 $start:std/array~anonymous|22 $start:std/array~anonymous|23 $start:std/array~anonymous|24 $start:std/array~anonymous|25 $start:std/array~anonymous|26 $start:std/array~anonymous|27 $start:std/array~anonymous|28 $start:std/array~anonymous|29 $start:std/array~anonymous|30 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|34 $start:std/array~anonymous|35 $start:std/array~anonymous|36 $start:std/array~anonymous|37 $start:std/array~anonymous|38 $start:std/array~anonymous|39 $start:std/array~anonymous|40 $start:std/array~anonymous|41 $start:std/array~anonymous|42 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|1 $start:std/array~anonymous|43 $start:std/array~anonymous|44 $start:std/array~anonymous|45 $start:std/array~anonymous|46 $start:std/array~anonymous|47 $start:std/array~anonymous|48 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $std/array/arr (mut i32) (i32.const 0)) - (global $std/array/Null (mut i32) (i32.const 0)) - (global $std/array/arr8 (mut i32) (i32.const 224)) - (global $std/array/arr32 (mut i32) (i32.const 464)) + (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) (global $std/array/i (mut i32) (i32.const 0)) - (global $std/array/other (mut i32) (i32.const 0)) - (global $std/array/out (mut i32) (i32.const 0)) - (global $std/array/source (mut i32) (i32.const 728)) - (global $std/array/cwArr (mut i32) (i32.const 0)) - (global $std/array/includes (mut i32) (i32.const 0)) - (global $std/array/sarr (mut i32) (i32.const 1760)) (global $~lib/argc (mut i32) (i32.const 0)) - (global $std/array/every (mut i32) (i32.const 0)) - (global $std/array/some (mut i32) (i32.const 0)) - (global $std/array/newArr (mut i32) (i32.const 0)) - (global $std/array/filteredArr (mut i32) (i32.const 0)) - (global $std/array/boolVal (mut i32) (i32.const 0)) (global $~lib/math/random_seeded (mut i32) (i32.const 0)) (global $~lib/math/random_state0_64 (mut i64) (i64.const 0)) (global $~lib/math/random_state1_64 (mut i64) (i64.const 0)) (global $~lib/math/random_state0_32 (mut i32) (i32.const 0)) (global $~lib/math/random_state1_32 (mut i32) (i32.const 0)) - (global $std/array/f32ArrayTyped (mut i32) (i32.const 3280)) - (global $std/array/f64ArrayTyped (mut i32) (i32.const 3440)) - (global $std/array/i32ArrayTyped (mut i32) (i32.const 3592)) - (global $std/array/u32ArrayTyped (mut i32) (i32.const 3704)) - (global $std/array/reversed0 (mut i32) (i32.const 3792)) - (global $std/array/reversed1 (mut i32) (i32.const 3848)) - (global $std/array/reversed2 (mut i32) (i32.const 3904)) - (global $std/array/reversed4 (mut i32) (i32.const 3968)) - (global $std/array/expected4 (mut i32) (i32.const 4032)) - (global $std/array/reversed64 (mut i32) (i32.const 0)) - (global $std/array/reversed128 (mut i32) (i32.const 0)) - (global $std/array/reversed1024 (mut i32) (i32.const 0)) - (global $std/array/reversed10000 (mut i32) (i32.const 0)) - (global $std/array/randomized512 (mut i32) (i32.const 0)) - (global $std/array/randomized64 (mut i32) (i32.const 0)) - (global $std/array/randomized257 (mut i32) (i32.const 0)) - (global $std/array/reversedNested512 (mut i32) (i32.const 0)) - (global $std/array/reversedElements512 (mut i32) (i32.const 0)) - (global $std/array/randomStringsActual (mut i32) (i32.const 4272)) - (global $std/array/randomStringsExpected (mut i32) (i32.const 4352)) - (global $std/array/randomStrings400 (mut i32) (i32.const 0)) + (global $std/array/charset i32 (i32.const 3168)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/builtins/i32.MIN_VALUE i32 (i32.const -2147483648)) (global $~lib/util/number/_frc_plus (mut i64) (i64.const 0)) (global $~lib/util/number/_frc_minus (mut i64) (i64.const 0)) (global $~lib/util/number/_exp (mut i32) (i32.const 0)) (global $~lib/util/number/_K (mut i32) (i32.const 0)) (global $~lib/util/number/_frc_pow (mut i64) (i64.const 0)) (global $~lib/util/number/_exp_pow (mut i32) (i32.const 0)) - (global $std/array/refArr (mut i32) (i32.const 0)) - (global $std/array/subarr32 (mut i32) (i32.const 0)) - (global $std/array/subarr8 (mut i32) (i32.const 0)) - (global $std/array/subarrU32 (mut i32) (i32.const 0)) + (global $~lib/builtins/u32.MAX_VALUE i32 (i32.const -1)) + (global $~lib/builtins/i64.MAX_VALUE i64 (i64.const 9223372036854775807)) (global $~lib/started (mut i32) (i32.const 0)) - (global $~lib/runtime/ROOT (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 7720)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 8040)) (export "memory" (memory $0)) (export "main" (func $std/array/main)) - (export "$.instanceof" (func $~lib/runtime/runtime.instanceof)) - (export "$.flags" (func $~lib/runtime/runtime.flags)) - (export "$.newObject" (func $~lib/runtime/runtime.newObject)) - (export "$.newString" (func $~lib/runtime/runtime.newString)) - (export "$.newArrayBuffer" (func $~lib/runtime/runtime.newArrayBuffer)) - (export "$.newArray" (func $~lib/runtime/runtime.newArray)) - (export "$.retain" (func $~lib/runtime/runtime.retain)) - (export "$.release" (func $~lib/runtime/runtime.retain)) - (export "$.collect" (func $~lib/runtime/runtime.collect)) - (func $~lib/allocator/arena/__mem_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (export "__alloc" (func $~lib/rt/tlsf/__alloc)) + (export "__realloc" (func $~lib/rt/tlsf/__realloc)) + (export "__free" (func $~lib/rt/tlsf/__free)) + (export "__retain" (func $~lib/rt/purerc/__retain)) + (export "__release" (func $~lib/rt/purerc/__release)) + (export "__collect" (func $~lib/rt/purerc/__collect)) + (export "__instanceof" (func $~lib/rt/common/__instanceof)) + (export "__typeinfo" (func $~lib/rt/common/__typeinfo)) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 - local.get $0 - i32.const 1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 - i32.and - local.tee $0 - current_memory - local.tee $2 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.tee $3 - local.get $2 - local.get $3 - i32.gt_s - select - grow_memory - i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $0 - global.set $~lib/allocator/arena/offset + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) local.get $1 - ) - (func $~lib/util/runtime/allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 15 - i32.add - i32.clz - i32.sub - i32.shl - call $~lib/allocator/arena/__mem_allocate - local.tee $1 - i32.const -1520547049 - i32.store - local.get $1 - local.get $0 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.store offset=8 - local.get $1 - i32.const 0 - i32.store offset=12 - local.get $1 - i32.const 16 - i32.add - ) - (func $~lib/memory/memory.fill (; 4 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i64) - block $~lib/util/memory/memset|inlined.0 - local.get $2 - i32.eqz - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - local.tee $3 - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $3 - i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $2 - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.tee $2 - i32.sub - local.set $3 - local.get $0 - local.get $2 - i32.add - local.tee $0 - local.get $1 - i32.const 255 - i32.and - i32.const 16843009 - i32.mul - local.tee $1 - i32.store - local.get $3 - i32.const -4 - i32.and - local.tee $2 - local.get $0 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store - local.get $2 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.store - local.get $0 - local.get $2 - i32.add - local.tee $3 - i32.const 12 - i32.sub - local.get $1 - i32.store - local.get $3 - i32.const 8 - i32.sub - local.get $1 - i32.store - local.get $2 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $1 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $1 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $1 - i32.store - local.get $0 - local.get $2 - i32.add - local.tee $3 - i32.const 28 - i32.sub - local.get $1 - i32.store - local.get $3 - i32.const 24 - i32.sub - local.get $1 - i32.store - local.get $3 - i32.const 20 - i32.sub - local.get $1 - i32.store - local.get $3 - i32.const 16 - i32.sub - local.get $1 - i32.store - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $3 - local.get $0 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $1 - i64.extend_i32_u - local.tee $4 - local.get $4 - i64.const 32 - i64.shl - i64.or - local.set $4 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - local.get $0 - local.get $4 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 - end - end - end - ) - (func $~lib/util/runtime/register (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $0 - i32.const 8400 - i32.le_u - if - i32.const 0 - i32.const 80 - i32.const 129 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.const 16 - i32.sub - local.tee $2 i32.load - i32.const -1520547049 - i32.ne + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz if i32.const 0 - i32.const 80 - i32.const 131 - i32.const 4 + i32.const 128 + i32.const 275 + i32.const 13 call $~lib/builtins/abort unreachable end local.get $2 - local.get $1 - i32.store - local.get $0 - ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 1073741808 - i32.gt_u + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if i32.const 0 - i32.const 24 - i32.const 54 - i32.const 43 + i32.const 128 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 446 + i32.const 29 call $~lib/builtins/abort unreachable end local.get $0 - call $~lib/util/runtime/allocate - local.tee $1 - i32.const 0 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 i32.const 15 - call $~lib/util/runtime/register + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select ) - (func $~lib/arraybuffer/ArrayBufferView#constructor (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 15 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) local.get $1 i32.const 1073741808 local.get $2 i32.shr_u i32.gt_u if - i32.const 0 i32.const 24 - i32.const 12 - i32.const 57 + i32.const 72 + i32.const 14 + i32.const 56 call $~lib/builtins/abort unreachable end local.get $1 local.get $2 i32.shl + local.tee $1 + i32.const 15 + call $~lib/rt/tlsf/__alloc + local.set $3 + block (result i32) + local.get $0 + i32.eqz + if + i32.const 12 + i32.const 14 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + end + local.tee $4 + local.get $3 + local.get $4 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $0 + local.get $3 + i32.store offset=4 + local.get $0 + local.get $1 + i32.store offset=8 + local.get $0 + ) + (func $~lib/array/Array#constructor (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 16 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + end + local.get $1 + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor local.tee $2 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $1 + local.set $0 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $0 + ) + (func $~lib/array/Array.isArray<~lib/array/Array | null> (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release + i32.const 1 + if (result i32) + local.get $0 + i32.const 0 + i32.ne + else + i32.const 0 + end + ) + (func $~lib/array/Array.isArray<~lib/array/Array> (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release + i32.const 1 + if (result i32) + local.get $0 + i32.const 0 + i32.ne + else + i32.const 0 + end + ) + (func $std/array/P#constructor (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if - i32.const 12 - call $~lib/util/runtime/allocate - i32.const 14 - call $~lib/util/runtime/register + i32.const 0 + i32.const 18 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 - i32.const 0 - i32.store + ) + (func $~lib/array/Array.isArray (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.load + call $~lib/rt/purerc/__retain drop local.get $0 - local.get $1 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - local.get $0 - local.get $2 - i32.store offset=8 - local.get $0 - ) - (func $~lib/array/Array#constructor (; 8 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 16 - call $~lib/util/runtime/allocate - i32.const 17 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__release + i32.const 0 + if (result i32) + local.get $0 + i32.const 0 + i32.ne + else + i32.const 0 + end + ) + (func $~lib/typedarray/Uint8Array#constructor (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 12 + i32.const 19 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + end + local.get $1 i32.const 0 - i32.const 2 call $~lib/arraybuffer/ArrayBufferView#constructor - local.tee $0 - i32.const 0 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=12 + local.tee $2 + local.set $0 local.get $0 ) - (func $~lib/array/Array#fill (; 9 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/array/Array.isArray<~lib/typedarray/Uint8Array> (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release + i32.const 0 + if (result i32) + local.get $0 + i32.const 0 + i32.ne + else + i32.const 0 + end + ) + (func $~lib/array/Array.isArray (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 0 + if (result i32) + local.get $0 + i32.const 0 + i32.ne + else + i32.const 0 + end + ) + (func $~lib/array/Array.isArray<~lib/string/String> (; 24 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release + i32.const 0 + if (result i32) + local.get $0 + i32.const 0 + i32.ne + else + i32.const 0 + end + ) + (func $~lib/rt/purerc/increment (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) local.get $0 i32.load offset=4 - local.set $5 - local.get $0 - i32.load offset=12 - local.set $4 - local.get $2 - i32.const 0 - i32.lt_s - if (result i32) - local.get $2 - local.get $4 - i32.add - local.tee $0 - i32.const 0 - local.get $0 - i32.const 0 - i32.gt_s - select - else - local.get $2 - local.get $4 - local.get $2 - local.get $4 - i32.lt_s - select - end - local.tee $0 - local.get $3 - i32.const 0 - i32.lt_s - if (result i32) - local.get $3 - local.get $4 - i32.add - local.tee $2 - i32.const 0 - local.get $2 - i32.const 0 - i32.gt_s - select - else - local.get $3 - local.get $4 - local.get $3 - local.get $4 - i32.lt_s - select - end - local.tee $2 - i32.lt_s + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz if - local.get $0 - local.get $5 - i32.add - local.get $1 - local.get $2 - local.get $0 - i32.sub - call $~lib/memory/memory.fill + i32.const 0 + i32.const 320 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 320 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable end ) - (func $~lib/memory/memory.copy (; 10 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/purerc/__retain (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/memory/memory.copy (; 27 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) block $~lib/util/memory/memmove|inlined.0 local.get $0 + local.set $5 local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 i32.eq - br_if $~lib/util/memory/memmove|inlined.0 - local.get $0 - local.get $1 + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 i32.lt_u if - local.get $1 + local.get $4 i32.const 7 i32.and - local.get $0 + local.get $5 i32.const 7 i32.and i32.eq if - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - br_if $~lib/util/memory/memmove|inlined.0 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - br $continue|0 + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end end end - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 + block $break|1 + loop $continue|1 + local.get $3 i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - br $continue|1 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end end end end - loop $continue|2 - local.get $2 - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 + block $break|2 + loop $continue|2 local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|2 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end end end else - local.get $1 + local.get $4 i32.const 7 i32.and - local.get $0 + local.get $5 i32.const 7 i32.and i32.eq if - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - br_if $~lib/util/memory/memmove|inlined.0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|3 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end end end - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $2 + block $break|4 + loop $continue|4 + local.get $3 i32.const 8 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - br $continue|4 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end end end end - loop $continue|5 - local.get $2 - if - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end end end end end ) - (func $~lib/util/runtime/makeArray (; 11 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/rt/common/__allocArray (; 28 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) + (local $6 i32) i32.const 16 - call $~lib/util/runtime/allocate local.get $2 - call $~lib/util/runtime/register - local.set $2 + call $~lib/rt/tlsf/__alloc + local.set $4 local.get $0 local.get $1 i32.shl - local.tee $4 - call $~lib/util/runtime/allocate - i32.const 15 - call $~lib/util/runtime/register - local.tee $1 local.set $5 - local.get $2 - i32.load - drop - local.get $2 local.get $5 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 + i32.const 15 + call $~lib/rt/tlsf/__alloc + local.set $6 local.get $4 + local.get $6 + call $~lib/rt/purerc/__retain + i32.store + local.get $4 + local.get $6 + i32.store offset=4 + local.get $4 + local.get $5 i32.store offset=8 - local.get $2 + local.get $4 local.get $0 i32.store offset=12 local.get $3 if - local.get $1 + local.get $6 local.get $3 - local.get $4 + local.get $5 call $~lib/memory/memory.copy end - local.get $2 + local.get $4 ) - (func $~lib/array/Array#__get (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/memory/memory.fill (; 29 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $continue|0 + end + end + end + end + ) + (func $~lib/array/Array#fill (; 30 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=12 + local.set $5 + local.get $2 + i32.const 0 + i32.lt_s + if (result i32) + local.get $5 + local.get $2 + i32.add + local.tee $6 + i32.const 0 + local.tee $7 + local.get $6 + local.get $7 + i32.gt_s + select + else + local.get $2 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + end + local.set $2 + local.get $3 + i32.const 0 + i32.lt_s + if (result i32) + local.get $5 + local.get $3 + i32.add + local.tee $6 + i32.const 0 + local.tee $7 + local.get $6 + local.get $7 + i32.gt_s + select + else + local.get $3 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + end + local.set $3 + local.get $2 + local.get $3 + i32.lt_s + if + local.get $4 + local.get $2 + i32.add + local.get $1 + local.get $3 + local.get $2 + i32.sub + call $~lib/memory/memory.fill + end + local.get $0 + call $~lib/rt/purerc/__retain + ) + (func $~lib/array/Array#get:length (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array#__unchecked_get (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 0 + i32.shl + i32.add + i32.load8_u + ) + (func $~lib/array/Array#__get (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 + i32.const 0 + i32.shr_u i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 99 + i32.const 400 + i32.const 456 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable end local.get $0 - i32.load offset=4 local.get $1 - i32.add - i32.load8_u + call $~lib/array/Array#__unchecked_get ) - (func $std/array/isArraysEqual (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $std/array/isArraysEqual (; 34 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 - i32.load offset=12 - local.tee $3 + call $~lib/rt/purerc/__retain + drop local.get $1 - i32.load offset=12 - i32.ne + call $~lib/rt/purerc/__retain + drop + local.get $2 + i32.eqz if - i32.const 0 - return - end - local.get $0 - local.get $1 - i32.eq - if - i32.const 1 - return - end - loop $repeat|0 + local.get $0 + call $~lib/array/Array#get:length + local.set $2 local.get $2 - local.get $3 - i32.lt_s + local.get $1 + call $~lib/array/Array#get:length + i32.ne if local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $0 + local.get $1 + i32.eq + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 1 + return + end + end + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 call $~lib/array/Array#__get local.get $1 - local.get $2 + local.get $3 call $~lib/array/Array#__get i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return - else - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 unreachable end + unreachable end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $~lib/array/Array#fill (; 14 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/array/Array#fill (; 35 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) local.get $0 i32.load offset=4 local.set $4 local.get $0 i32.load offset=12 - local.set $0 + local.set $5 local.get $2 i32.const 0 i32.lt_s if (result i32) - local.get $0 + local.get $5 local.get $2 i32.add - local.tee $2 - i32.const 0 - local.get $2 + local.tee $6 i32.const 0 + local.tee $7 + local.get $6 + local.get $7 i32.gt_s select else local.get $2 - local.get $0 - local.get $2 - local.get $0 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select end @@ -1289,33 +2580,38 @@ i32.const 0 i32.lt_s if (result i32) - local.get $0 + local.get $5 local.get $3 i32.add - local.tee $0 - i32.const 0 - local.get $0 + local.tee $6 i32.const 0 + local.tee $7 + local.get $6 + local.get $7 i32.gt_s select else local.get $3 - local.get $0 - local.get $3 - local.get $0 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select end - local.set $0 - loop $repeat|0 - local.get $2 - local.get $0 - i32.lt_s - if + local.set $3 + block $break|0 + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 local.get $2 i32.const 2 i32.shl - local.get $4 i32.add local.get $1 i32.store @@ -1324,24 +2620,18 @@ i32.add local.set $2 br $repeat|0 + unreachable end - end - ) - (func $~lib/array/Array#__get (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $1 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - i32.ge_u - if - i32.const 0 - i32.const 280 - i32.const 99 - i32.const 61 - call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__retain + ) + (func $~lib/array/Array#get:length (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array#__unchecked_get (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -1350,18 +2640,48 @@ i32.add i32.load ) - (func $std/array/isArraysEqual (; 16 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#__get (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 400 + i32.const 456 + i32.const 100 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + ) + (func $std/array/isArraysEqual (; 39 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.eqz if local.get $0 - i32.load offset=12 - local.tee $2 + call $~lib/array/Array#get:length + local.set $2 + local.get $2 local.get $1 - i32.load offset=12 + call $~lib/array/Array#get:length i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -1369,15 +2689,23 @@ local.get $1 i32.eq if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end end - loop $repeat|0 - local.get $3 - local.get $2 - i32.lt_s - if + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 local.get $0 local.get $3 call $~lib/array/Array#__get @@ -1386,184 +2714,308 @@ call $~lib/array/Array#__get i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return - else - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $repeat|0 end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 unreachable end + unreachable end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $~lib/util/runtime/reallocate (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/array/Array#get:length (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 41 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 16 i32.sub - local.tee $4 - i32.load offset=4 - local.tee $2 + i32.load offset=12 + ) + (func $std/array/internalCapacity (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load + call $~lib/rt/purerc/__retain + local.set $1 + local.get $0 + call $~lib/rt/purerc/__release local.get $1 - i32.lt_u + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + i32.const 2 + i32.shr_s + ) + (func $~lib/rt/tlsf/reallocateBlock (; 43 ;) (type $FUNCSIG$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) + (local $8 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $1 + i32.load + local.set $4 + local.get $4 + i32.const 1 + i32.and + i32.eqz + i32.eqz if - i32.const 1 - i32.const 32 - local.get $1 - i32.const 15 - i32.add - i32.clz - i32.sub - i32.shl - local.tee $3 - local.set $5 - i32.const 1 - i32.const 32 - local.get $2 - i32.const 15 - i32.add - i32.clz - i32.sub - i32.shl i32.const 0 + i32.const 128 + i32.const 491 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const -4 + i32.and + i32.le_u + if local.get $0 - i32.const 8400 - i32.gt_u - select + local.get $1 local.get $3 - i32.lt_u + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + block $~lib/rt/tlsf/GETRIGHT|inlined.4 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $6 + local.get $6 + i32.load + local.set $7 + local.get $7 + i32.const 1 + i32.and + if + local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $7 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $5 + local.get $5 + local.get $3 + i32.ge_u if - local.get $5 - call $~lib/allocator/arena/__mem_allocate - local.tee $3 + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 local.get $4 - i32.load + i32.const 3 + i32.and + local.get $5 + i32.or i32.store - local.get $3 - i32.const 0 - i32.store offset=8 - local.get $3 - i32.const 0 + local.get $1 + local.get $2 i32.store offset=12 - local.get $3 - i32.const 16 - i32.add - local.tee $5 local.get $0 - local.get $2 - call $~lib/memory/memory.copy - local.get $2 - local.get $5 - i32.add - i32.const 0 local.get $1 - local.get $2 - i32.sub - call $~lib/memory/memory.fill - local.get $4 - i32.load - i32.const -1520547049 - i32.eq - if - local.get $0 - i32.const 8400 - i32.le_u - if - i32.const 0 - i32.const 80 - i32.const 89 - i32.const 8 - call $~lib/builtins/abort - unreachable - end - end local.get $3 - local.set $4 - local.get $5 - local.set $0 - else - local.get $0 - local.get $2 - i32.add - i32.const 0 + call $~lib/rt/tlsf/prepareBlock local.get $1 - local.get $2 - i32.sub - call $~lib/memory/memory.fill + return end end - local.get $4 - local.get $1 - i32.store offset=4 local.get $0 - ) - (func $~lib/array/ensureCapacity (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) + local.get $2 + call $~lib/rt/tlsf/allocateBlock + local.set $8 + local.get $8 local.get $1 + i32.load offset=4 + i32.store offset=4 + local.get $8 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $8 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + local.get $8 + ) + (func $~lib/rt/tlsf/__realloc (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 552 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 553 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/array/ensureSize (; 45 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 i32.load offset=8 - i32.const 2 + local.set $3 + local.get $1 + local.get $3 + local.get $2 i32.shr_u i32.gt_u if local.get $1 - i32.const 268435452 + i32.const 1073741808 + local.get $2 + i32.shr_u i32.gt_u if - i32.const 0 - i32.const 280 + i32.const 24 + i32.const 456 i32.const 14 - i32.const 64 + i32.const 47 call $~lib/builtins/abort unreachable end local.get $0 i32.load - local.tee $2 - local.get $1 - i32.const 2 - i32.shl - local.tee $3 - call $~lib/util/runtime/reallocate - local.set $1 + local.set $4 local.get $1 local.get $2 + i32.shl + local.set $5 + local.get $4 + local.get $5 + call $~lib/rt/tlsf/__realloc + local.set $6 + local.get $6 + local.get $3 + i32.add + i32.const 0 + local.get $5 + local.get $3 + i32.sub + call $~lib/memory/memory.fill + local.get $6 + local.get $4 i32.ne if local.get $0 - i32.load - drop - local.get $0 - local.get $1 + local.get $6 + call $~lib/rt/purerc/__retain i32.store local.get $0 - local.get $1 + local.get $6 i32.store offset=4 end local.get $0 - local.get $3 + local.get $5 i32.store offset=8 end ) - (func $~lib/array/Array#push (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#push (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 - local.get $0 i32.load offset=12 - local.tee $2 + local.set $2 + local.get $2 i32.const 1 i32.add - local.tee $3 - call $~lib/array/ensureCapacity + local.set $3 + local.get $0 + local.get $3 + i32.const 2 + call $~lib/array/ensureSize local.get $0 i32.load offset=4 local.get $2 @@ -1575,18 +3027,458 @@ local.get $0 local.get $3 i32.store offset=12 + local.get $3 ) - (func $~lib/array/Array#pop (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + ) + (func $~lib/array/Array#__get (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 400 + i32.const 456 + i32.const 100 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + ) + (func $~lib/array/Array#pop (; 49 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 i32.load offset=12 - local.tee $1 + local.set $1 + local.get $1 i32.const 1 i32.lt_s if + i32.const 840 + i32.const 456 + i32.const 250 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.sub + local.tee $1 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $2 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $2 + ) + (func $~lib/array/Array#concat (; 50 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + local.set $2 + i32.const 0 + local.get $1 + i32.load offset=12 + local.get $1 + i32.const 0 + i32.eq + select + local.set $3 + local.get $2 + local.get $3 + i32.add + local.set $4 + local.get $4 + i32.const 268435452 + i32.gt_u + if + local.get $1 + call $~lib/rt/purerc/__release + block + i32.const 24 + i32.const 456 + i32.const 197 + i32.const 59 + call $~lib/builtins/abort + unreachable + unreachable + end + unreachable + end + local.get $4 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $5 + local.get $5 + i32.load offset=4 + local.set $6 + local.get $2 + i32.const 2 + i32.shl + local.set $7 + local.get $6 + local.get $0 + i32.load offset=4 + local.get $7 + call $~lib/memory/memory.copy + local.get $6 + local.get $7 + i32.add + local.get $1 + i32.load offset=4 + local.get $3 + i32.const 2 + i32.shl + call $~lib/memory/memory.copy + local.get $5 + local.set $8 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + ) + (func $~lib/array/Array#copyWithin (; 51 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=12 + local.set $5 + local.get $3 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + local.set $3 + local.get $1 + i32.const 0 + i32.lt_s + if (result i32) + local.get $5 + local.get $1 + i32.add + local.tee $6 i32.const 0 - i32.const 280 + local.tee $7 + local.get $6 + local.get $7 + i32.gt_s + select + else + local.get $1 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + end + local.set $8 + local.get $2 + i32.const 0 + i32.lt_s + if (result i32) + local.get $5 + local.get $2 + i32.add + local.tee $6 + i32.const 0 + local.tee $7 + local.get $6 + local.get $7 + i32.gt_s + select + else + local.get $2 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + end + local.set $9 + local.get $3 + i32.const 0 + i32.lt_s + if (result i32) + local.get $5 + local.get $3 + i32.add + local.tee $6 + i32.const 0 + local.tee $7 + local.get $6 + local.get $7 + i32.gt_s + select + else + local.get $3 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + end + local.set $10 + local.get $10 + local.get $9 + i32.sub + local.tee $6 + local.get $5 + local.get $8 + i32.sub + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + local.set $11 + local.get $9 + local.get $8 + i32.lt_s + if (result i32) + local.get $8 + local.get $9 + local.get $11 + i32.add + i32.lt_s + else + i32.const 0 + end + if + local.get $9 + local.get $11 + i32.const 1 + i32.sub + i32.add + local.set $9 + local.get $8 + local.get $11 + i32.const 1 + i32.sub + i32.add + local.set $8 + block $break|0 + loop $continue|0 + local.get $11 + if + local.get $4 + local.get $8 + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $9 + i32.const 2 + i32.shl + i32.add + i32.load + i32.store + local.get $9 + i32.const 1 + i32.sub + local.set $9 + local.get $8 + i32.const 1 + i32.sub + local.set $8 + local.get $11 + i32.const 1 + i32.sub + local.set $11 + br $continue|0 + end + end + end + else + local.get $4 + local.get $8 + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $9 + i32.const 2 + i32.shl + i32.add + local.get $11 + i32.const 2 + i32.shl + call $~lib/memory/memory.copy + end + local.get $0 + call $~lib/rt/purerc/__retain + ) + (func $std/array/isArraysEqual (; 52 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $2 + i32.eqz + if + local.get $0 + call $~lib/array/Array#get:length + local.set $2 + local.get $2 + local.get $1 + call $~lib/array/Array#get:length + i32.ne + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $0 + local.get $1 + i32.eq + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 1 + return + end + end + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + local.get $1 + local.get $3 + call $~lib/array/Array#__get + i32.ne + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 1 + ) + (func $~lib/array/Array#unshift (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=12 + i32.const 1 + i32.add + local.set $2 + local.get $0 + local.get $2 + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 4 + i32.add + local.get $3 + local.get $2 + i32.const 1 + i32.sub + i32.const 2 + i32.shl + call $~lib/memory/memory.copy + local.get $3 + local.get $1 + i32.store + local.get $0 + local.get $2 + i32.store offset=12 + local.get $2 + ) + (func $~lib/array/Array#shift (; 54 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=12 + local.set $1 + local.get $1 + i32.const 1 + i32.lt_s + if + i32.const 840 + i32.const 456 i32.const 311 i32.const 20 call $~lib/builtins/abort @@ -1594,366 +3486,105 @@ end local.get $0 i32.load offset=4 + local.set $2 + local.get $2 + i32.load + local.set $3 local.get $1 i32.const 1 i32.sub - local.tee $1 + local.set $4 + local.get $2 + local.get $2 + i32.const 4 + i32.add + local.get $4 + i32.const 2 + i32.shl + call $~lib/memory/memory.copy + local.get $2 + local.get $4 i32.const 2 i32.shl i32.add - i32.load - local.set $2 + i32.const 0 + i32.store local.get $0 - local.get $1 + local.get $4 i32.store offset=12 - local.get $2 + local.get $3 ) - (func $~lib/array/Array#concat (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#reverse (; 55 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) local.get $0 i32.load offset=12 - local.tee $3 - local.get $1 - i32.load offset=12 - i32.const 0 - local.get $1 - select - local.tee $4 - i32.add - local.tee $2 - i32.const 268435452 - i32.gt_u - if - i32.const 0 - i32.const 280 - i32.const 236 - i32.const 60 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const 2 - i32.const 17 - i32.const 0 - call $~lib/util/runtime/makeArray - local.tee $2 - i32.load offset=4 - local.tee $5 - local.get $0 - i32.load offset=4 - local.get $3 - i32.const 2 - i32.shl - local.tee $0 - call $~lib/memory/memory.copy - local.get $0 - local.get $5 - i32.add - local.get $1 - i32.load offset=4 - local.get $4 - i32.const 2 - i32.shl - call $~lib/memory/memory.copy - local.get $2 - ) - (func $~lib/array/Array#copyWithin (; 22 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=4 - local.set $5 - local.get $3 - local.get $0 - i32.load offset=12 - local.tee $4 - local.get $3 - local.get $4 - i32.lt_s - select - local.set $3 - local.get $1 - i32.const 0 - i32.lt_s - if (result i32) - local.get $1 - local.get $4 - i32.add - local.tee $1 - i32.const 0 - local.get $1 - i32.const 0 - i32.gt_s - select - else - local.get $1 - local.get $4 - local.get $1 - local.get $4 - i32.lt_s - select - end local.set $1 - local.get $2 - i32.const 0 - i32.lt_s - if (result i32) - local.get $2 - local.get $4 - i32.add - local.tee $2 - i32.const 0 - local.get $2 - i32.const 0 - i32.gt_s - select - else - local.get $2 - local.get $4 - local.get $2 - local.get $4 - i32.lt_s - select - end - local.set $2 - local.get $3 - i32.const 0 - i32.lt_s - if (result i32) - local.get $3 - local.get $4 - i32.add - local.tee $3 - i32.const 0 - local.get $3 - i32.const 0 - i32.gt_s - select - else - local.get $3 - local.get $4 - local.get $3 - local.get $4 - i32.lt_s - select - end - local.get $2 - i32.sub - local.tee $3 - local.get $4 local.get $1 - i32.sub - local.tee $4 - local.get $3 - local.get $4 - i32.lt_s - select - local.set $3 - local.get $1 - local.get $2 - local.get $3 - i32.add - i32.lt_s - i32.const 0 - local.get $2 - local.get $1 - i32.lt_s - select if - local.get $3 + local.get $0 + i32.load offset=4 + local.set $2 + local.get $0 + i32.load offset=4 + local.get $1 i32.const 1 i32.sub - local.tee $4 - local.get $2 + i32.const 2 + i32.shl i32.add - local.set $2 - local.get $1 - local.get $4 - i32.add - local.set $1 - loop $continue|0 - local.get $3 - if - local.get $1 - i32.const 2 - i32.shl - local.get $5 - i32.add + local.set $3 + block $break|0 + loop $continue|0 local.get $2 - i32.const 2 - i32.shl - local.get $5 - i32.add - i32.load - i32.store - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $1 - i32.const 1 - i32.sub - local.set $1 local.get $3 - i32.const 1 - i32.sub - local.set $3 - br $continue|0 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $2 + local.get $3 + i32.load + i32.store + local.get $3 + local.get $4 + i32.store + local.get $2 + i32.const 4 + i32.add + local.set $2 + local.get $3 + i32.const 4 + i32.sub + local.set $3 + br $continue|0 + end end end - else - local.get $1 - i32.const 2 - i32.shl - local.get $5 - i32.add - local.get $2 - i32.const 2 - i32.shl - local.get $5 - i32.add - local.get $3 - i32.const 2 - i32.shl - call $~lib/memory/memory.copy end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array#unshift (; 23 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - local.get $0 - i32.load offset=12 - i32.const 1 - i32.add - local.tee $2 - call $~lib/array/ensureCapacity - local.get $0 - i32.load offset=4 - local.tee $3 - i32.const 4 - i32.add - local.get $3 - local.get $2 - i32.const 1 - i32.sub - i32.const 2 - i32.shl - call $~lib/memory/memory.copy - local.get $3 - local.get $1 - i32.store - local.get $0 - local.get $2 - i32.store offset=12 - ) - (func $~lib/array/Array#shift (; 24 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) + (func $~lib/array/Array#indexOf (; 56 ;) (type $FUNCSIG$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.get $0 i32.load offset=12 - local.tee $1 - i32.const 1 - i32.lt_s - if - i32.const 0 - i32.const 280 - i32.const 383 - i32.const 20 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=4 - local.tee $2 - i32.load local.set $3 - local.get $2 - local.get $2 - i32.const 4 - i32.add - local.get $1 - i32.const 1 - i32.sub - local.tee $1 - i32.const 2 - i32.shl - local.tee $4 - call $~lib/memory/memory.copy - local.get $2 - local.get $4 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.store offset=12 local.get $3 - ) - (func $~lib/array/Array#reverse (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.load offset=12 - local.tee $2 - if - local.get $0 - i32.load offset=4 - local.set $1 - local.get $0 - i32.load offset=4 - local.get $2 - i32.const 1 - i32.sub - i32.const 2 - i32.shl - i32.add - local.set $0 - loop $continue|0 - local.get $1 - local.get $0 - i32.lt_u - if - local.get $1 - i32.load - local.set $2 - local.get $1 - local.get $0 - i32.load - i32.store - local.get $0 - local.get $2 - i32.store - local.get $1 - i32.const 4 - i32.add - local.set $1 - local.get $0 - i32.const 4 - i32.sub - local.set $0 - br $continue|0 - end - end - end - ) - (func $~lib/array/Array#indexOf (; 26 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - local.get $0 - i32.load offset=12 - local.tee $3 + i32.const 0 + i32.eq if (result i32) + i32.const 1 + else local.get $2 local.get $3 i32.ge_s - else - i32.const 1 end if i32.const -1 @@ -1963,47 +3594,50 @@ i32.const 0 i32.lt_s if - local.get $2 local.get $3 - i32.add - local.tee $2 - i32.const 0 local.get $2 + i32.add + local.tee $4 i32.const 0 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select local.set $2 end local.get $0 i32.load offset=4 - local.set $0 - loop $continue|0 - local.get $2 - local.get $3 - i32.lt_s - if + local.set $6 + block $break|0 + loop $continue|0 local.get $2 - i32.const 2 - i32.shl - local.get $0 - i32.add - i32.load - local.get $1 - i32.eq + local.get $3 + i32.lt_s if + local.get $6 local.get $2 - return + i32.const 2 + i32.shl + i32.add + i32.load + local.get $1 + i32.eq + if + local.get $2 + return + end + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $continue|0 end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $continue|0 end end i32.const -1 ) - (func $~lib/array/Array#includes (; 27 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#includes (; 57 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 local.get $1 local.get $2 @@ -2011,67 +3645,82 @@ i32.const 0 i32.ge_s ) - (func $~lib/array/Array#splice (; 28 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#splice (; 58 ;) (type $FUNCSIG$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.get $2 + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) local.get $0 i32.load offset=12 - local.tee $3 + local.set $3 local.get $1 i32.const 0 i32.lt_s if (result i32) - local.get $1 local.get $3 - i32.add - local.tee $1 - i32.const 0 local.get $1 + i32.add + local.tee $4 i32.const 0 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select else local.get $1 + local.tee $4 local.get $3 - local.get $1 - local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select end - local.tee $1 - i32.sub - local.tee $4 + local.set $1 local.get $2 + local.tee $4 + local.get $3 + local.get $1 + i32.sub + local.tee $5 local.get $4 + local.get $5 i32.lt_s select - local.tee $2 - i32.const 0 - local.get $2 + local.tee $4 i32.const 0 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - local.tee $2 + local.set $2 + local.get $2 i32.const 2 i32.const 17 i32.const 0 - call $~lib/util/runtime/makeArray - local.tee $4 - i32.load offset=4 - drop - local.get $4 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $6 + local.get $6 i32.load offset=4 + local.set $7 local.get $0 i32.load offset=4 - local.tee $5 + local.set $8 + local.get $8 local.get $1 i32.const 2 i32.shl i32.add - local.tee $6 + local.set $9 + local.get $7 + local.get $9 local.get $2 i32.const 2 i32.shl @@ -2079,18 +3728,19 @@ local.get $1 local.get $2 i32.add - local.tee $1 + local.set $10 local.get $3 + local.get $10 i32.ne if - local.get $6 - local.get $1 + local.get $9 + local.get $8 + local.get $10 i32.const 2 i32.shl - local.get $5 i32.add local.get $3 - local.get $1 + local.get $10 i32.sub i32.const 2 i32.shl @@ -2101,18 +3751,9 @@ local.get $2 i32.sub i32.store offset=12 - local.get $4 + local.get $6 ) - (func $~lib/array/Array#__set (; 29 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - local.get $0 - i32.load offset=12 - local.set $3 - local.get $0 - local.get $1 - i32.const 1 - i32.add - call $~lib/array/ensureCapacity + (func $~lib/array/Array#__unchecked_set (; 59 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $0 i32.load offset=4 local.get $1 @@ -2121,6 +3762,22 @@ i32.add local.get $2 i32.store + ) + (func $~lib/array/Array#__set (; 60 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=12 + local.set $3 + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + local.get $1 + local.get $2 + call $~lib/array/Array#__unchecked_set local.get $1 local.get $3 i32.ge_s @@ -2132,267 +3789,428 @@ i32.store offset=12 end ) - (func $start:std/array~anonymous|0 (; 30 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|0 (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 - i32.eqz + i32.const 0 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#findIndex (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#findIndex (; 62 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $0 - i32.load offset=12 - local.set $3 - loop $repeat|0 - block $break|0 - local.get $2 - local.get $3 + (local $5 i32) + block $break|0 + block + i32.const 0 + local.set $2 local.get $0 i32.load offset=12 - local.tee $4 + local.set $3 + end + loop $repeat|0 + local.get $2 local.get $3 + local.tee $4 + local.get $0 + i32.load offset=12 + local.tee $5 local.get $4 + local.get $5 i32.lt_s select - i32.ge_s + i32.lt_s + i32.eqz br_if $break|0 - i32.const 3 - global.set $~lib/argc - local.get $0 - i32.load offset=4 - local.get $2 - i32.const 2 - i32.shl - i32.add - i32.load - local.get $2 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiii) + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.load offset=4 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $2 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiii) + end if local.get $2 return - else - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 end + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 unreachable end + unreachable end i32.const -1 ) - (func $start:std/array~anonymous|1 (; 32 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|1 (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 1 i32.eq - ) - (func $start:std/array~anonymous|2 (; 33 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const 100 - i32.eq - ) - (func $start:std/array~anonymous|3 (; 34 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.set $3 local.get $2 - i32.const 100 - call $~lib/array/Array#push - local.get $0 - i32.const 100 - i32.eq + call $~lib/rt/purerc/__release + local.get $3 ) - (func $start:std/array~anonymous|5 (; 35 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|2 (; 64 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $2 - call $~lib/array/Array#pop + call $~lib/rt/purerc/__retain drop local.get $0 i32.const 100 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $start:std/array~anonymous|6 (; 36 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|3 (; 65 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop + local.get $2 + i32.const 100 + call $~lib/array/Array#push + drop + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + i32.const 100 + i32.eq + ) + (func $start:std/array~anonymous|4 (; 66 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.const 100 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 + ) + (func $start:std/array~anonymous|5 (; 67 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop + local.get $2 + call $~lib/array/Array#pop + drop + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + i32.const 100 + i32.eq + ) + (func $start:std/array~anonymous|6 (; 68 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 0 i32.ge_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#every (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#every (; 69 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $0 - i32.load offset=12 - local.set $3 - loop $repeat|0 - block $break|0 - local.get $2 - local.get $3 + (local $5 i32) + block $break|0 + block + i32.const 0 + local.set $2 local.get $0 i32.load offset=12 - local.tee $4 + local.set $3 + end + loop $repeat|0 + local.get $2 local.get $3 + local.tee $4 + local.get $0 + i32.load offset=12 + local.tee $5 local.get $4 + local.get $5 i32.lt_s select - i32.ge_s + i32.lt_s + i32.eqz br_if $break|0 - i32.const 3 - global.set $~lib/argc - local.get $0 - i32.load offset=4 - local.get $2 - i32.const 2 - i32.shl - i32.add - i32.load - local.get $2 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiii) - if + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.load offset=4 local.get $2 - i32.const 1 + i32.const 2 + i32.shl i32.add - local.set $2 - br $repeat|0 - else + i32.load + local.get $2 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiii) + end + i32.const 0 + i32.ne + i32.eqz + if i32.const 0 return end + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 unreachable end + unreachable end i32.const 1 ) - (func $start:std/array~anonymous|7 (; 38 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|7 (; 70 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 0 i32.le_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $start:std/array~anonymous|8 (; 39 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|8 (; 71 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push + drop + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 10 i32.lt_s ) - (func $start:std/array~anonymous|9 (; 40 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|9 (; 72 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 10 i32.lt_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $start:std/array~anonymous|10 (; 41 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|10 (; 73 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 call $~lib/array/Array#pop drop + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 3 i32.lt_s ) - (func $start:std/array~anonymous|11 (; 42 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|11 (; 74 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 3 i32.ge_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#some (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#some (; 75 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $0 - i32.load offset=12 - local.set $3 - loop $repeat|0 - block $break|0 - local.get $2 - local.get $3 + (local $5 i32) + block $break|0 + block + i32.const 0 + local.set $2 local.get $0 i32.load offset=12 - local.tee $4 + local.set $3 + end + loop $repeat|0 + local.get $2 local.get $3 + local.tee $4 + local.get $0 + i32.load offset=12 + local.tee $5 local.get $4 + local.get $5 i32.lt_s select - i32.ge_s + i32.lt_s + i32.eqz br_if $break|0 - i32.const 3 - global.set $~lib/argc - local.get $0 - i32.load offset=4 - local.get $2 - i32.const 2 - i32.shl - i32.add - i32.load - local.get $2 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiii) + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.load offset=4 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $2 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiii) + end if i32.const 1 return - else - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 end + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 unreachable end + unreachable end i32.const 0 ) - (func $start:std/array~anonymous|12 (; 44 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|12 (; 76 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const -1 i32.le_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $start:std/array~anonymous|13 (; 45 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|13 (; 77 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push + drop + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 10 i32.gt_s ) - (func $start:std/array~anonymous|14 (; 46 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|14 (; 78 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 10 i32.gt_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $start:std/array~anonymous|15 (; 47 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|15 (; 79 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 call $~lib/array/Array#pop drop + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 3 i32.gt_s ) - (func $start:std/array~anonymous|16 (; 48 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|16 (; 80 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop global.get $std/array/i local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release ) - (func $~lib/array/Array#forEach (; 49 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#forEach (; 81 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) block $break|0 - local.get $0 - i32.load offset=12 - local.set $3 + block + i32.const 0 + local.set $2 + local.get $0 + i32.load offset=12 + local.set $3 + end loop $repeat|0 local.get $2 local.get $3 + local.tee $4 local.get $0 i32.load offset=12 - local.tee $4 - local.get $3 + local.tee $5 local.get $4 + local.get $5 i32.lt_s select - i32.ge_s + i32.lt_s + i32.eqz br_if $break|0 i32.const 3 global.set $~lib/argc @@ -2417,16 +4235,36 @@ unreachable end ) - (func $start:std/array~anonymous|17 (; 50 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|17 (; 82 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push + drop global.get $std/array/i local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release ) - (func $start:std/array~anonymous|19 (; 51 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|18 (; 83 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop + global.get $std/array/i + local.get $0 + i32.add + global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release + ) + (func $start:std/array~anonymous|19 (; 84 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 call $~lib/array/Array#pop drop @@ -2434,17 +4272,26 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release ) - (func $start:std/array~anonymous|20 (; 52 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|20 (; 85 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $1 - i32.eqz + i32.const 0 + i32.eq if - loop $repeat|0 - block $break|0 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 local.get $3 i32.const 4 - i32.ge_s + i32.lt_s + i32.eqz br_if $break|0 local.get $2 call $~lib/array/Array#pop @@ -2454,35 +4301,42 @@ i32.add local.set $3 br $repeat|0 + unreachable end + unreachable end - i32.const 0 - local.set $3 - loop $repeat|1 - block $break|1 + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 local.get $3 i32.const 100 - i32.ge_s + i32.lt_s + i32.eqz br_if $break|1 local.get $2 - local.get $3 i32.const 100 + local.get $3 i32.add call $~lib/array/Array#push + drop local.get $3 i32.const 1 i32.add local.set $3 br $repeat|1 + unreachable end + unreachable end - i32.const 0 - local.set $3 - loop $repeat|2 - block $break|2 + block $break|2 + i32.const 0 + local.set $3 + loop $repeat|2 local.get $3 i32.const 100 - i32.ge_s + i32.lt_s + i32.eqz br_if $break|2 local.get $2 call $~lib/array/Array#pop @@ -2492,27 +4346,33 @@ i32.add local.set $3 br $repeat|2 + unreachable end + unreachable end - i32.const 0 - local.set $3 - loop $repeat|3 - block $break|3 + block $break|3 + i32.const 0 + local.set $3 + loop $repeat|3 local.get $3 i32.const 100 - i32.ge_s + i32.lt_s + i32.eqz br_if $break|3 local.get $2 local.get $3 i32.const 200 i32.add call $~lib/array/Array#push + drop local.get $3 i32.const 1 i32.add local.set $3 br $repeat|3 + unreachable end + unreachable end end local.get $1 @@ -2521,93 +4381,109 @@ if local.get $0 i32.const 202 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 160 - i32.const 561 - i32.const 4 + i32.const 232 + i32.const 570 + i32.const 6 call $~lib/builtins/abort unreachable end end + local.get $2 + call $~lib/rt/purerc/__release ) - (func $start:std/array~anonymous|21 (; 53 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (func $start:std/array~anonymous|21 (; 86 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (local $3 f32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 f32.convert_i32_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#map (; 54 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/array/Array#map (; 87 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 f32) local.get $0 i32.load offset=12 - local.tee $3 + local.set $2 + local.get $2 i32.const 2 i32.const 22 i32.const 0 - call $~lib/util/runtime/makeArray - local.tee $4 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $3 + local.get $3 i32.load offset=4 - local.set $5 - loop $repeat|0 - local.get $1 - local.get $3 - local.get $0 - i32.load offset=12 - local.tee $2 - local.get $3 - local.get $2 - i32.lt_s - select - i32.lt_s - if - local.get $1 + local.set $4 + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + local.get $2 + local.tee $6 + local.get $0 + i32.load offset=12 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + i32.lt_s + i32.eqz + br_if $break|0 + block (result f32) + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.load offset=4 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $5 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$fiii) + end + local.set $8 + local.get $4 + local.get $5 i32.const 2 i32.shl - local.tee $2 - local.get $0 - i32.load offset=4 i32.add - i32.load - local.set $6 - i32.const 3 - global.set $~lib/argc - local.get $2 - local.get $5 - i32.add - local.get $6 - local.get $1 - local.get $0 - call $start:std/array~anonymous|21 + local.get $8 f32.store - local.get $1 + local.get $5 i32.const 1 i32.add - local.set $1 + local.set $5 br $repeat|0 + unreachable end - end - local.get $4 - ) - (func $~lib/array/Array#__get (; 55 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) - local.get $1 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - i32.ge_u - if - i32.const 0 - i32.const 280 - i32.const 99 - i32.const 61 - call $~lib/builtins/abort unreachable end + local.get $3 + ) + (func $~lib/array/Array#get:length (; 88 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array#__unchecked_get (; 89 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) local.get $0 i32.load offset=4 local.get $1 @@ -2616,79 +4492,128 @@ i32.add f32.load ) - (func $start:std/array~anonymous|22 (; 56 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#__get (; 90 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 400 + i32.const 456 + i32.const 100 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + ) + (func $start:std/array~anonymous|22 (; 91 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push + drop global.get $std/array/i local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release local.get $0 ) - (func $~lib/array/Array#map (; 57 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#map (; 92 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) local.get $0 i32.load offset=12 - local.tee $4 + local.set $2 + local.get $2 i32.const 2 i32.const 17 i32.const 0 - call $~lib/util/runtime/makeArray + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $3 + local.get $3 i32.load offset=4 - local.set $5 - loop $repeat|0 - local.get $2 - local.get $4 - local.get $0 - i32.load offset=12 - local.tee $3 - local.get $4 - local.get $3 - i32.lt_s - select - i32.lt_s - if + local.set $4 + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 local.get $2 + local.tee $6 + local.get $0 + i32.load offset=12 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.load offset=4 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $5 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiii) + end + local.set $6 + local.get $4 + local.get $5 i32.const 2 i32.shl - local.tee $3 - local.get $0 - i32.load offset=4 - i32.add - i32.load - local.set $6 - i32.const 3 - global.set $~lib/argc - local.get $3 - local.get $5 i32.add local.get $6 - local.get $2 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiii) i32.store - local.get $2 + local.get $5 i32.const 1 i32.add - local.set $2 + local.set $5 br $repeat|0 + unreachable end + unreachable end + local.get $3 ) - (func $start:std/array~anonymous|23 (; 58 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|23 (; 93 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop global.get $std/array/i local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release local.get $0 ) - (func $start:std/array~anonymous|24 (; 59 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|24 (; 94 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 call $~lib/array/Array#pop drop @@ -2696,91 +4621,128 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release local.get $0 ) - (func $start:std/array~anonymous|25 (; 60 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|25 (; 95 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 2 i32.ge_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#filter (; 61 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#filter (; 96 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) i32.const 0 i32.const 2 i32.const 17 i32.const 0 - call $~lib/util/runtime/makeArray - local.set $4 - local.get $0 - i32.load offset=12 - local.set $5 - loop $repeat|0 - block $break|0 - local.get $2 - local.get $5 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $2 + block $break|0 + block + i32.const 0 + local.set $3 local.get $0 i32.load offset=12 - local.tee $3 - local.get $5 + local.set $4 + end + loop $repeat|0 local.get $3 + local.get $4 + local.tee $5 + local.get $0 + i32.load offset=12 + local.tee $6 + local.get $5 + local.get $6 i32.lt_s select - i32.ge_s + i32.lt_s + i32.eqz br_if $break|0 local.get $0 i32.load offset=4 - local.get $2 + local.get $3 i32.const 2 i32.shl i32.add i32.load - local.set $3 - i32.const 3 - global.set $~lib/argc - local.get $3 - local.get $2 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiii) - if - local.get $4 + local.set $5 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $5 local.get $3 - call $~lib/array/Array#push + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiii) end - local.get $2 + if + local.get $2 + local.get $5 + call $~lib/array/Array#push + drop + end + local.get $3 i32.const 1 i32.add - local.set $2 + local.set $3 br $repeat|0 + unreachable end + unreachable end - local.get $4 + local.get $2 ) - (func $start:std/array~anonymous|26 (; 62 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|26 (; 97 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push + drop global.get $std/array/i local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 2 i32.ge_s ) - (func $start:std/array~anonymous|27 (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|27 (; 98 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop global.get $std/array/i local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 2 i32.ge_s ) - (func $start:std/array~anonymous|28 (; 64 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|28 (; 99 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 call $~lib/array/Array#pop drop @@ -2788,133 +4750,457 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 2 i32.ge_s ) - (func $start:std/array~anonymous|29 (; 65 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|29 (; 100 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 i32.add + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 ) - (func $~lib/array/Array#reduce (; 66 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduce (; 101 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - local.get $0 - i32.load offset=12 - local.set $4 - loop $repeat|0 - block $break|0 - local.get $3 - local.get $4 + (local $6 i32) + (local $7 i32) + local.get $2 + local.set $3 + block $break|0 + block + i32.const 0 + local.set $4 local.get $0 i32.load offset=12 - local.tee $5 + local.set $5 + end + loop $repeat|0 local.get $4 local.get $5 + local.tee $6 + local.get $0 + i32.load offset=12 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select - i32.ge_s + i32.lt_s + i32.eqz br_if $break|0 - i32.const 4 - global.set $~lib/argc - local.get $2 - local.get $0 - i32.load offset=4 - local.get $3 - i32.const 2 - i32.shl - i32.add - i32.load - local.get $3 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiiii) - local.set $2 - local.get $3 + block (result i32) + i32.const 4 + global.set $~lib/argc + local.get $3 + local.get $0 + i32.load offset=4 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $4 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiiii) + end + local.set $3 + local.get $4 i32.const 1 i32.add - local.set $3 + local.set $4 br $repeat|0 + unreachable end + unreachable end - local.get $2 - ) - (func $start:std/array~anonymous|31 (; 67 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - i32.const 1 - local.get $1 - i32.const 2 - i32.gt_s - local.get $0 - select - ) - (func $start:std/array~anonymous|32 (; 68 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - i32.const 1 - local.get $1 - i32.const 100 - i32.gt_s - local.get $0 - select - ) - (func $start:std/array~anonymous|33 (; 69 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) local.get $3 - i32.const 1 - call $~lib/array/Array#push - local.get $0 - local.get $1 - i32.add ) - (func $start:std/array~anonymous|35 (; 70 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|30 (; 102 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) local.get $3 - call $~lib/array/Array#pop + call $~lib/rt/purerc/__retain drop local.get $0 local.get $1 i32.add + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 ) - (func $~lib/array/Array#reduceRight (; 71 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) + (func $start:std/array~anonymous|31 (; 103 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop local.get $0 - i32.load offset=12 - i32.const 1 - i32.sub + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 2 + i32.gt_s + end + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + ) + (func $~lib/array/Array#reduce (; 104 ;) (type $FUNCSIG$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) + local.get $2 local.set $3 - loop $repeat|0 - block $break|0 - local.get $3 + block $break|0 + block i32.const 0 + local.set $4 + local.get $0 + i32.load offset=12 + local.set $5 + end + loop $repeat|0 + local.get $4 + local.get $5 + local.tee $6 + local.get $0 + i32.load offset=12 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s + select + i32.lt_s + i32.eqz br_if $break|0 - i32.const 4 - global.set $~lib/argc - local.get $2 - local.get $0 - i32.load offset=4 - local.get $3 - i32.const 2 - i32.shl + block (result i32) + i32.const 4 + global.set $~lib/argc + local.get $3 + local.get $0 + i32.load offset=4 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $4 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiiii) + end + local.set $3 + local.get $4 + i32.const 1 i32.add - i32.load - local.get $3 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiiii) - local.set $2 - local.get $3 + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + ) + (func $start:std/array~anonymous|32 (; 105 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $0 + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 100 + i32.gt_s + end + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + ) + (func $start:std/array~anonymous|33 (; 106 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $3 + i32.const 1 + call $~lib/array/Array#push + drop + local.get $3 + call $~lib/rt/purerc/__release + local.get $0 + local.get $1 + i32.add + ) + (func $start:std/array~anonymous|34 (; 107 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + ) + (func $start:std/array~anonymous|35 (; 108 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $3 + call $~lib/array/Array#pop + drop + local.get $3 + call $~lib/rt/purerc/__release + local.get $0 + local.get $1 + i32.add + ) + (func $start:std/array~anonymous|36 (; 109 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + ) + (func $~lib/array/Array#reduceRight (; 110 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + local.get $2 + local.set $3 + block $break|0 + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 0 + i32.ge_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 4 + global.set $~lib/argc + local.get $3 + local.get $0 + i32.load offset=4 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $4 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiiii) + end + local.set $3 + local.get $4 i32.const 1 i32.sub - local.set $3 + local.set $4 br $repeat|0 + unreachable end + unreachable end - local.get $2 + local.get $3 ) - (func $~lib/math/splitMix32 (; 72 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $start:std/array~anonymous|37 (; 111 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + ) + (func $start:std/array~anonymous|38 (; 112 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $0 + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 2 + i32.gt_s + end + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + ) + (func $~lib/array/Array#reduceRight (; 113 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + local.get $2 + local.set $3 + block $break|0 + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 0 + i32.ge_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 4 + global.set $~lib/argc + local.get $3 + local.get $0 + i32.load offset=4 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $4 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiiii) + end + local.set $3 + local.get $4 + i32.const 1 + i32.sub + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + ) + (func $start:std/array~anonymous|39 (; 114 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $0 + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 100 + i32.gt_s + end + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + ) + (func $start:std/array~anonymous|40 (; 115 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $3 + i32.const 1 + call $~lib/array/Array#push + drop + local.get $3 + call $~lib/rt/purerc/__release + local.get $0 + local.get $1 + i32.add + ) + (func $start:std/array~anonymous|41 (; 116 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + ) + (func $start:std/array~anonymous|42 (; 117 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $3 + call $~lib/array/Array#pop + drop + local.get $3 + call $~lib/rt/purerc/__release + local.get $0 + local.get $1 + i32.add + ) + (func $~lib/math/murmurHash3 (; 118 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) + local.get $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + local.set $0 + local.get $0 + i64.const -49064778989728563 + i64.mul + local.set $0 + local.get $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + local.set $0 + local.get $0 + i64.const -4265267296055464877 + i64.mul + local.set $0 + local.get $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + local.set $0 + local.get $0 + ) + (func $~lib/math/splitMix32 (; 119 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 1831565813 i32.add - local.tee $0 + local.set $0 + local.get $0 local.get $0 i32.const 15 i32.shr_u @@ -2923,32 +5209,33 @@ i32.const 1 i32.or i32.mul - local.tee $0 + local.set $0 + local.get $0 + local.get $0 local.get $0 - i32.const 61 - i32.or local.get $0 i32.const 7 i32.shr_u - local.get $0 i32.xor - i32.mul local.get $0 + i32.const 61 + i32.or + i32.mul i32.add i32.xor - local.tee $0 + local.set $0 + local.get $0 local.get $0 i32.const 14 i32.shr_u i32.xor ) - (func $~lib/math/NativeMath.seedRandom (; 73 ;) (type $FUNCSIG$vj) (param $0 i64) - (local $1 i64) + (func $~lib/math/NativeMath.seedRandom (; 120 ;) (type $FUNCSIG$vj) (param $0 i64) local.get $0 i64.eqz if i32.const 0 - i32.const 3000 + i32.const 3128 i32.const 1021 i32.const 4 call $~lib/builtins/abort @@ -2957,47 +5244,12 @@ i32.const 1 global.set $~lib/math/random_seeded local.get $0 - i64.const 33 - i64.shr_u - local.get $0 - i64.xor - i64.const -49064778989728563 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -4265267296055464877 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor + call $~lib/math/murmurHash3 global.set $~lib/math/random_state0_64 global.get $~lib/math/random_state0_64 i64.const -1 i64.xor - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -49064778989728563 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -4265267296055464877 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor + call $~lib/math/murmurHash3 global.set $~lib/math/random_state1_64 local.get $0 i32.wrap_i64 @@ -3007,77 +5259,87 @@ call $~lib/math/splitMix32 global.set $~lib/math/random_state1_32 ) - (func $~lib/util/sort/insertionSort (; 74 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 121 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - (local $4 i32) - (local $5 f32) + (local $4 f32) + (local $5 i32) (local $6 f32) (local $7 i32) block $break|0 + i32.const 0 + local.set $3 loop $repeat|0 local.get $3 local.get $1 - i32.ge_s + i32.lt_s + i32.eqz br_if $break|0 + local.get $0 local.get $3 i32.const 2 i32.shl - local.get $0 i32.add f32.load - local.set $5 + local.set $4 local.get $3 i32.const 1 i32.sub - local.set $4 - loop $continue|1 - local.get $4 - i32.const 0 - i32.ge_s - if - block $break|1 - local.get $4 + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 i32.const 2 i32.shl - local.get $0 i32.add f32.load local.set $6 - i32.const 2 - global.set $~lib/argc - local.get $5 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$iff) + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iff) + end i32.const 0 - i32.ge_s - br_if $break|1 - local.get $4 - local.tee $7 - i32.const 1 - i32.sub - local.set $4 - local.get $7 - i32.const 1 - i32.add - i32.const 2 - i32.shl - local.get $0 - i32.add - local.get $6 - f32.store + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + f32.store + else + br $break|1 + end br $continue|1 end end end - local.get $4 + local.get $0 + local.get $5 i32.const 1 i32.add i32.const 2 i32.shl - local.get $0 i32.add - local.get $5 + local.get $4 f32.store local.get $3 i32.const 1 @@ -3089,13 +5351,81 @@ unreachable end ) - (func $~lib/util/sort/weakHeapSort (; 75 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/freeBlock (; 122 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/tlsf/__free (; 123 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 560 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 561 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/util/sort/weakHeapSort (; 124 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - (local $5 f32) - (local $6 f32) + (local $5 i32) + (local $6 i32) (local $7 i32) - (local $8 i32) + (local $8 f32) + (local $9 f32) + (local $10 f32) local.get $1 i32.const 31 i32.add @@ -3103,477 +5433,593 @@ i32.shr_s i32.const 2 i32.shl - local.tee $3 - call $~lib/allocator/arena/__mem_allocate - local.tee $7 + local.set $3 + local.get $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $4 i32.const 0 local.get $3 call $~lib/memory/memory.fill - local.get $1 - i32.const 1 - i32.sub - local.set $4 - loop $repeat|0 - local.get $4 - i32.const 0 - i32.gt_s - if - local.get $4 - local.set $3 - loop $continue|1 - local.get $3 - i32.const 1 - i32.and - local.get $3 - i32.const 6 - i32.shr_s - i32.const 2 - i32.shl - local.get $7 - i32.add - i32.load - local.get $3 - i32.const 1 - i32.shr_s - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.eq - if - local.get $3 + block $break|0 + local.get $1 + i32.const 1 + i32.sub + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 0 + i32.gt_s + i32.eqz + br_if $break|0 + local.get $5 + local.set $6 + block $break|1 + loop $continue|1 + local.get $6 + i32.const 1 + i32.and + local.get $4 + local.get $6 + i32.const 6 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 i32.const 1 i32.shr_s - local.set $3 - br $continue|1 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.eq + if + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|1 + end end end - local.get $3 + local.get $6 i32.const 1 i32.shr_s - local.tee $3 + local.set $7 + local.get $0 + local.get $7 i32.const 2 i32.shl - local.get $0 i32.add f32.load - local.set $5 - local.get $4 - i32.const 2 - i32.shl + local.set $8 local.get $0 - i32.add - f32.load - local.set $6 - i32.const 2 - global.set $~lib/argc local.get $5 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$iff) + i32.const 2 + i32.shl + i32.add + f32.load + local.set $9 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $9 + local.get $2 + call_indirect (type $FUNCSIG$iff) + end i32.const 0 i32.lt_s if local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $5 i32.const 5 i32.shr_s i32.const 2 i32.shl - local.get $7 i32.add - local.tee $8 - local.get $8 i32.load i32.const 1 - local.get $4 + local.get $5 i32.const 31 i32.and i32.shl i32.xor i32.store - local.get $4 - i32.const 2 - i32.shl local.get $0 - i32.add local.get $5 - f32.store - local.get $3 i32.const 2 i32.shl - local.get $0 i32.add - local.get $6 + local.get $8 + f32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $9 f32.store end - local.get $4 + local.get $5 i32.const 1 i32.sub - local.set $4 + local.set $5 br $repeat|0 + unreachable end + unreachable end - local.get $1 - i32.const 1 - i32.sub - local.set $4 - loop $repeat|2 - local.get $4 - i32.const 2 - i32.ge_s - if + block $break|2 + local.get $1 + i32.const 1 + i32.sub + local.set $7 + loop $repeat|2 + local.get $7 + i32.const 2 + i32.ge_s + i32.eqz + br_if $break|2 local.get $0 f32.load - local.set $5 + local.set $9 local.get $0 - local.get $4 + local.get $0 + local.get $7 i32.const 2 i32.shl - local.get $0 i32.add - local.tee $1 f32.load f32.store - local.get $1 - local.get $5 + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $9 f32.store i32.const 1 - local.set $1 - loop $continue|3 - local.get $1 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - local.get $7 - i32.add - i32.load - local.get $1 - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - local.get $1 - i32.const 1 - i32.shl - i32.add - local.tee $3 - local.get $4 - i32.lt_s - if - local.get $3 - local.set $1 - br $continue|3 - end - end - loop $continue|4 - local.get $1 - i32.const 0 - i32.gt_s - if - local.get $0 - f32.load - local.set $5 - local.get $1 + local.set $6 + block $break|3 + loop $continue|3 + local.get $6 + i32.const 1 + i32.shl + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s i32.const 2 i32.shl - local.get $0 i32.add - f32.load - local.set $6 - i32.const 2 - global.set $~lib/argc - local.get $5 + i32.load local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$iff) - i32.const 0 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.add + local.tee $5 + local.get $7 i32.lt_s if - local.get $1 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - local.get $7 - i32.add - local.tee $3 - local.get $3 - i32.load - i32.const 1 - local.get $1 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - local.get $1 - i32.const 2 - i32.shl - local.get $0 - i32.add local.get $5 - f32.store - local.get $0 - local.get $6 - f32.store + local.set $6 + br $continue|3 end - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - br $continue|4 end end - local.get $4 + block $break|4 + loop $continue|4 + local.get $6 + i32.const 0 + i32.gt_s + if + local.get $0 + f32.load + local.set $9 + local.get $0 + local.get $6 + i32.const 2 + i32.shl + i32.add + f32.load + local.set $8 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $9 + local.get $8 + local.get $2 + call_indirect (type $FUNCSIG$iff) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $6 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $9 + f32.store + local.get $0 + local.get $8 + f32.store + end + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|4 + end + end + end + local.get $7 i32.const 1 i32.sub - local.set $4 + local.set $7 br $repeat|2 + unreachable end + unreachable end + local.get $4 + call $~lib/rt/tlsf/__free local.get $0 f32.load offset=4 - local.set $5 + local.set $10 local.get $0 local.get $0 f32.load f32.store offset=4 local.get $0 - local.get $5 + local.get $10 f32.store ) - (func $~lib/array/Array#sort (; 76 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#sort (; 125 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 f32) + (local $3 i32) (local $4 f32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 280 - i32.const 528 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + (local $5 f32) + (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 i32.load offset=12 - local.tee $2 + local.set $2 + local.get $2 i32.const 1 i32.le_s if + local.get $0 + call $~lib/rt/purerc/__retain return end local.get $0 i32.load offset=4 - local.set $0 + local.set $3 local.get $2 i32.const 2 i32.eq if - local.get $0 - f32.load offset=4 - local.set $3 - local.get $0 - f32.load - local.set $4 - i32.const 2 - global.set $~lib/argc local.get $3 - local.get $4 - local.get $1 - call_indirect (type $FUNCSIG$iff) + f32.load offset=4 + local.set $4 + local.get $3 + f32.load + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$iff) + end i32.const 0 i32.lt_s if - local.get $0 - local.get $4 - f32.store offset=4 - local.get $0 local.get $3 + local.get $5 + f32.store offset=4 + local.get $3 + local.get $4 f32.store end + local.get $0 + call $~lib/rt/purerc/__retain return end - local.get $2 - i32.const 256 - i32.lt_s - if - local.get $0 + block $~lib/util/sort/SORT|inlined.0 + local.get $3 + local.set $8 local.get $2 + local.set $7 local.get $1 - call $~lib/util/sort/insertionSort - else - local.get $0 - local.get $2 - local.get $1 - call $~lib/util/sort/weakHeapSort + local.set $6 + local.get $7 + i32.const 256 + i32.lt_s + if + local.get $8 + local.get $7 + local.get $6 + call $~lib/util/sort/insertionSort + else + local.get $8 + local.get $7 + local.get $6 + call $~lib/util/sort/weakHeapSort + end end + local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 77 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 126 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) local.get $0 i32.reinterpret_f32 - local.tee $2 + local.set $2 + local.get $1 + i32.reinterpret_f32 + local.set $3 + local.get $2 local.get $2 i32.const 31 i32.shr_s i32.const 1 i32.shr_u i32.xor - local.tee $2 - local.get $1 - i32.reinterpret_f32 - local.tee $3 + local.set $2 + local.get $3 local.get $3 i32.const 31 i32.shr_s i32.const 1 i32.shr_u i32.xor - local.tee $3 + local.set $3 + local.get $2 + local.get $3 i32.gt_s local.get $2 local.get $3 i32.lt_s i32.sub ) - (func $std/array/isArraysEqual (; 78 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 f32) - (local $4 i32) - local.get $0 - i32.load offset=12 - local.tee $4 - local.get $1 - i32.load offset=12 - i32.ne - if - i32.const 0 - return + (func $~lib/array/Array#sort|trampoline (; 127 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + br_table $0of1 $1of1 $outOfRange + end + unreachable + end + block $~lib/util/sort/COMPARATOR|inlined.0 (result i32) + i32.const 44 + br $~lib/util/sort/COMPARATOR|inlined.0 + end + local.set $1 end local.get $0 local.get $1 - i32.eq + call $~lib/array/Array#sort + ) + (func $~lib/builtins/isNaN (; 128 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $std/array/isArraysEqual (; 129 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $2 + i32.eqz if - i32.const 1 - return - end - loop $repeat|0 + local.get $0 + call $~lib/array/Array#get:length + local.set $2 local.get $2 - local.get $4 - i32.lt_s + local.get $1 + call $~lib/array/Array#get:length + i32.ne if local.get $0 - local.get $2 - call $~lib/array/Array#__get - local.tee $3 - local.get $3 - f32.ne + call $~lib/rt/purerc/__release local.get $1 - local.get $2 - call $~lib/array/Array#__get - local.tee $3 - local.get $3 - f32.ne - i32.ne - if - local.get $0 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $0 + local.get $1 + i32.eq + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 1 + return + end + end + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + block $continue|0 + local.get $3 local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + local.get $1 + local.get $3 + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + i32.eq + if + br $continue|0 + end + local.get $0 + local.get $3 call $~lib/array/Array#__get local.get $1 - local.get $2 + local.get $3 call $~lib/array/Array#__get f32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end end - local.get $2 + local.get $3 i32.const 1 i32.add - local.set $2 + local.set $3 br $repeat|0 + unreachable end + unreachable end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $~lib/util/sort/insertionSort (; 79 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 130 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - (local $4 i32) - (local $5 f64) + (local $4 f64) + (local $5 i32) (local $6 f64) (local $7 i32) block $break|0 + i32.const 0 + local.set $3 loop $repeat|0 local.get $3 local.get $1 - i32.ge_s + i32.lt_s + i32.eqz br_if $break|0 + local.get $0 local.get $3 i32.const 3 i32.shl - local.get $0 i32.add f64.load - local.set $5 + local.set $4 local.get $3 i32.const 1 i32.sub - local.set $4 - loop $continue|1 - local.get $4 - i32.const 0 - i32.ge_s - if - block $break|1 - local.get $4 + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 i32.const 3 i32.shl - local.get $0 i32.add f64.load local.set $6 - i32.const 2 - global.set $~lib/argc - local.get $5 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$idd) + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$idd) + end i32.const 0 - i32.ge_s - br_if $break|1 - local.get $4 - local.tee $7 - i32.const 1 - i32.sub - local.set $4 - local.get $7 - i32.const 1 - i32.add - i32.const 3 - i32.shl - local.get $0 - i32.add - local.get $6 - f64.store + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 3 + i32.shl + i32.add + local.get $6 + f64.store + else + br $break|1 + end br $continue|1 end end end - local.get $4 + local.get $0 + local.get $5 i32.const 1 i32.add i32.const 3 i32.shl - local.get $0 i32.add - local.get $5 + local.get $4 f64.store local.get $3 i32.const 1 @@ -3585,13 +6031,15 @@ unreachable end ) - (func $~lib/util/sort/weakHeapSort (; 80 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 131 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - (local $5 f64) - (local $6 f64) + (local $5 i32) + (local $6 i32) (local $7 i32) - (local $8 i32) + (local $8 f64) + (local $9 f64) + (local $10 f64) local.get $1 i32.const 31 i32.add @@ -3599,346 +6047,430 @@ i32.shr_s i32.const 2 i32.shl - local.tee $3 - call $~lib/allocator/arena/__mem_allocate - local.tee $7 + local.set $3 + local.get $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $4 i32.const 0 local.get $3 call $~lib/memory/memory.fill - local.get $1 - i32.const 1 - i32.sub - local.set $4 - loop $repeat|0 - local.get $4 - i32.const 0 - i32.gt_s - if - local.get $4 - local.set $3 - loop $continue|1 - local.get $3 - i32.const 1 - i32.and - local.get $3 - i32.const 6 - i32.shr_s - i32.const 2 - i32.shl - local.get $7 - i32.add - i32.load - local.get $3 - i32.const 1 - i32.shr_s - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.eq - if - local.get $3 + block $break|0 + local.get $1 + i32.const 1 + i32.sub + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 0 + i32.gt_s + i32.eqz + br_if $break|0 + local.get $5 + local.set $6 + block $break|1 + loop $continue|1 + local.get $6 + i32.const 1 + i32.and + local.get $4 + local.get $6 + i32.const 6 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 i32.const 1 i32.shr_s - local.set $3 - br $continue|1 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.eq + if + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|1 + end end end - local.get $3 + local.get $6 i32.const 1 i32.shr_s - local.tee $3 + local.set $7 + local.get $0 + local.get $7 i32.const 3 i32.shl - local.get $0 i32.add f64.load - local.set $5 - local.get $4 - i32.const 3 - i32.shl + local.set $8 local.get $0 - i32.add - f64.load - local.set $6 - i32.const 2 - global.set $~lib/argc local.get $5 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$idd) + i32.const 3 + i32.shl + i32.add + f64.load + local.set $9 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $9 + local.get $2 + call_indirect (type $FUNCSIG$idd) + end i32.const 0 i32.lt_s if local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $5 i32.const 5 i32.shr_s i32.const 2 i32.shl - local.get $7 i32.add - local.tee $8 - local.get $8 i32.load i32.const 1 - local.get $4 + local.get $5 i32.const 31 i32.and i32.shl i32.xor i32.store - local.get $4 - i32.const 3 - i32.shl local.get $0 - i32.add local.get $5 - f64.store - local.get $3 i32.const 3 i32.shl - local.get $0 i32.add - local.get $6 + local.get $8 + f64.store + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $9 f64.store end - local.get $4 + local.get $5 i32.const 1 i32.sub - local.set $4 + local.set $5 br $repeat|0 + unreachable end + unreachable end - local.get $1 - i32.const 1 - i32.sub - local.set $4 - loop $repeat|2 - local.get $4 - i32.const 2 - i32.ge_s - if + block $break|2 + local.get $1 + i32.const 1 + i32.sub + local.set $7 + loop $repeat|2 + local.get $7 + i32.const 2 + i32.ge_s + i32.eqz + br_if $break|2 local.get $0 f64.load - local.set $5 + local.set $9 local.get $0 - local.get $4 + local.get $0 + local.get $7 i32.const 3 i32.shl - local.get $0 i32.add - local.tee $1 f64.load f64.store - local.get $1 - local.get $5 + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $9 f64.store i32.const 1 - local.set $1 - loop $continue|3 - local.get $1 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - local.get $7 - i32.add - i32.load - local.get $1 - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - local.get $1 - i32.const 1 - i32.shl - i32.add - local.tee $3 - local.get $4 - i32.lt_s - if - local.get $3 - local.set $1 - br $continue|3 - end - end - loop $continue|4 - local.get $1 - i32.const 0 - i32.gt_s - if - local.get $0 - f64.load - local.set $5 - local.get $1 - i32.const 3 - i32.shl - local.get $0 - i32.add - f64.load - local.set $6 - i32.const 2 - global.set $~lib/argc - local.get $5 + local.set $6 + block $break|3 + loop $continue|3 local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$idd) - i32.const 0 + i32.const 1 + i32.shl + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.add + local.tee $5 + local.get $7 i32.lt_s if - local.get $1 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - local.get $7 - i32.add - local.tee $3 - local.get $3 - i32.load - i32.const 1 - local.get $1 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - local.get $1 - i32.const 3 - i32.shl - local.get $0 - i32.add local.get $5 - f64.store - local.get $0 - local.get $6 - f64.store + local.set $6 + br $continue|3 end - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - br $continue|4 end end - local.get $4 + block $break|4 + loop $continue|4 + local.get $6 + i32.const 0 + i32.gt_s + if + local.get $0 + f64.load + local.set $9 + local.get $0 + local.get $6 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $8 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $9 + local.get $8 + local.get $2 + call_indirect (type $FUNCSIG$idd) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $6 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $6 + i32.const 3 + i32.shl + i32.add + local.get $9 + f64.store + local.get $0 + local.get $8 + f64.store + end + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|4 + end + end + end + local.get $7 i32.const 1 i32.sub - local.set $4 + local.set $7 br $repeat|2 + unreachable end + unreachable end + local.get $4 + call $~lib/rt/tlsf/__free local.get $0 f64.load offset=8 - local.set $5 + local.set $10 local.get $0 local.get $0 f64.load f64.store offset=8 local.get $0 - local.get $5 + local.get $10 f64.store ) - (func $~lib/array/Array#sort (; 81 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#sort (; 132 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 f64) + (local $3 i32) (local $4 f64) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 280 - i32.const 528 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + (local $5 f64) + (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 i32.load offset=12 - local.tee $2 + local.set $2 + local.get $2 i32.const 1 i32.le_s if + local.get $0 + call $~lib/rt/purerc/__retain return end local.get $0 i32.load offset=4 - local.set $0 + local.set $3 local.get $2 i32.const 2 i32.eq if - local.get $0 - f64.load offset=8 - local.set $3 - local.get $0 - f64.load - local.set $4 - i32.const 2 - global.set $~lib/argc local.get $3 - local.get $4 - local.get $1 - call_indirect (type $FUNCSIG$idd) + f64.load offset=8 + local.set $4 + local.get $3 + f64.load + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$idd) + end i32.const 0 i32.lt_s if - local.get $0 - local.get $4 - f64.store offset=8 - local.get $0 local.get $3 + local.get $5 + f64.store offset=8 + local.get $3 + local.get $4 f64.store end + local.get $0 + call $~lib/rt/purerc/__retain return end - local.get $2 - i32.const 256 - i32.lt_s - if - local.get $0 + block $~lib/util/sort/SORT|inlined.0 + local.get $3 + local.set $8 local.get $2 + local.set $7 local.get $1 - call $~lib/util/sort/insertionSort - else - local.get $0 - local.get $2 - local.get $1 - call $~lib/util/sort/weakHeapSort + local.set $6 + local.get $7 + i32.const 256 + i32.lt_s + if + local.get $8 + local.get $7 + local.get $6 + call $~lib/util/sort/insertionSort + else + local.get $8 + local.get $7 + local.get $6 + call $~lib/util/sort/weakHeapSort + end end + local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 82 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 133 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) local.get $0 i64.reinterpret_f64 - local.tee $2 + local.set $2 + local.get $1 + i64.reinterpret_f64 + local.set $3 + local.get $2 local.get $2 i64.const 63 i64.shr_s i64.const 1 i64.shr_u i64.xor - local.tee $2 - local.get $1 - i64.reinterpret_f64 - local.tee $3 + local.set $2 + local.get $3 local.get $3 i64.const 63 i64.shr_s i64.const 1 i64.shr_u i64.xor - local.tee $3 + local.set $3 + local.get $2 + local.get $3 i64.gt_s local.get $2 local.get $3 i64.lt_s i32.sub ) - (func $~lib/array/Array#__get (; 83 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/array/Array#sort|trampoline (; 134 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + br_table $0of1 $1of1 $outOfRange + end + unreachable + end + block $~lib/util/sort/COMPARATOR|inlined.0 (result i32) + i32.const 45 + br $~lib/util/sort/COMPARATOR|inlined.0 + end + local.set $1 + end + local.get $0 + local.get $1 + call $~lib/array/Array#sort + ) + (func $~lib/array/Array#get:length (; 135 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array#__unchecked_get (; 136 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + f64.load + ) + (func $~lib/array/Array#__get (; 137 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) local.get $1 local.get $0 i32.load offset=8 @@ -3946,153 +6478,194 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 99 + i32.const 400 + i32.const 456 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable end local.get $0 - i32.load offset=4 local.get $1 - i32.const 3 - i32.shl - i32.add - f64.load + call $~lib/array/Array#__unchecked_get ) - (func $std/array/isArraysEqual (; 84 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 f64) - (local $4 i32) + (func $~lib/builtins/isNaN (; 138 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 - i32.load offset=12 - local.tee $4 - local.get $1 - i32.load offset=12 - i32.ne - if - i32.const 0 - return - end local.get $0 + f64.ne + ) + (func $std/array/isArraysEqual (; 139 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop local.get $1 - i32.eq + call $~lib/rt/purerc/__retain + drop + local.get $2 + i32.eqz if - i32.const 1 - return - end - loop $repeat|0 + local.get $0 + call $~lib/array/Array#get:length + local.set $2 local.get $2 - local.get $4 - i32.lt_s + local.get $1 + call $~lib/array/Array#get:length + i32.ne if local.get $0 - local.get $2 - call $~lib/array/Array#__get - local.tee $3 - local.get $3 - f64.ne + call $~lib/rt/purerc/__release local.get $1 - local.get $2 - call $~lib/array/Array#__get - local.tee $3 - local.get $3 - f64.ne - i32.ne - if - local.get $0 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $0 + local.get $1 + i32.eq + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 1 + return + end + end + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + block $continue|0 + local.get $3 local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + local.get $1 + local.get $3 + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + i32.eq + if + br $continue|0 + end + local.get $0 + local.get $3 call $~lib/array/Array#__get local.get $1 - local.get $2 + local.get $3 call $~lib/array/Array#__get f64.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end end - local.get $2 + local.get $3 i32.const 1 i32.add - local.set $2 + local.set $3 br $repeat|0 + unreachable end + unreachable end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $~lib/util/sort/insertionSort (; 85 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 140 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) block $break|0 + i32.const 0 + local.set $3 loop $repeat|0 local.get $3 local.get $1 - i32.ge_s + i32.lt_s + i32.eqz br_if $break|0 + local.get $0 local.get $3 i32.const 2 i32.shl - local.get $0 i32.add i32.load - local.set $5 + local.set $4 local.get $3 i32.const 1 i32.sub - local.set $4 - loop $continue|1 - local.get $4 - i32.const 0 - i32.ge_s - if - block $break|1 - local.get $4 + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 i32.const 2 i32.shl - local.get $0 i32.add i32.load local.set $6 - i32.const 2 - global.set $~lib/argc - local.get $5 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$iii) + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end i32.const 0 - i32.ge_s - br_if $break|1 - local.get $4 - local.tee $7 - i32.const 1 - i32.sub - local.set $4 - local.get $7 - i32.const 1 - i32.add - i32.const 2 - i32.shl - local.get $0 - i32.add - local.get $6 - i32.store + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + br $break|1 + end br $continue|1 end end end - local.get $4 + local.get $0 + local.get $5 i32.const 1 i32.add i32.const 2 i32.shl - local.get $0 i32.add - local.get $5 + local.get $4 i32.store local.get $3 i32.const 1 @@ -4104,13 +6677,15 @@ unreachable end ) - (func $~lib/util/sort/weakHeapSort (; 86 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 141 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) local.get $1 i32.const 31 i32.add @@ -4118,269 +6693,300 @@ i32.shr_s i32.const 2 i32.shl - local.tee $3 - call $~lib/allocator/arena/__mem_allocate - local.tee $6 + local.set $3 + local.get $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $4 i32.const 0 local.get $3 call $~lib/memory/memory.fill - local.get $1 - i32.const 1 - i32.sub - local.set $4 - loop $repeat|0 - local.get $4 - i32.const 0 - i32.gt_s - if - local.get $4 - local.set $3 - loop $continue|1 - local.get $3 - i32.const 1 - i32.and - local.get $3 - i32.const 6 - i32.shr_s - i32.const 2 - i32.shl - local.get $6 - i32.add - i32.load - local.get $3 - i32.const 1 - i32.shr_s - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.eq - if - local.get $3 + block $break|0 + local.get $1 + i32.const 1 + i32.sub + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 0 + i32.gt_s + i32.eqz + br_if $break|0 + local.get $5 + local.set $6 + block $break|1 + loop $continue|1 + local.get $6 + i32.const 1 + i32.and + local.get $4 + local.get $6 + i32.const 6 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 i32.const 1 i32.shr_s - local.set $3 - br $continue|1 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.eq + if + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|1 + end end end - local.get $3 + local.get $6 i32.const 1 i32.shr_s - local.tee $7 + local.set $7 + local.get $0 + local.get $7 i32.const 2 i32.shl - local.get $0 i32.add i32.load - local.set $3 - local.get $4 - i32.const 2 - i32.shl + local.set $8 local.get $0 - i32.add - i32.load - local.set $5 - i32.const 2 - global.set $~lib/argc - local.get $3 local.get $5 - local.get $2 - call_indirect (type $FUNCSIG$iii) + i32.const 2 + i32.shl + i32.add + i32.load + local.set $9 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $9 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end i32.const 0 i32.lt_s if local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $5 i32.const 5 i32.shr_s i32.const 2 i32.shl - local.get $6 i32.add - local.tee $8 - local.get $8 i32.load i32.const 1 - local.get $4 + local.get $5 i32.const 31 i32.and i32.shl i32.xor i32.store - local.get $4 + local.get $0 + local.get $5 i32.const 2 i32.shl - local.get $0 i32.add - local.get $3 + local.get $8 i32.store + local.get $0 local.get $7 i32.const 2 i32.shl - local.get $0 i32.add - local.get $5 + local.get $9 i32.store end - local.get $4 + local.get $5 i32.const 1 i32.sub - local.set $4 + local.set $5 br $repeat|0 + unreachable end + unreachable end - local.get $1 - i32.const 1 - i32.sub - local.set $4 - loop $repeat|2 - local.get $4 - i32.const 2 - i32.ge_s - if + block $break|2 + local.get $1 + i32.const 1 + i32.sub + local.set $9 + loop $repeat|2 + local.get $9 + i32.const 2 + i32.ge_s + i32.eqz + br_if $break|2 local.get $0 i32.load - local.set $1 + local.set $8 local.get $0 - local.get $4 + local.get $0 + local.get $9 i32.const 2 i32.shl - local.get $0 i32.add - local.tee $3 i32.load i32.store - local.get $3 - local.get $1 + local.get $0 + local.get $9 + i32.const 2 + i32.shl + i32.add + local.get $8 i32.store i32.const 1 - local.set $1 - loop $continue|3 - local.get $1 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - local.get $6 - i32.add - i32.load - local.get $1 - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - local.get $1 - i32.const 1 - i32.shl - i32.add - local.tee $3 - local.get $4 - i32.lt_s - if - local.get $3 - local.set $1 - br $continue|3 - end - end - loop $continue|4 - local.get $1 - i32.const 0 - i32.gt_s - if - local.get $0 - i32.load - local.set $3 - local.get $1 + local.set $7 + block $break|3 + loop $continue|3 + local.get $7 + i32.const 1 + i32.shl + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s i32.const 2 i32.shl - local.get $0 i32.add i32.load - local.set $5 - i32.const 2 - global.set $~lib/argc - local.get $3 - local.get $5 - local.get $2 - call_indirect (type $FUNCSIG$iii) - i32.const 0 + local.get $7 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.add + local.tee $6 + local.get $9 i32.lt_s if - local.get $1 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl local.get $6 - i32.add - local.tee $7 - local.get $7 - i32.load - i32.const 1 - local.get $1 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - local.get $1 - i32.const 2 - i32.shl - local.get $0 - i32.add - local.get $3 - i32.store - local.get $0 - local.get $5 - i32.store + local.set $7 + br $continue|3 end - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - br $continue|4 end end - local.get $4 + block $break|4 + loop $continue|4 + local.get $7 + i32.const 0 + i32.gt_s + if + local.get $0 + i32.load + local.set $8 + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $5 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $7 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $0 + local.get $5 + i32.store + end + local.get $7 + i32.const 1 + i32.shr_s + local.set $7 + br $continue|4 + end + end + end + local.get $9 i32.const 1 i32.sub - local.set $4 + local.set $9 br $repeat|2 + unreachable end + unreachable end + local.get $4 + call $~lib/rt/tlsf/__free local.get $0 i32.load offset=4 - local.set $1 + local.set $10 local.get $0 local.get $0 i32.load i32.store offset=4 local.get $0 - local.get $1 + local.get $10 i32.store ) - (func $~lib/array/Array#sort (; 87 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 142 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 280 - i32.const 528 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + (local $5 i32) + (local $6 i32) local.get $0 i32.load offset=12 - local.tee $2 + local.set $2 + local.get $2 i32.const 1 i32.le_s if local.get $0 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -4392,51 +6998,546 @@ if local.get $3 i32.load offset=4 - local.set $2 + local.set $4 local.get $3 i32.load - local.set $4 - i32.const 2 - global.set $~lib/argc - local.get $2 - local.get $4 - local.get $1 - call_indirect (type $FUNCSIG$iii) + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end i32.const 0 i32.lt_s if local.get $3 - local.get $4 + local.get $5 i32.store offset=4 local.get $3 - local.get $2 + local.get $4 i32.store end local.get $0 + call $~lib/rt/purerc/__retain return end - local.get $2 - i32.const 256 - i32.lt_s - if + block $~lib/util/sort/SORT|inlined.0 local.get $3 + local.set $6 local.get $2 + local.set $4 local.get $1 - call $~lib/util/sort/insertionSort - else - local.get $3 - local.get $2 - local.get $1 - call $~lib/util/sort/weakHeapSort + local.set $5 + local.get $4 + i32.const 256 + i32.lt_s + if + local.get $6 + local.get $4 + local.get $5 + call $~lib/util/sort/insertionSort + else + local.get $6 + local.get $4 + local.get $5 + call $~lib/util/sort/weakHeapSort + end end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 88 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 143 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.sub ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 89 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline (; 144 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + br_table $0of1 $1of1 $outOfRange + end + unreachable + end + block $~lib/util/sort/COMPARATOR|inlined.0 (result i32) + i32.const 46 + br $~lib/util/sort/COMPARATOR|inlined.0 + end + local.set $1 + end + local.get $0 + local.get $1 + call $~lib/array/Array#sort + ) + (func $~lib/util/sort/insertionSort (; 145 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $1 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + br $break|1 + end + br $continue|1 + end + end + end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $~lib/util/sort/weakHeapSort (; 146 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $1 + i32.const 31 + i32.add + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + local.set $3 + local.get $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $4 + i32.const 0 + local.get $3 + call $~lib/memory/memory.fill + block $break|0 + local.get $1 + i32.const 1 + i32.sub + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 0 + i32.gt_s + i32.eqz + br_if $break|0 + local.get $5 + local.set $6 + block $break|1 + loop $continue|1 + local.get $6 + i32.const 1 + i32.and + local.get $4 + local.get $6 + i32.const 6 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 + i32.const 1 + i32.shr_s + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.eq + if + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|1 + end + end + end + local.get $6 + i32.const 1 + i32.shr_s + local.set $7 + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $8 + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $9 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $9 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $5 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store + end + local.get $5 + i32.const 1 + i32.sub + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + block $break|2 + local.get $1 + i32.const 1 + i32.sub + local.set $9 + loop $repeat|2 + local.get $9 + i32.const 2 + i32.ge_s + i32.eqz + br_if $break|2 + local.get $0 + i32.load + local.set $8 + local.get $0 + local.get $0 + local.get $9 + i32.const 2 + i32.shl + i32.add + i32.load + i32.store + local.get $0 + local.get $9 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + i32.const 1 + local.set $7 + block $break|3 + loop $continue|3 + local.get $7 + i32.const 1 + i32.shl + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.add + local.tee $6 + local.get $9 + i32.lt_s + if + local.get $6 + local.set $7 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $7 + i32.const 0 + i32.gt_s + if + local.get $0 + i32.load + local.set $8 + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $5 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $7 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $0 + local.get $5 + i32.store + end + local.get $7 + i32.const 1 + i32.shr_s + local.set $7 + br $continue|4 + end + end + end + local.get $9 + i32.const 1 + i32.sub + local.set $9 + br $repeat|2 + unreachable + end + unreachable + end + local.get $4 + call $~lib/rt/tlsf/__free + local.get $0 + i32.load offset=4 + local.set $10 + local.get $0 + local.get $0 + i32.load + i32.store offset=4 + local.get $0 + local.get $10 + i32.store + ) + (func $~lib/array/Array#sort (; 147 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.le_s + if + local.get $0 + call $~lib/rt/purerc/__retain + return + end + local.get $0 + i32.load offset=4 + local.set $3 + local.get $2 + i32.const 2 + i32.eq + if + local.get $3 + i32.load offset=4 + local.set $4 + local.get $3 + i32.load + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $3 + local.get $5 + i32.store offset=4 + local.get $3 + local.get $4 + i32.store + end + local.get $0 + call $~lib/rt/purerc/__retain + return + end + block $~lib/util/sort/SORT|inlined.0 + local.get $3 + local.set $6 + local.get $2 + local.set $4 + local.get $1 + local.set $5 + local.get $4 + i32.const 256 + i32.lt_s + if + local.get $6 + local.get $4 + local.get $5 + call $~lib/util/sort/insertionSort + else + local.get $6 + local.get $4 + local.get $5 + call $~lib/util/sort/weakHeapSort + end + end + local.get $0 + call $~lib/rt/purerc/__retain + ) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 148 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.gt_u @@ -4445,15 +7546,35 @@ i32.lt_u i32.sub ) - (func $~lib/array/Array.create (; 90 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#sort|trampoline (; 149 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + br_table $0of1 $1of1 $outOfRange + end + unreachable + end + block $~lib/util/sort/COMPARATOR|inlined.0 (result i32) + i32.const 47 + br $~lib/util/sort/COMPARATOR|inlined.0 + end + local.set $1 + end + local.get $0 + local.get $1 + call $~lib/array/Array#sort + ) + (func $~lib/array/Array.create (; 150 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) local.get $0 i32.const 268435452 i32.gt_u if - i32.const 0 - i32.const 280 - i32.const 44 - i32.const 62 + i32.const 24 + i32.const 456 + i32.const 45 + i32.const 61 call $~lib/builtins/abort unreachable end @@ -4461,55 +7582,63 @@ i32.const 2 i32.const 17 i32.const 0 - call $~lib/util/runtime/makeArray - local.tee $0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 i32.const 0 i32.store offset=12 - local.get $0 + local.get $1 i32.load offset=4 i32.const 0 - local.get $0 + local.get $1 i32.load offset=8 call $~lib/memory/memory.fill - local.get $0 + local.get $1 ) - (func $std/array/createReverseOrderedArray (; 91 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/createReverseOrderedArray (; 151 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 call $~lib/array/Array.create - local.set $2 - loop $repeat|0 - block $break|0 - local.get $1 - local.get $0 - i32.ge_s - br_if $break|0 + local.set $1 + block $break|0 + i32.const 0 + local.set $2 + loop $repeat|0 local.get $2 + local.get $0 + i32.lt_s + i32.eqz + br_if $break|0 local.get $1 + local.get $2 local.get $0 i32.const 1 i32.sub - local.get $1 + local.get $2 i32.sub call $~lib/array/Array#__set - local.get $1 + local.get $2 i32.const 1 i32.add - local.set $1 + local.set $2 br $repeat|0 + unreachable end + unreachable end - local.get $2 + local.get $1 ) - (func $~lib/math/NativeMath.random (; 92 ;) (type $FUNCSIG$d) (result f64) + (func $~lib/math/NativeMath.random (; 152 ;) (type $FUNCSIG$d) (result f64) (local $0 i64) (local $1 i64) + (local $2 i64) global.get $~lib/math/random_seeded i32.eqz if - i32.const 0 - i32.const 3000 + i32.const 3904 + i32.const 3128 i32.const 1030 i32.const 24 call $~lib/builtins/abort @@ -4518,188 +7647,512 @@ global.get $~lib/math/random_state0_64 local.set $0 global.get $~lib/math/random_state1_64 - local.tee $1 + local.set $1 + local.get $1 global.set $~lib/math/random_state0_64 local.get $0 + local.get $0 i64.const 23 i64.shl - local.get $0 i64.xor - local.tee $0 + local.set $0 + local.get $0 local.get $0 i64.const 17 i64.shr_u i64.xor + local.set $0 + local.get $0 local.get $1 i64.xor + local.set $0 + local.get $0 local.get $1 i64.const 26 i64.shr_u i64.xor - local.tee $0 - global.set $~lib/math/random_state1_64 + local.set $0 local.get $0 + global.set $~lib/math/random_state1_64 local.get $1 + local.get $0 i64.add i64.const 4503599627370495 i64.and i64.const 4607182418800017408 i64.or + local.set $2 + local.get $2 f64.reinterpret_i64 f64.const 1 f64.sub ) - (func $std/array/createRandomOrderedArray (; 93 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/createRandomOrderedArray (; 153 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 call $~lib/array/Array.create - local.set $2 - loop $repeat|0 - block $break|0 - local.get $1 - local.get $0 - i32.ge_s - br_if $break|0 + local.set $1 + block $break|0 + i32.const 0 + local.set $2 + loop $repeat|0 local.get $2 + local.get $0 + i32.lt_s + i32.eqz + br_if $break|0 local.get $1 + local.get $2 call $~lib/math/NativeMath.random local.get $0 f64.convert_i32_s f64.mul i32.trunc_f64_s call $~lib/array/Array#__set - local.get $1 + local.get $2 i32.const 1 i32.add - local.set $1 + local.set $2 br $repeat|0 + unreachable end + unreachable end - local.get $2 + local.get $1 ) - (func $std/array/isSorted (; 94 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|1 (; 154 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $1 + i32.sub + ) + (func $std/array/isSorted (; 155 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - i32.const 1 - local.set $2 local.get $0 - i32.load offset=12 - local.set $3 - loop $repeat|0 - local.get $2 - local.get $3 - i32.lt_s - if - i32.const 2 - global.set $~lib/argc - local.get $0 - local.get $2 + call $~lib/rt/purerc/__retain + drop + block $break|0 + block i32.const 1 - i32.sub - call $~lib/array/Array#__get + local.set $2 local.get $0 + call $~lib/array/Array#get:length + local.set $3 + end + loop $repeat|0 local.get $2 - call $~lib/array/Array#__get - local.get $1 - call_indirect (type $FUNCSIG$iii) + local.get $3 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $0 + local.get $2 + i32.const 1 + i32.sub + call $~lib/array/Array#__get + local.get $0 + local.get $2 + call $~lib/array/Array#__get + local.get $1 + call_indirect (type $FUNCSIG$iii) + end i32.const 0 i32.gt_s if + local.get $0 + call $~lib/rt/purerc/__release i32.const 0 return - else - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 end + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 unreachable end + unreachable end + local.get $0 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $std/array/assertSorted (; 95 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted (; 156 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#sort + local.tee $2 local.get $1 call $std/array/isSorted i32.eqz if i32.const 0 - i32.const 160 - i32.const 813 + i32.const 232 + i32.const 832 i32.const 2 call $~lib/builtins/abort unreachable end - ) - (func $std/array/assertSortedDefault (; 96 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $2 + call $~lib/rt/purerc/__release local.get $0 - i32.const 48 - call $std/array/assertSorted + call $~lib/rt/purerc/__release ) - (func $start:std/array~anonymous|44 (; 97 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/assertSortedDefault (; 157 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + block $~lib/util/sort/COMPARATOR|inlined.1 (result i32) + i32.const 48 + br $~lib/util/sort/COMPARATOR|inlined.1 + end + call $std/array/assertSorted + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $start:std/array~anonymous|43 (; 158 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $1 + i32.sub + ) + (func $start:std/array~anonymous|44 (; 159 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.sub ) - (func $~lib/array/Array.create<~lib/array/Array> (; 98 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 512 - i32.const 2 - i32.const 24 - i32.const 0 - call $~lib/util/runtime/makeArray - local.tee $0 - i32.const 0 - i32.store offset=12 - local.get $0 - i32.load offset=4 - i32.const 0 - local.get $0 - i32.load offset=8 - call $~lib/memory/memory.fill + (func $start:std/array~anonymous|45 (; 160 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 + local.get $1 + i32.sub ) - (func $~lib/array/Array<~lib/array/Array>#__set (; 99 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) + (func $start:std/array~anonymous|46 (; 161 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 - i32.load offset=12 - local.tee $3 + i32.sub + ) + (func $~lib/array/Array.create<~lib/array/Array> (; 162 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 268435452 i32.gt_u if - i32.const 0 - i32.const 280 - i32.const 111 - i32.const 38 + i32.const 24 + i32.const 456 + i32.const 45 + i32.const 61 call $~lib/builtins/abort unreachable end local.get $0 + i32.const 2 + i32.const 24 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.load offset=4 + i32.const 0 + local.get $1 + i32.load offset=8 + call $~lib/memory/memory.fill + local.get $1 + ) + (func $~lib/rt/common/__typeinfo (; 163 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 400 + i32.const 4120 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/purerc/growRoots (; 164 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 165 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store local.get $1 i32.const 1 i32.add - call $~lib/array/ensureCapacity + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 166 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 320 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 320 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__retainRelease (; 167 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.ne + if + global.get $~lib/builtins/HEAP_BASE + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + local.get $2 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + end + local.get $0 + ) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_set (; 168 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=4 local.get $1 i32.const 2 i32.shl i32.add - local.tee $4 - i32.load + local.set $3 + local.get $3 local.get $2 - i32.ne + local.get $3 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $2 + call $~lib/rt/purerc/__release + ) + (func $~lib/array/Array<~lib/array/Array>#__set (; 169 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + local.set $3 + local.get $1 + local.get $3 + i32.gt_u if - local.get $4 local.get $2 - i32.store + call $~lib/rt/purerc/__release + block + i32.const 4008 + i32.const 456 + i32.const 112 + i32.const 38 + call $~lib/builtins/abort + unreachable + unreachable + end + unreachable end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + local.get $1 + local.get $2 + call $~lib/array/Array<~lib/array/Array>#__unchecked_set local.get $1 local.get $3 i32.ge_s @@ -4710,69 +8163,190 @@ i32.add i32.store offset=12 end + local.get $2 + call $~lib/rt/purerc/__release ) - (func $std/array/createReverseOrderedNestedArray (; 100 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + (func $std/array/createReverseOrderedNestedArray (; 170 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) + (local $3 i32) + local.get $0 call $~lib/array/Array.create<~lib/array/Array> local.set $1 - loop $repeat|0 - local.get $0 - i32.const 512 - i32.lt_s - if + block $break|0 + i32.const 0 + local.set $2 + loop $repeat|0 + local.get $2 + local.get $0 + i32.lt_s + i32.eqz + br_if $break|0 i32.const 1 call $~lib/array/Array.create - local.tee $2 + local.set $3 + local.get $3 i32.const 0 - i32.const 511 local.get $0 + i32.const 1 + i32.sub + local.get $2 i32.sub call $~lib/array/Array#__set local.get $1 - local.get $0 local.get $2 + local.get $3 call $~lib/array/Array<~lib/array/Array>#__set - local.get $0 + local.get $3 + call $~lib/rt/purerc/__release + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $repeat|0 + unreachable end + unreachable end local.get $1 ) - (func $start:std/array~anonymous|47 (; 101 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|47 (; 171 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 0 - call $~lib/array/Array#__get + call $~lib/array/Array#__get local.get $1 i32.const 0 - call $~lib/array/Array#__get + call $~lib/array/Array#__get i32.sub + local.set $2 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 ) - (func $~lib/array/Array<~lib/array/Array>#sort (; 102 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/insertionSort<~lib/array/Array> (; 172 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $1 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + local.get $6 + call $~lib/rt/purerc/__release + br $break|1 + end + local.get $6 + call $~lib/rt/purerc/__release + br $continue|1 + end + end + end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store + local.get $4 + call $~lib/rt/purerc/__release + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $~lib/array/Array<~lib/array/Array>#sort (; 173 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 280 - i32.const 528 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + (local $5 i32) + (local $6 i32) local.get $0 i32.load offset=12 - local.tee $2 + local.set $2 + local.get $2 i32.const 1 i32.le_s if local.get $0 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -4784,44 +8358,78 @@ if local.get $3 i32.load offset=4 - local.set $2 + call $~lib/rt/purerc/__retain + local.set $4 local.get $3 i32.load - local.set $4 - i32.const 2 - global.set $~lib/argc - local.get $2 - local.get $4 - local.get $1 - call_indirect (type $FUNCSIG$iii) + call $~lib/rt/purerc/__retain + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end i32.const 0 i32.lt_s if local.get $3 - local.get $4 + local.get $5 i32.store offset=4 local.get $3 - local.get $2 + local.get $4 i32.store end local.get $0 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $6 return end - local.get $3 - local.get $2 - local.get $1 - call $~lib/util/sort/insertionSort + block $~lib/util/sort/SORT<~lib/array/Array>|inlined.0 + local.get $3 + local.set $6 + local.get $2 + local.set $4 + local.get $1 + local.set $5 + local.get $6 + local.get $4 + local.get $5 + call $~lib/util/sort/insertionSort<~lib/array/Array> + end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array<~lib/array/Array>#__get (; 103 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#get:length (; 174 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_get (; 175 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + ) + (func $~lib/array/Array<~lib/array/Array>#__get (; 176 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=12 i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 96 + i32.const 4008 + i32.const 456 + i32.const 97 i32.const 45 call $~lib/builtins/abort unreachable @@ -4833,13 +8441,464 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 99 + i32.const 400 + i32.const 456 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__unchecked_get + ) + (func $std/array/isSorted<~lib/array/Array> (; 177 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + block $break|0 + block + i32.const 1 + local.set $2 + local.get $0 + call $~lib/array/Array<~lib/array/Array>#get:length + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $0 + local.get $2 + i32.const 1 + i32.sub + call $~lib/array/Array<~lib/array/Array>#__get + local.tee $4 + local.get $0 + local.get $2 + call $~lib/array/Array<~lib/array/Array>#__get + local.tee $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.gt_s + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + i32.const 1 + ) + (func $std/array/assertSorted<~lib/array/Array> (; 178 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#sort + local.tee $2 + local.get $1 + call $std/array/isSorted<~lib/array/Array> + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 832 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/array/Array.create> (; 179 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 268435452 + i32.gt_u + if + i32.const 24 + i32.const 456 + i32.const 45 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + i32.const 26 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.load offset=4 + i32.const 0 + local.get $1 + i32.load offset=8 + call $~lib/memory/memory.fill + local.get $1 + ) + (func $std/array/Proxy#constructor (; 180 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 25 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + local.get $1 + i32.store + local.get $0 + ) + (func $~lib/array/Array>#__unchecked_set (; 181 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.set $3 + local.get $3 + local.get $2 + local.get $3 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $2 + call $~lib/rt/purerc/__release + ) + (func $~lib/array/Array>#__set (; 182 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + local.set $3 + local.get $1 + local.get $3 + i32.gt_u + if + local.get $2 + call $~lib/rt/purerc/__release + block + i32.const 4008 + i32.const 456 + i32.const 112 + i32.const 38 + call $~lib/builtins/abort + unreachable + unreachable + end + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + local.get $1 + local.get $2 + call $~lib/array/Array>#__unchecked_set + local.get $1 + local.get $3 + i32.ge_s + if + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=12 + end + local.get $2 + call $~lib/rt/purerc/__release + ) + (func $std/array/createReverseOrderedElementsArray (; 183 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/array/Array.create> + local.set $1 + block $break|0 + i32.const 0 + local.set $2 + loop $repeat|0 + local.get $2 + local.get $0 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $1 + local.get $2 + i32.const 0 + local.get $0 + i32.const 1 + i32.sub + local.get $2 + i32.sub + call $std/array/Proxy#constructor + local.tee $3 + call $~lib/array/Array>#__set + local.get $3 + call $~lib/rt/purerc/__release + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $start:std/array~anonymous|48 (; 184 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load + local.get $1 + i32.load + i32.sub + local.set $2 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + ) + (func $~lib/util/sort/insertionSort> (; 185 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $1 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + local.get $6 + call $~lib/rt/purerc/__release + br $break|1 + end + local.get $6 + call $~lib/rt/purerc/__release + br $continue|1 + end + end + end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store + local.get $4 + call $~lib/rt/purerc/__release + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $~lib/array/Array>#sort (; 186 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.le_s + if + local.get $0 + call $~lib/rt/purerc/__retain + return + end + local.get $0 + i32.load offset=4 + local.set $3 + local.get $2 + i32.const 2 + i32.eq + if + local.get $3 + i32.load offset=4 + call $~lib/rt/purerc/__retain + local.set $4 + local.get $3 + i32.load + call $~lib/rt/purerc/__retain + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $3 + local.get $5 + i32.store offset=4 + local.get $3 + local.get $4 + i32.store + end + local.get $0 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $6 + return + end + block $~lib/util/sort/SORT>|inlined.0 + local.get $3 + local.set $6 + local.get $2 + local.set $4 + local.get $1 + local.set $5 + local.get $6 + local.get $4 + local.get $5 + call $~lib/util/sort/insertionSort> + end + local.get $0 + call $~lib/rt/purerc/__retain + ) + (func $~lib/array/Array>#get:length (; 187 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array>#__unchecked_get (; 188 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -4847,219 +8906,597 @@ i32.shl i32.add i32.load + call $~lib/rt/purerc/__retain ) - (func $std/array/isSorted<~lib/array/Array> (; 104 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - i32.const 1 - local.set $2 + (func $~lib/array/Array>#__get (; 189 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 i32.load offset=12 - local.set $3 - loop $repeat|0 - local.get $2 - local.get $3 - i32.lt_s - if - i32.const 2 - global.set $~lib/argc - local.get $0 - local.get $2 + i32.ge_u + if + i32.const 4008 + i32.const 456 + i32.const 97 + i32.const 45 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 400 + i32.const 456 + i32.const 100 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array>#__unchecked_get + ) + (func $std/array/isSorted> (; 190 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + block $break|0 + block i32.const 1 - i32.sub - call $~lib/array/Array<~lib/array/Array>#__get + local.set $2 local.get $0 + call $~lib/array/Array>#get:length + local.set $3 + end + loop $repeat|0 local.get $2 - call $~lib/array/Array<~lib/array/Array>#__get - local.get $1 - call_indirect (type $FUNCSIG$iii) + local.get $3 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $0 + local.get $2 + i32.const 1 + i32.sub + call $~lib/array/Array>#__get + local.tee $4 + local.get $0 + local.get $2 + call $~lib/array/Array>#__get + local.tee $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end i32.const 0 i32.gt_s if + local.get $0 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release i32.const 0 return - else - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 end + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 unreachable end + unreachable end + local.get $0 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $std/array/assertSorted<~lib/array/Array> (; 105 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted> (; 191 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 - call $~lib/array/Array<~lib/array/Array>#sort + call $~lib/array/Array>#sort + local.tee $2 local.get $1 - call $std/array/isSorted<~lib/array/Array> + call $std/array/isSorted> i32.eqz if i32.const 0 - i32.const 160 - i32.const 813 + i32.const 232 + i32.const 832 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/array/Array.create> (; 106 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 512 - i32.const 2 - i32.const 26 - i32.const 0 - call $~lib/util/runtime/makeArray - local.tee $0 - i32.const 0 - i32.store offset=12 + (func $~lib/util/sort/insertionSort<~lib/string/String | null> (; 192 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $1 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + local.get $6 + call $~lib/rt/purerc/__release + br $break|1 + end + local.get $6 + call $~lib/rt/purerc/__release + br $continue|1 + end + end + end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store + local.get $4 + call $~lib/rt/purerc/__release + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $~lib/array/Array<~lib/string/String | null>#sort (; 193 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.le_s + if + local.get $0 + call $~lib/rt/purerc/__retain + return + end local.get $0 i32.load offset=4 - i32.const 0 - local.get $0 - i32.load offset=8 - call $~lib/memory/memory.fill - local.get $0 - ) - (func $std/array/createReverseOrderedElementsArray (; 107 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - call $~lib/array/Array.create> - local.set $1 - loop $repeat|0 - local.get $0 - i32.const 512 + local.set $3 + local.get $2 + i32.const 2 + i32.eq + if + local.get $3 + i32.load offset=4 + call $~lib/rt/purerc/__retain + local.set $4 + local.get $3 + i32.load + call $~lib/rt/purerc/__retain + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 i32.lt_s if - i32.const 4 - call $~lib/util/runtime/allocate - i32.const 25 - call $~lib/util/runtime/register - local.tee $2 - i32.const 511 - local.get $0 - i32.sub + local.get $3 + local.get $5 + i32.store offset=4 + local.get $3 + local.get $4 i32.store - local.get $1 - local.get $0 - local.get $2 - call $~lib/array/Array<~lib/array/Array>#__set - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 end + local.get $0 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $6 + return end - local.get $1 - ) - (func $start:std/array~anonymous|48 (; 108 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.load - local.get $1 - i32.load - i32.sub - ) - (func $~lib/util/string/compareImpl (; 109 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - loop $continue|0 + block $~lib/util/sort/SORT<~lib/string/String | null>|inlined.0 + local.get $3 + local.set $6 local.get $2 - if (result i32) - local.get $0 - i32.load16_u - local.get $1 - i32.load16_u - i32.sub - local.tee $3 - i32.eqz - else - i32.const 0 - end - if - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - i32.const 2 - i32.add - local.set $0 - local.get $1 - i32.const 2 - i32.add - local.set $1 - br $continue|0 - end + local.set $4 + local.get $1 + local.set $5 + local.get $6 + local.get $4 + local.get $5 + call $~lib/util/sort/insertionSort<~lib/string/String | null> end - local.get $3 + local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 (; 110 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#get:length (; 194 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array<~lib/string/String | null>#__unchecked_get (; 195 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + ) + (func $~lib/array/Array<~lib/string/String | null>#__get (; 196 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 400 + i32.const 456 + i32.const 100 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String | null>#__unchecked_get + ) + (func $std/array/isSorted<~lib/string/String | null> (; 197 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - i32.const 1 - local.get $1 - i32.eqz - i32.const 1 + (local $4 i32) + (local $5 i32) local.get $0 + call $~lib/rt/purerc/__retain + drop + block $break|0 + block + i32.const 1 + local.set $2 + local.get $0 + call $~lib/array/Array<~lib/string/String | null>#get:length + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $0 + local.get $2 + i32.const 1 + i32.sub + call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $4 + local.get $0 + local.get $2 + call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.gt_s + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + i32.const 1 + ) + (func $std/array/assertSorted<~lib/string/String | null> (; 198 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String | null>#sort + local.tee $2 + local.get $1 + call $std/array/isSorted<~lib/string/String | null> i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 832 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/string/String#get:length (; 199 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (; 200 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $2 + call $~lib/rt/purerc/__retain + drop + i32.const 0 + local.set $5 + local.get $0 + local.get $1 + i32.const 1 + i32.shl + i32.add + local.set $6 + local.get $2 + local.get $3 + i32.const 1 + i32.shl + i32.add + local.set $7 + block $break|0 + loop $continue|0 + local.get $4 + if (result i32) + local.get $6 + i32.load16_u + local.get $7 + i32.load16_u + i32.sub + local.tee $5 + i32.eqz + else + i32.const 0 + end + if + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $6 + i32.const 2 + i32.add + local.set $6 + local.get $7 + i32.const 2 + i32.add + local.set $7 + br $continue|0 + end + end + end + local.get $0 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $5 + ) + (func $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 (; 201 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 i32.eq - select - select + if (result i32) + i32.const 1 + else + local.get $0 + i32.const 0 + i32.eq + end + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end - i32.const 0 - local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $2 - i32.eqz local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $3 - select - if - i32.const 0 - return - end - local.get $3 + call $~lib/string/String#get:length + local.set $2 + local.get $1 + call $~lib/string/String#get:length + local.set $3 + local.get $2 i32.eqz + if (result i32) + local.get $3 + i32.eqz + else + i32.const 0 + end if - i32.const -1 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 return end local.get $2 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const -1 + return + end + local.get $3 + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end local.get $0 + call $~lib/rt/purerc/__release local.get $1 - local.get $3 + call $~lib/rt/purerc/__release + local.get $0 + i32.const 0 + local.get $1 + i32.const 0 local.get $2 + local.tee $4 local.get $3 - local.get $2 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select call $~lib/util/string/compareImpl ) - (func $std/array/assertSorted<~lib/string/String | null>|trampoline (; 111 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) + (func $std/array/assertSorted<~lib/string/String | null>|trampoline (; 202 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) block $1of1 block $0of1 block $outOfRange @@ -5070,395 +9507,1051 @@ end unreachable end - i32.const 55 + block $~lib/util/sort/COMPARATOR<~lib/string/String | null>|inlined.0 (result i32) + i32.const 55 + br $~lib/util/sort/COMPARATOR<~lib/string/String | null>|inlined.0 + end local.set $1 end local.get $0 local.get $1 - call $~lib/array/Array<~lib/array/Array>#sort - local.get $1 - call $std/array/isSorted - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 813 - i32.const 2 - call $~lib/builtins/abort - unreachable - end + call $std/array/assertSorted<~lib/string/String | null> ) - (func $~lib/string/String.__eq (; 112 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 203 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 local.get $1 i32.eq if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end - local.get $1 - i32.eqz - i32.const 1 local.get $0 - select + i32.const 0 + i32.eq + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $2 + call $~lib/string/String#get:length + local.set $2 + local.get $2 local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end local.get $0 + call $~lib/rt/purerc/__release local.get $1 + call $~lib/rt/purerc/__release + local.get $0 + i32.const 0 + local.get $1 + i32.const 0 local.get $2 call $~lib/util/string/compareImpl i32.eqz ) - (func $std/array/isArraysEqual<~lib/string/String | null> (; 113 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/string/String.__ne (; 204 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 + local.get $1 + call $~lib/string/String.__eq + i32.eqz + ) + (func $std/array/isArraysEqual<~lib/string/String | null> (; 205 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 - i32.load offset=12 - local.tee $3 + call $~lib/rt/purerc/__retain + drop local.get $1 - i32.load offset=12 - i32.ne + call $~lib/rt/purerc/__retain + drop + local.get $2 + i32.eqz if - i32.const 0 - return - end - local.get $0 - local.get $1 - i32.eq - if - i32.const 1 - return - end - loop $repeat|0 + local.get $0 + call $~lib/array/Array<~lib/string/String | null>#get:length + local.set $2 local.get $2 - local.get $3 - i32.lt_s + local.get $1 + call $~lib/array/Array<~lib/string/String | null>#get:length + i32.ne if local.get $0 - local.get $2 - call $~lib/array/Array#__get + call $~lib/rt/purerc/__release local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $0 + local.get $1 + i32.eq + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 1 + return + end + end + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 local.get $2 - call $~lib/array/Array#__get - call $~lib/string/String.__eq + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $4 + local.get $1 + local.get $3 + call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $5 + call $~lib/string/String.__ne if - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 - else + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release i32.const 0 return end + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 unreachable end + unreachable end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $~lib/array/Array.create<~lib/string/String> (; 114 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 400 + (func $~lib/array/Array.create<~lib/string/String> (; 206 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 268435452 + i32.gt_u + if + i32.const 24 + i32.const 456 + i32.const 45 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 i32.const 2 i32.const 28 i32.const 0 - call $~lib/util/runtime/makeArray - local.tee $0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 i32.const 0 i32.store offset=12 - local.get $0 + local.get $1 i32.load offset=4 i32.const 0 - local.get $0 + local.get $1 i32.load offset=8 call $~lib/memory/memory.fill - local.get $0 + local.get $1 ) - (func $~lib/string/String#charAt (; 115 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/string/String#charAt (; 207 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 - i32.const 3028 - i32.load - i32.const 1 - i32.shr_u + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 4384 + i32.const 40 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + call $~lib/string/String#get:length i32.ge_u if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain return end i32.const 2 - call $~lib/util/runtime/allocate - local.tee $1 + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $2 + local.get $2 local.get $0 + local.get $1 i32.const 1 i32.shl - i32.const 3040 i32.add i32.load16_u i32.store16 - local.get $1 - i32.const 16 - call $~lib/util/runtime/register + local.get $2 + call $~lib/rt/purerc/__retain ) - (func $~lib/string/String#concat (; 116 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 208 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $1 - i32.const 4432 + call $~lib/rt/purerc/__retain + drop local.get $1 - select - local.tee $3 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $4 - local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $1 - i32.add - local.tee $2 - i32.eqz + i32.const 0 + i32.eq if - i32.const 4208 + i32.const 4432 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + end + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $2 + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $3 + local.get $2 + local.get $3 + i32.add + local.set $4 + local.get $4 + i32.const 0 + i32.eq + if + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end - local.get $2 - call $~lib/util/runtime/allocate - local.tee $2 + local.get $4 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $6 + local.get $6 local.get $0 - local.get $1 + local.get $2 call $~lib/memory/memory.copy - local.get $1 + local.get $6 local.get $2 i32.add + local.get $1 local.get $3 - local.get $4 call $~lib/memory/memory.copy - local.get $2 - i32.const 16 - call $~lib/util/runtime/register + local.get $6 + local.set $5 + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 ) - (func $~lib/string/String.__concat (; 117 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 209 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 4432 local.get $0 + i32.const 0 + i32.ne select local.get $1 call $~lib/string/String#concat + local.set $2 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 ) - (func $std/array/createRandomString (; 118 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/createRandomString (; 210 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - i32.const 4208 + (local $3 f64) + (local $4 i32) + (local $5 i32) + i32.const 4272 + call $~lib/rt/purerc/__retain local.set $1 - loop $repeat|0 - local.get $2 - local.get $0 - i32.lt_s - if + block $break|0 + i32.const 0 + local.set $2 + loop $repeat|0 + local.get $2 + local.get $0 + i32.lt_s + i32.eqz + br_if $break|0 local.get $1 - call $~lib/math/NativeMath.random - i32.const 3028 - i32.load - i32.const 1 - i32.shr_u - f64.convert_i32_s - f64.mul - f64.floor + global.get $std/array/charset + block $~lib/math/NativeMath.floor|inlined.0 (result f64) + call $~lib/math/NativeMath.random + global.get $std/array/charset + call $~lib/string/String#get:length + f64.convert_i32_s + f64.mul + local.set $3 + local.get $3 + f64.floor + end i32.trunc_f64_s call $~lib/string/String#charAt + local.tee $4 call $~lib/string/String.__concat + local.tee $5 + local.get $1 + call $~lib/rt/purerc/__retainRelease local.set $1 + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release local.get $2 i32.const 1 i32.add local.set $2 br $repeat|0 + unreachable end + unreachable end local.get $1 ) - (func $std/array/createRandomStringArray (; 119 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + (func $~lib/array/Array<~lib/string/String>#__unchecked_set (; 211 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.set $3 + local.get $3 + local.get $2 + local.get $3 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $2 + call $~lib/rt/purerc/__release + ) + (func $~lib/array/Array<~lib/string/String>#__set (; 212 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + local.set $3 + local.get $1 + local.get $3 + i32.gt_u + if + local.get $2 + call $~lib/rt/purerc/__release + block + i32.const 4008 + i32.const 456 + i32.const 112 + i32.const 38 + call $~lib/builtins/abort + unreachable + unreachable + end + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + local.get $1 + local.get $2 + call $~lib/array/Array<~lib/string/String>#__unchecked_set + local.get $1 + local.get $3 + i32.ge_s + if + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=12 + end + local.get $2 + call $~lib/rt/purerc/__release + ) + (func $std/array/createRandomStringArray (; 213 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 call $~lib/array/Array.create<~lib/string/String> local.set $1 - loop $repeat|0 - local.get $0 - i32.const 400 - i32.lt_s - if - local.get $1 + block $break|0 + i32.const 0 + local.set $2 + loop $repeat|0 + local.get $2 local.get $0 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $1 + local.get $2 call $~lib/math/NativeMath.random f64.const 32 f64.mul i32.trunc_f64_s call $std/array/createRandomString - call $~lib/array/Array<~lib/array/Array>#__set - local.get $0 + local.tee $3 + call $~lib/array/Array<~lib/string/String>#__set + local.get $3 + call $~lib/rt/purerc/__release + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $repeat|0 + unreachable end + unreachable end local.get $1 ) - (func $~lib/string/String#substring (; 120 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/insertionSort<~lib/string/String> (; 214 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $1 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + local.get $6 + call $~lib/rt/purerc/__release + br $break|1 + end + local.get $6 + call $~lib/rt/purerc/__release + br $continue|1 + end + end + end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store + local.get $4 + call $~lib/rt/purerc/__release + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $~lib/array/Array<~lib/string/String>#sort (; 215 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 - i32.eqz + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.le_s if + local.get $0 + call $~lib/rt/purerc/__retain + return + end + local.get $0 + i32.load offset=4 + local.set $3 + local.get $2 + i32.const 2 + i32.eq + if + local.get $3 + i32.load offset=4 + call $~lib/rt/purerc/__retain + local.set $4 + local.get $3 + i32.load + call $~lib/rt/purerc/__retain + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end i32.const 0 - i32.const 4384 - i32.const 203 - i32.const 4 + i32.lt_s + if + local.get $3 + local.get $5 + i32.store offset=4 + local.get $3 + local.get $4 + i32.store + end + local.get $0 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $6 + return + end + block $~lib/util/sort/SORT<~lib/string/String>|inlined.0 + local.get $3 + local.set $6 + local.get $2 + local.set $4 + local.get $1 + local.set $5 + local.get $6 + local.get $4 + local.get $5 + call $~lib/util/sort/insertionSort<~lib/string/String> + end + local.get $0 + call $~lib/rt/purerc/__retain + ) + (func $~lib/array/Array<~lib/string/String>#get:length (; 216 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 217 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + ) + (func $~lib/array/Array<~lib/string/String>#__get (; 218 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 4008 + i32.const 456 + i32.const 97 + i32.const 45 call $~lib/builtins/abort unreachable end - i32.const 0 + local.get $1 local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 + i32.load offset=8 + i32.const 2 i32.shr_u - local.tee $2 - i32.const 0 - local.get $2 - i32.lt_s - select - local.tee $3 + i32.ge_u + if + i32.const 400 + i32.const 456 + i32.const 100 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 local.get $1 - i32.const 0 - local.get $1 - i32.const 0 - i32.gt_s - select - local.tee $1 - local.get $2 - local.get $1 - local.get $2 - i32.lt_s - select - local.tee $2 - local.get $3 - local.get $2 - i32.gt_s - select + call $~lib/array/Array<~lib/string/String>#__unchecked_get + ) + (func $std/array/isSorted<~lib/string/String> (; 219 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + block $break|0 + block + i32.const 1 + local.set $2 + local.get $0 + call $~lib/array/Array<~lib/string/String>#get:length + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $0 + local.get $2 + i32.const 1 + i32.sub + call $~lib/array/Array<~lib/string/String>#__get + local.tee $4 + local.get $0 + local.get $2 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.gt_s + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release i32.const 1 - i32.shl - local.tee $1 - local.get $3 - local.get $2 - local.get $3 - local.get $2 - i32.lt_s - select - i32.const 1 - i32.shl - local.tee $3 - i32.sub + ) + (func $std/array/assertSorted<~lib/string/String> (; 220 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#sort local.tee $2 + local.get $1 + call $std/array/isSorted<~lib/string/String> i32.eqz if - i32.const 4208 - return - end - local.get $3 - if (result i32) i32.const 0 + i32.const 232 + i32.const 832 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0 (; 221 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + i32.eq + if (result i32) + i32.const 1 else local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 + i32.const 0 + i32.eq + end + if (result i32) i32.const 1 - i32.shr_u - i32.const 1 - i32.shl + else local.get $1 + i32.const 0 i32.eq end if local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $0 + call $~lib/string/String#get:length + local.set $2 + local.get $1 + call $~lib/string/String#get:length + local.set $3 + local.get $2 + i32.eqz + if (result i32) + local.get $3 + i32.eqz + else + i32.const 0 + end + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 return end local.get $2 - call $~lib/util/runtime/allocate - local.tee $1 - local.get $0 + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const -1 + return + end local.get $3 - i32.add - local.get $2 - call $~lib/memory/memory.copy + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 1 + return + end + local.get $0 + call $~lib/rt/purerc/__release local.get $1 - i32.const 16 - call $~lib/util/runtime/register - ) - (func $~lib/util/runtime/discard (; 121 ;) (type $FUNCSIG$vi) (param $0 i32) + call $~lib/rt/purerc/__release local.get $0 - i32.const 8400 - i32.le_u - if - i32.const 0 - i32.const 80 - i32.const 115 - i32.const 4 - call $~lib/builtins/abort - unreachable + i32.const 0 + local.get $1 + i32.const 0 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + call $~lib/util/string/compareImpl + ) + (func $std/array/assertSorted<~lib/string/String>|trampoline (; 222 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + i32.const 1 + i32.sub + br_table $0of1 $1of1 $outOfRange + end + unreachable + end + block $~lib/util/sort/COMPARATOR<~lib/string/String>|inlined.0 (result i32) + i32.const 56 + br $~lib/util/sort/COMPARATOR<~lib/string/String>|inlined.0 + end + local.set $1 end local.get $0 - i32.const 16 - i32.sub - i32.load - i32.const -1520547049 + local.get $1 + call $std/array/assertSorted<~lib/string/String> + ) + (func $~lib/string/String#substring (; 223 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + i32.const 0 i32.ne + i32.eqz if i32.const 0 - i32.const 80 - i32.const 117 + i32.const 4384 + i32.const 196 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/string/String#get:length + local.set $3 + local.get $1 + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + local.set $6 + local.get $2 + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + local.set $7 + local.get $6 + local.tee $4 + local.get $7 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + i32.const 1 + i32.shl + local.set $8 + local.get $6 + local.tee $4 + local.get $7 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + i32.const 1 + i32.shl + local.set $9 + local.get $9 + local.get $8 + i32.sub + local.set $3 + local.get $3 + i32.eqz + if + i32.const 4272 + call $~lib/rt/purerc/__retain + return + end + local.get $8 + i32.eqz + if (result i32) + local.get $9 + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + i32.eq + else + i32.const 0 + end + if + local.get $0 + call $~lib/rt/purerc/__retain + return + end + local.get $3 + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $10 + local.get $10 + local.get $0 + local.get $8 + i32.add + local.get $3 + call $~lib/memory/memory.copy + local.get $10 + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array#join_bool (; 122 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/array/Array#join_bool (; 224 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5466,247 +10559,332 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 i32.sub - local.tee $1 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 - local.get $1 + local.set $4 + local.get $2 i32.eqz if i32.const 4480 i32.const 4504 - local.get $3 + local.get $4 i32.load8_u select + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end - i32.const 4524 - i32.load - i32.const 1 - i32.shr_u - local.tee $4 - i32.const 5 - i32.add local.get $1 - i32.mul + call $~lib/string/String#get:length + local.set $5 i32.const 5 + local.set $6 + local.get $6 + local.get $5 i32.add - local.tee $7 + local.get $2 + i32.mul + local.get $6 + i32.add + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $2 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $0 - loop $repeat|0 - local.get $5 - local.get $1 - i32.lt_s - if + local.set $9 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 local.get $3 - local.get $5 i32.add i32.load8_u - local.tee $8 - i32.eqz + local.set $10 i32.const 4 + local.get $10 + i32.const 0 + i32.ne + i32.eqz i32.add local.set $6 - local.get $0 + local.get $8 + local.get $9 i32.const 1 i32.shl - local.get $2 i32.add i32.const 4480 i32.const 4504 - local.get $8 + local.get $10 select local.get $6 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $0 + local.get $9 local.get $6 i32.add - local.set $0 - local.get $4 + local.set $9 + local.get $5 if - local.get $0 + local.get $8 + local.get $9 i32.const 1 i32.shl - local.get $2 i32.add - i32.const 4536 - local.get $4 + local.get $1 + local.get $5 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $0 - local.get $4 + local.get $9 + local.get $5 i32.add - local.set $0 + local.set $9 end - local.get $5 + local.get $3 i32.const 1 i32.add - local.set $5 + local.set $3 br $repeat|0 + unreachable end + unreachable end - local.get $1 - local.get $3 + local.get $4 + local.get $2 i32.add i32.load8_u - local.tee $3 - i32.eqz + local.set $10 i32.const 4 + local.get $10 + i32.const 0 + i32.ne + i32.eqz i32.add - local.set $1 - local.get $0 + local.set $6 + local.get $8 + local.get $9 i32.const 1 i32.shl - local.get $2 i32.add i32.const 4480 i32.const 4504 - local.get $3 + local.get $10 select - local.get $1 + local.get $6 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $7 - local.get $0 - local.get $1 + local.get $9 + local.get $6 i32.add - local.tee $0 + local.set $9 + local.get $7 + local.get $9 i32.gt_s if - local.get $2 - local.get $0 + local.get $8 + i32.const 0 + local.get $9 call $~lib/string/String#substring - local.set $0 - local.get $2 - call $~lib/util/runtime/discard - local.get $0 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end - local.get $2 - i32.const 16 - call $~lib/util/runtime/register + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/util/number/decimalCount32 (; 123 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#join (; 225 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_bool + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return + ) + (func $~lib/util/number/decimalCount32 (; 226 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) local.get $0 i32.const 100000 i32.lt_u - if (result i32) + if local.get $0 i32.const 100 i32.lt_u - if (result i32) + if i32.const 1 i32.const 2 local.get $0 i32.const 10 i32.lt_u select + return else - i32.const 3 i32.const 4 i32.const 5 local.get $0 i32.const 10000 i32.lt_u select + local.set $1 + i32.const 3 + local.get $1 local.get $0 i32.const 1000 i32.lt_u select + return end + unreachable + unreachable else local.get $0 i32.const 10000000 i32.lt_u - if (result i32) + if i32.const 6 i32.const 7 local.get $0 i32.const 1000000 i32.lt_u select + return else - i32.const 8 i32.const 9 i32.const 10 local.get $0 i32.const 1000000000 i32.lt_u select + local.set $1 + i32.const 8 + local.get $1 local.get $0 i32.const 100000000 i32.lt_u select + return end + unreachable + unreachable end + unreachable + unreachable ) - (func $~lib/util/number/utoa32_lut (; 124 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/number/utoa32_lut (; 227 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - i32.const 5100 - i32.load + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + (local $9 i64) + i32.const 5072 + i32.load offset=4 local.set $3 - loop $continue|0 - local.get $1 - i32.const 10000 - i32.ge_u - if + block $break|0 + loop $continue|0 local.get $1 i32.const 10000 - i32.rem_u - local.set $4 - local.get $1 - i32.const 10000 - i32.div_u - local.set $1 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - br $continue|0 + i32.ge_u + if + local.get $1 + i32.const 10000 + i32.div_u + local.set $4 + local.get $1 + i32.const 10000 + i32.rem_u + local.set $5 + local.get $4 + local.set $1 + local.get $5 + i32.const 100 + i32.div_u + local.set $6 + local.get $5 + i32.const 100 + i32.rem_u + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $8 + local.get $3 + local.get $7 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $9 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $8 + local.get $9 + i64.const 32 + i64.shl + i64.or + i64.store + br $continue|0 + end end end local.get $1 @@ -5715,26 +10893,31 @@ if local.get $1 i32.const 100 - i32.rem_u - local.set $4 + i32.div_u + local.set $7 local.get $1 i32.const 100 - i32.div_u + i32.rem_u + local.set $6 + local.get $7 local.set $1 local.get $2 i32.const 2 i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $4 + local.set $2 + local.get $3 + local.get $6 i32.const 2 i32.shl - local.get $3 i32.add i32.load + local.set $5 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $5 i32.store end local.get $1 @@ -5744,45 +10927,58 @@ local.get $2 i32.const 2 i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add + local.set $2 + local.get $3 local.get $1 i32.const 2 i32.shl - local.get $3 i32.add i32.load + local.set $5 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $5 i32.store else local.get $2 i32.const 1 i32.sub + local.set $2 + i32.const 48 + local.get $1 + i32.add + local.set $5 + local.get $0 + local.get $2 i32.const 1 i32.shl - local.get $0 - i32.add - local.get $1 - i32.const 48 i32.add + local.get $5 i32.store16 end ) - (func $~lib/util/number/itoa32 (; 125 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (; 228 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 i32.eqz if - i32.const 4656 + i32.const 4632 + call $~lib/rt/purerc/__retain return end local.get $0 i32.const 0 i32.lt_s - local.tee $1 + local.set $1 + local.get $1 if i32.const 0 local.get $0 @@ -5793,29 +10989,49 @@ call $~lib/util/number/decimalCount32 local.get $1 i32.add - local.tee $3 + local.set $2 + local.get $2 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.tee $2 - local.get $0 - local.get $3 - call $~lib/util/number/utoa32_lut + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $3 + block $~lib/util/number/utoa32_core|inlined.0 + local.get $3 + local.set $6 + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/number/utoa32_lut + end local.get $1 if - local.get $2 + local.get $3 i32.const 45 i32.store16 end - local.get $2 - i32.const 16 - call $~lib/util/runtime/register + local.get $3 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/itoa_stream (; 126 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa (; 229 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/util/number/itoa32 + return + ) + (func $~lib/util/number/itoa_stream (; 230 ;) (type $FUNCSIG$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) + local.get $0 local.get $1 i32.const 1 i32.shl - local.get $0 i32.add local.set $0 local.get $2 @@ -5827,185 +11043,263 @@ i32.const 1 return end - local.get $0 - block (result i32) - local.get $2 + i32.const 0 + local.set $3 + local.get $2 + i32.const 0 + i32.lt_s + local.set $4 + local.get $4 + if i32.const 0 - i32.lt_s - local.tee $1 - if - i32.const 0 - local.get $2 - i32.sub - local.set $2 - end local.get $2 + i32.sub + local.set $2 end local.get $2 call $~lib/util/number/decimalCount32 - local.get $1 + local.get $4 i32.add - local.tee $2 - call $~lib/util/number/utoa32_lut - local.get $1 + local.set $3 + block $~lib/util/number/utoa32_core|inlined.1 + local.get $0 + local.set $7 + local.get $2 + local.set $6 + local.get $3 + local.set $5 + local.get $7 + local.get $6 + local.get $5 + call $~lib/util/number/utoa32_lut + end + local.get $4 if local.get $0 i32.const 45 i32.store16 end - local.get $2 + local.get $3 ) - (func $~lib/array/Array#join_int (; 127 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 231 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 i32.sub - local.tee $3 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 local.set $4 - local.get $3 + local.get $2 i32.eqz if local.get $4 i32.load - call $~lib/util/number/itoa32 + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $5 + call $~lib/string/String#get:length + local.set $6 i32.const 11 + local.get $6 i32.add - local.get $3 + local.get $2 i32.mul i32.const 11 i32.add - local.tee $7 + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $2 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $0 - loop $repeat|0 - local.get $6 - local.get $3 - i32.lt_s - if + local.set $9 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 local.get $2 - local.get $0 - local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 i32.const 2 i32.shl - local.get $4 i32.add i32.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream - local.get $0 i32.add - local.set $0 - local.get $5 + local.set $9 + local.get $6 if - local.get $0 + local.get $8 + local.get $9 i32.const 1 i32.shl - local.get $2 i32.add local.get $1 - local.get $5 + local.get $6 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $0 - local.get $5 + local.get $9 + local.get $6 i32.add - local.set $0 + local.set $9 end - local.get $6 + local.get $3 i32.const 1 i32.add - local.set $6 + local.set $3 br $repeat|0 + unreachable end + unreachable end - local.get $7 + local.get $4 local.get $2 - local.get $0 - local.get $3 i32.const 2 i32.shl - local.get $4 i32.add i32.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream - local.get $0 i32.add - local.tee $0 + local.set $9 + local.get $7 + local.get $9 i32.gt_s if - local.get $2 - local.get $0 + local.get $8 + i32.const 0 + local.get $9 call $~lib/string/String#substring - local.set $0 - local.get $2 - call $~lib/util/runtime/discard - local.get $0 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end - local.get $2 - i32.const 16 - call $~lib/util/runtime/register + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#join (; 128 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 232 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return ) - (func $~lib/util/number/utoa32 (; 129 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/utoa32 (; 233 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 i32.eqz if - i32.const 4656 + i32.const 4632 + call $~lib/rt/purerc/__retain return end local.get $0 call $~lib/util/number/decimalCount32 - local.tee $1 + local.set $1 + local.get $1 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.tee $2 - local.get $0 - local.get $1 - call $~lib/util/number/utoa32_lut - local.get $2 i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + local.set $2 + block $~lib/util/number/utoa32_core|inlined.2 + local.get $2 + local.set $5 + local.get $0 + local.set $4 + local.get $1 + local.set $3 + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/number/utoa32_lut + end + local.get $2 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/itoa_stream (; 130 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa (; 234 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/util/number/utoa32 + return + ) + (func $~lib/util/number/itoa_stream (; 235 ;) (type $FUNCSIG$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.get $0 local.get $1 i32.const 1 i32.shl - local.get $0 i32.add local.set $0 local.get $2 @@ -6017,553 +11311,797 @@ i32.const 1 return end - local.get $0 - local.get $2 + i32.const 0 + local.set $3 local.get $2 call $~lib/util/number/decimalCount32 - local.tee $0 - call $~lib/util/number/utoa32_lut - local.get $0 + local.set $3 + block $~lib/util/number/utoa32_core|inlined.3 + local.get $0 + local.set $6 + local.get $2 + local.set $5 + local.get $3 + local.set $4 + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/number/utoa32_lut + end + local.get $3 ) - (func $~lib/array/Array#join_int (; 131 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 236 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 i32.sub - local.tee $3 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 local.set $4 - local.get $3 + local.get $2 i32.eqz if local.get $4 i32.load - call $~lib/util/number/utoa32 + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $5 + call $~lib/string/String#get:length + local.set $6 i32.const 10 + local.get $6 i32.add - local.get $3 + local.get $2 i32.mul i32.const 10 i32.add - local.tee $7 + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $2 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $0 - loop $repeat|0 - local.get $6 - local.get $3 - i32.lt_s - if + local.set $9 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 local.get $2 - local.get $0 - local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 i32.const 2 i32.shl - local.get $4 i32.add i32.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream - local.get $0 i32.add - local.set $0 - local.get $5 + local.set $9 + local.get $6 if - local.get $0 + local.get $8 + local.get $9 i32.const 1 i32.shl - local.get $2 i32.add local.get $1 - local.get $5 + local.get $6 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $0 - local.get $5 + local.get $9 + local.get $6 i32.add - local.set $0 + local.set $9 end - local.get $6 + local.get $3 i32.const 1 i32.add - local.set $6 + local.set $3 br $repeat|0 + unreachable end + unreachable end - local.get $7 + local.get $4 local.get $2 - local.get $0 - local.get $3 i32.const 2 i32.shl - local.get $4 i32.add i32.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream - local.get $0 i32.add - local.tee $0 + local.set $9 + local.get $7 + local.get $9 i32.gt_s if - local.get $2 - local.get $0 + local.get $8 + i32.const 0 + local.get $9 call $~lib/string/String#substring - local.set $0 - local.get $2 - call $~lib/util/runtime/discard - local.get $0 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end - local.get $2 - i32.const 16 - call $~lib/util/runtime/register + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#join (; 132 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 237 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return ) - (func $~lib/util/number/genDigits (; 133 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (func $~lib/builtins/isFinite (; 238 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.eq + ) + (func $~lib/array/Array#__unchecked_get (; 239 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + i64.load + ) + (func $~lib/array/Array#__unchecked_get (; 240 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.shl + i32.add + i32.load16_s + ) + (func $~lib/util/number/genDigits (; 241 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) (local $7 i32) - (local $8 i32) + (local $8 i64) (local $9 i64) (local $10 i64) - (local $11 i64) + (local $11 i32) (local $12 i32) - (local $13 i32) - (local $14 i64) - local.get $3 - local.get $1 - i64.sub - local.set $9 - i64.const 1 + (local $13 i64) + (local $14 i32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i32) + (local $19 i64) + (local $20 i32) + (local $21 i64) + (local $22 i64) + (local $23 i64) + (local $24 i64) + (local $25 i32) + (local $26 i32) i32.const 0 local.get $4 i32.sub - local.tee $12 + local.set $7 + i64.const 1 + local.get $7 i64.extend_i32_s - local.tee $1 i64.shl - local.tee $10 + local.set $8 + local.get $8 i64.const 1 i64.sub - local.tee $14 - local.get $3 - i64.and - local.set $11 + local.set $9 local.get $3 local.get $1 + i64.sub + local.set $10 + local.get $4 + local.set $11 + local.get $3 + local.get $7 + i64.extend_i32_s i64.shr_u i32.wrap_i64 - local.tee $7 - call $~lib/util/number/decimalCount32 - local.set $4 - i32.const 6652 - i32.load + local.set $12 + local.get $3 + local.get $9 + i64.and local.set $13 - loop $continue|0 - local.get $4 - i32.const 0 - i32.gt_s - if - block $break|1 - block $case10|1 - block $case9|1 - block $case8|1 - block $case7|1 - block $case6|1 - block $case5|1 - block $case4|1 - block $case3|1 - block $case2|1 - block $case1|1 - local.get $4 - i32.const 10 - i32.ne - if - local.get $4 - i32.const 9 - i32.eq - br_if $case1|1 - block $tablify|0 - local.get $4 + local.get $12 + call $~lib/util/number/decimalCount32 + local.set $14 + local.get $6 + local.set $15 + i32.const 6536 + i32.load offset=4 + local.set $16 + block $break|0 + loop $continue|0 + local.get $14 + i32.const 0 + i32.gt_s + if + block $break|1 + block $case10|1 + block $case9|1 + block $case8|1 + block $case7|1 + block $case6|1 + block $case5|1 + block $case4|1 + block $case3|1 + block $case2|1 + block $case1|1 + block $case0|1 + local.get $14 + local.set $18 + local.get $18 + i32.const 10 + i32.eq + br_if $case0|1 + local.get $18 + i32.const 9 + i32.eq + br_if $case1|1 + local.get $18 + i32.const 8 + i32.eq + br_if $case2|1 + local.get $18 + i32.const 7 + i32.eq + br_if $case3|1 + local.get $18 + i32.const 6 + i32.eq + br_if $case4|1 + local.get $18 + i32.const 5 + i32.eq + br_if $case5|1 + local.get $18 + i32.const 4 + i32.eq + br_if $case6|1 + local.get $18 + i32.const 3 + i32.eq + br_if $case7|1 + local.get $18 + i32.const 2 + i32.eq + br_if $case8|1 + local.get $18 i32.const 1 - i32.sub - br_table $case9|1 $case8|1 $case7|1 $case6|1 $case5|1 $case4|1 $case3|1 $case2|1 $tablify|0 + i32.eq + br_if $case9|1 + br $case10|1 end - br $case10|1 + block + local.get $12 + i32.const 1000000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 1000000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 1000000000 - i32.div_u - local.set $8 - local.get $7 - i32.const 1000000000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 100000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 100000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 100000000 - i32.div_u - local.set $8 - local.get $7 - i32.const 100000000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 10000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 10000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 10000000 - i32.div_u - local.set $8 - local.get $7 - i32.const 10000000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 1000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 1000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 1000000 - i32.div_u - local.set $8 - local.get $7 - i32.const 1000000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 100000 + i32.div_u + local.set $17 + local.get $12 + i32.const 100000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 100000 - i32.div_u - local.set $8 - local.get $7 - i32.const 100000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 10000 + i32.div_u + local.set $17 + local.get $12 + i32.const 10000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 10000 - i32.div_u - local.set $8 - local.get $7 - i32.const 10000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 1000 + i32.div_u + local.set $17 + local.get $12 + i32.const 1000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 1000 - i32.div_u - local.set $8 - local.get $7 - i32.const 1000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 100 + i32.div_u + local.set $17 + local.get $12 + i32.const 100 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 100 - i32.div_u - local.set $8 - local.get $7 - i32.const 100 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 10 + i32.div_u + local.set $17 + local.get $12 + i32.const 10 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 10 - i32.div_u - local.set $8 - local.get $7 - i32.const 10 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + local.set $17 + i32.const 0 + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - local.set $8 - i32.const 0 - local.set $7 - br $break|1 + block + i32.const 0 + local.set $17 + br $break|1 + unreachable + end + unreachable end - i32.const 0 - local.set $8 - end - local.get $6 - local.get $8 - i32.or - if - local.get $6 - local.tee $2 + local.get $17 + local.get $15 + i32.or + if + local.get $0 + block (result i32) + local.get $15 + local.tee $18 + i32.const 1 + i32.add + local.set $15 + local.get $18 + end + i32.const 1 + i32.shl + i32.add + i32.const 48 + local.get $17 + i32.const 65535 + i32.and + i32.add + i32.store16 + end + local.get $14 i32.const 1 - i32.add - local.set $6 - local.get $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $8 - i32.const 65535 - i32.and - i32.const 48 - i32.add - i32.store16 - end - local.get $4 - i32.const 1 - i32.sub - local.set $4 - local.get $7 - i64.extend_i32_u - local.get $12 - i64.extend_i32_s - i64.shl - local.get $11 - i64.add - local.tee $1 - local.get $5 - i64.le_u - if - global.get $~lib/util/number/_K - local.get $4 - i32.add - global.set $~lib/util/number/_K - local.get $4 - i32.const 2 - i32.shl - local.get $13 - i32.add - i64.load32_u + i32.sub + local.set $14 local.get $12 + i64.extend_i32_u + local.get $7 i64.extend_i32_s i64.shl - local.set $3 - local.get $6 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add - local.tee $2 - i32.load16_u - local.set $4 - loop $continue|2 - local.get $5 - local.get $1 - i64.sub - local.get $3 - i64.ge_u - i32.const 0 - local.get $1 - local.get $9 - i64.lt_u - select - if (result i32) - i32.const 1 - local.get $9 - local.get $1 - i64.sub - local.get $1 - local.get $3 - i64.add - local.get $9 - i64.sub - i64.gt_u - local.get $1 - local.get $3 - i64.add - local.get $9 - i64.lt_u - select - else - i32.const 0 - end - if - local.get $4 + local.get $13 + i64.add + local.set $19 + local.get $19 + local.get $5 + i64.le_u + if + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + block $~lib/util/number/grisuRound|inlined.0 + local.get $0 + local.set $20 + local.get $15 + local.set $18 + local.get $5 + local.set $24 + local.get $19 + local.set $23 + local.get $16 + local.get $14 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.get $7 + i64.extend_i32_s + i64.shl + local.set $22 + local.get $10 + local.set $21 + local.get $20 + local.get $18 i32.const 1 i32.sub - local.set $4 - local.get $1 - local.get $3 - i64.add - local.set $1 - br $continue|2 + i32.const 1 + i32.shl + i32.add + local.set $25 + local.get $25 + i32.load16_u + local.set $26 + block $break|2 + loop $continue|2 + local.get $23 + local.get $21 + i64.lt_u + if (result i32) + local.get $24 + local.get $23 + i64.sub + local.get $22 + i64.ge_u + else + i32.const 0 + end + if (result i32) + local.get $23 + local.get $22 + i64.add + local.get $21 + i64.lt_u + if (result i32) + i32.const 1 + else + local.get $21 + local.get $23 + i64.sub + local.get $23 + local.get $22 + i64.add + local.get $21 + i64.sub + i64.gt_u + end + else + i32.const 0 + end + if + local.get $26 + i32.const 1 + i32.sub + local.set $26 + local.get $23 + local.get $22 + i64.add + local.set $23 + br $continue|2 + end + end + end + local.get $25 + local.get $26 + i32.store16 end + local.get $15 + return end - local.get $2 - local.get $4 - i32.store16 - local.get $6 - return + br $continue|0 end - br $continue|0 end end - loop $continue|3 (result i32) - local.get $5 - i64.const 10 - i64.mul - local.set $5 - local.get $11 - i64.const 10 - i64.mul - local.tee $3 - local.get $12 - i64.extend_i32_s - i64.shr_u - local.tee $1 - local.get $6 - i64.extend_i32_s - i64.or - i64.const 0 - i64.ne - if - local.get $6 - local.tee $2 + block $break|3 + loop $continue|3 i32.const 1 - i32.add - local.set $6 - local.get $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $1 - i32.wrap_i64 - i32.const 65535 - i32.and - i32.const 48 - i32.add - i32.store16 - end - local.get $4 - i32.const 1 - i32.sub - local.set $4 - local.get $3 - local.get $14 - i64.and - local.tee $11 - local.get $5 - i64.ge_u - br_if $continue|3 - global.get $~lib/util/number/_K - local.get $4 - i32.add - global.set $~lib/util/number/_K - local.get $11 - local.set $1 - i32.const 0 - local.get $4 - i32.sub - i32.const 2 - i32.shl - local.get $13 - i32.add - i64.load32_u - local.get $9 - i64.mul - local.set $3 - local.get $6 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add - local.tee $2 - i32.load16_u - local.set $4 - loop $continue|4 - local.get $5 - local.get $1 - i64.sub - local.get $10 - i64.ge_u - i32.const 0 - local.get $1 - local.get $3 - i64.lt_u - select - if (result i32) - i32.const 1 - local.get $3 - local.get $1 - i64.sub - local.get $1 - local.get $10 - i64.add - local.get $3 - i64.sub - i64.gt_u - local.get $1 - local.get $10 - i64.add - local.get $3 - i64.lt_u - select - else - i32.const 0 - end if - local.get $4 + local.get $13 + i64.const 10 + i64.mul + local.set $13 + local.get $5 + i64.const 10 + i64.mul + local.set $5 + local.get $13 + local.get $7 + i64.extend_i32_s + i64.shr_u + local.set $19 + local.get $19 + local.get $15 + i64.extend_i32_s + i64.or + i64.const 0 + i64.ne + if + local.get $0 + block (result i32) + local.get $15 + local.tee $17 + i32.const 1 + i32.add + local.set $15 + local.get $17 + end + i32.const 1 + i32.shl + i32.add + i32.const 48 + local.get $19 + i32.wrap_i64 + i32.const 65535 + i32.and + i32.add + i32.store16 + end + local.get $13 + local.get $9 + i64.and + local.set $13 + local.get $14 i32.const 1 i32.sub - local.set $4 - local.get $1 - local.get $10 - i64.add - local.set $1 - br $continue|4 + local.set $14 + local.get $13 + local.get $5 + i64.lt_u + if + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + local.get $10 + local.get $16 + i32.const 0 + local.get $14 + i32.sub + i32.const 2 + i32.shl + i32.add + i64.load32_u + i64.mul + local.set $10 + block $~lib/util/number/grisuRound|inlined.1 + local.get $0 + local.set $26 + local.get $15 + local.set $17 + local.get $5 + local.set $24 + local.get $13 + local.set $23 + local.get $8 + local.set $22 + local.get $10 + local.set $21 + local.get $26 + local.get $17 + i32.const 1 + i32.sub + i32.const 1 + i32.shl + i32.add + local.set $25 + local.get $25 + i32.load16_u + local.set $18 + block $break|4 + loop $continue|4 + local.get $23 + local.get $21 + i64.lt_u + if (result i32) + local.get $24 + local.get $23 + i64.sub + local.get $22 + i64.ge_u + else + i32.const 0 + end + if (result i32) + local.get $23 + local.get $22 + i64.add + local.get $21 + i64.lt_u + if (result i32) + i32.const 1 + else + local.get $21 + local.get $23 + i64.sub + local.get $23 + local.get $22 + i64.add + local.get $21 + i64.sub + i64.gt_u + end + else + i32.const 0 + end + if + local.get $18 + i32.const 1 + i32.sub + local.set $18 + local.get $23 + local.get $22 + i64.add + local.set $23 + br $continue|4 + end + end + end + local.get $25 + local.get $18 + i32.store16 + end + local.get $15 + return + end + br $continue|3 end end - local.get $2 - local.get $4 - i32.store16 - local.get $6 end + local.get $15 ) - (func $~lib/util/number/prettify (; 134 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 242 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) local.get $2 i32.eqz if + local.get $0 local.get $1 i32.const 1 i32.shl - local.get $0 i32.add - i32.const 3145774 + i32.const 46 + i32.const 48 + i32.const 16 + i32.shl + i32.or i32.store local.get $1 i32.const 2 @@ -6571,10 +12109,11 @@ return end local.get $1 - local.get $1 local.get $2 i32.add - local.tee $3 + local.set $3 + local.get $1 + local.get $3 i32.le_s if (result i32) local.get $3 @@ -6583,56 +12122,69 @@ else i32.const 0 end - if (result i32) - loop $repeat|0 - block $break|0 - local.get $1 + if + block $break|0 + local.get $1 + local.set $4 + loop $repeat|0 + local.get $4 local.get $3 - i32.ge_s + i32.lt_s + i32.eqz br_if $break|0 - local.get $1 + local.get $0 + local.get $4 i32.const 1 i32.shl - local.get $0 i32.add i32.const 48 i32.store16 - local.get $1 + local.get $4 i32.const 1 i32.add - local.set $1 + local.set $4 br $repeat|0 + unreachable end + unreachable end + local.get $0 local.get $3 i32.const 1 i32.shl - local.get $0 i32.add - i32.const 3145774 + i32.const 46 + i32.const 48 + i32.const 16 + i32.shl + i32.or i32.store local.get $3 i32.const 2 i32.add + return else - local.get $3 - i32.const 21 - i32.le_s - i32.const 0 local.get $3 i32.const 0 i32.gt_s - select if (result i32) + local.get $3 + i32.const 21 + i32.le_s + else + i32.const 0 + end + if + local.get $0 local.get $3 i32.const 1 i32.shl - local.get $0 i32.add - local.tee $0 + local.set $4 + local.get $4 i32.const 2 i32.add - local.get $0 + local.get $4 i32.const 0 local.get $2 i32.sub @@ -6640,28 +12192,36 @@ i32.shl call $~lib/memory/memory.copy local.get $0 + local.get $3 + i32.const 1 + i32.shl + i32.add i32.const 46 i32.store16 local.get $1 i32.const 1 i32.add + return else - local.get $3 - i32.const 0 - i32.le_s - i32.const 0 i32.const -6 local.get $3 i32.lt_s - select if (result i32) + local.get $3 + i32.const 0 + i32.le_s + else + i32.const 0 + end + if i32.const 2 local.get $3 i32.sub - local.tee $3 + local.set $4 + local.get $0 + local.get $4 i32.const 1 i32.shl - local.get $0 i32.add local.get $0 local.get $1 @@ -6669,87 +12229,111 @@ i32.shl call $~lib/memory/memory.copy local.get $0 - i32.const 3014704 + i32.const 48 + i32.const 46 + i32.const 16 + i32.shl + i32.or i32.store - i32.const 2 - local.set $2 - loop $repeat|1 - block $break|1 - local.get $2 - local.get $3 - i32.ge_s + block $break|1 + i32.const 2 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $4 + i32.lt_s + i32.eqz br_if $break|1 - local.get $2 + local.get $0 + local.get $5 i32.const 1 i32.shl - local.get $0 i32.add i32.const 48 i32.store16 - local.get $2 + local.get $5 i32.const 1 i32.add - local.set $2 + local.set $5 br $repeat|1 + unreachable end + unreachable end local.get $1 - local.get $3 + local.get $4 i32.add + return else local.get $1 i32.const 1 i32.eq - if (result i32) + if local.get $0 i32.const 101 i32.store16 offset=2 - local.get $0 - i32.const 4 - i32.add - local.tee $0 - block (result i32) + block $~lib/util/number/genExponent|inlined.0 (result i32) + local.get $0 + i32.const 4 + i32.add + local.set $5 local.get $3 i32.const 1 i32.sub - local.tee $1 + local.set $4 + local.get $4 i32.const 0 i32.lt_s - local.tee $2 + local.set $6 + local.get $6 if i32.const 0 - local.get $1 + local.get $4 i32.sub - local.set $1 + local.set $4 end - local.get $1 + local.get $4 + call $~lib/util/number/decimalCount32 + i32.const 1 + i32.add + local.set $7 + block $~lib/util/number/utoa32_core|inlined.4 + local.get $5 + local.set $10 + local.get $4 + local.set $9 + local.get $7 + local.set $8 + local.get $10 + local.get $9 + local.get $8 + call $~lib/util/number/utoa32_lut + end + local.get $5 + i32.const 45 + i32.const 43 + local.get $6 + select + i32.store16 + local.get $7 end - local.get $1 - call $~lib/util/number/decimalCount32 - i32.const 1 - i32.add - local.tee $1 - call $~lib/util/number/utoa32_lut - local.get $0 - i32.const 45 - i32.const 43 - local.get $2 - select - i32.store16 + local.set $1 local.get $1 i32.const 2 i32.add + return else + local.get $1 + i32.const 1 + i32.shl + local.set $7 local.get $0 i32.const 4 i32.add local.get $0 i32.const 2 i32.add - local.get $1 - i32.const 1 - i32.shl - local.tee $2 + local.get $7 i32.const 2 i32.sub call $~lib/memory/memory.copy @@ -6757,392 +12341,578 @@ i32.const 46 i32.store16 offset=2 local.get $0 - local.get $2 + local.get $7 i32.add - local.tee $0 i32.const 101 i32.store16 offset=2 - local.get $0 - i32.const 4 - i32.add - local.tee $2 - block (result i32) + local.get $1 + block $~lib/util/number/genExponent|inlined.1 (result i32) + local.get $0 + local.get $7 + i32.add + i32.const 4 + i32.add + local.set $4 local.get $3 i32.const 1 i32.sub - local.tee $0 + local.set $6 + local.get $6 i32.const 0 i32.lt_s - local.tee $3 + local.set $5 + local.get $5 if i32.const 0 - local.get $0 + local.get $6 i32.sub - local.set $0 + local.set $6 end - local.get $0 + local.get $6 + call $~lib/util/number/decimalCount32 + i32.const 1 + i32.add + local.set $8 + block $~lib/util/number/utoa32_core|inlined.5 + local.get $4 + local.set $11 + local.get $6 + local.set $10 + local.get $8 + local.set $9 + local.get $11 + local.get $10 + local.get $9 + call $~lib/util/number/utoa32_lut + end + local.get $4 + i32.const 45 + i32.const 43 + local.get $5 + select + i32.store16 + local.get $8 end - local.get $0 - call $~lib/util/number/decimalCount32 - i32.const 1 i32.add - local.tee $0 - call $~lib/util/number/utoa32_lut - local.get $2 - i32.const 45 - i32.const 43 - local.get $3 - select - i32.store16 - local.get $0 + local.set $1 local.get $1 - i32.add i32.const 2 i32.add + return end + unreachable end + unreachable end + unreachable end + unreachable + unreachable ) - (func $~lib/util/number/dtoa_core (; 135 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) - (local $2 i64) - (local $3 i32) - (local $4 i64) - (local $5 i64) + (func $~lib/util/number/dtoa_core (; 243 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (local $2 i32) + (local $3 f64) + (local $4 i32) + (local $5 i32) (local $6 i64) (local $7 i32) (local $8 i64) (local $9 i64) - (local $10 i32) + (local $10 i64) (local $11 i32) + (local $12 i64) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 f64) + (local $17 i64) + (local $18 i64) + (local $19 i64) + (local $20 i64) + (local $21 i64) + (local $22 i64) + (local $23 i64) + (local $24 i64) + (local $25 i64) + (local $26 i32) + (local $27 i64) + (local $28 i32) local.get $1 f64.const 0 f64.lt - local.tee $10 + local.set $2 + local.get $2 if - local.get $0 - i32.const 45 - i32.store16 local.get $1 f64.neg local.set $1 + local.get $0 + i32.const 45 + i32.store16 end - local.get $1 - i64.reinterpret_f64 - local.tee $2 - i64.const 9218868437227405312 - i64.and - i64.const 52 - i64.shr_u - i32.wrap_i64 - local.tee $11 - i32.const 0 - i32.ne - local.set $7 - local.get $2 - i64.const 4503599627370495 - i64.and - local.get $7 - i64.extend_i32_u - i64.const 52 - i64.shl - i64.add - local.tee $5 - i64.const 1 - i64.shl - i64.const 1 - i64.add - local.tee $2 - i64.clz - i32.wrap_i64 - local.set $3 - local.get $2 - local.get $3 - i64.extend_i32_s - i64.shl - global.set $~lib/util/number/_frc_plus - local.get $11 - i32.const 1 - local.get $7 - select - i32.const 1075 - i32.sub - local.tee $7 - i32.const 1 - i32.sub - local.get $3 - i32.sub - local.set $3 - local.get $5 - local.get $5 - i64.const 4503599627370496 - i64.eq - i32.const 1 - i32.add - local.tee $11 - i64.extend_i32_s - i64.shl - i64.const 1 - i64.sub - local.get $7 - local.get $11 - i32.sub - local.get $3 - i32.sub - i64.extend_i32_s - i64.shl - global.set $~lib/util/number/_frc_minus - local.get $3 - global.set $~lib/util/number/_exp - i32.const 348 - i32.const -61 - global.get $~lib/util/number/_exp - i32.sub - f64.convert_i32_s - f64.const 0.30102999566398114 - f64.mul - f64.const 347 - f64.add - local.tee $1 - i32.trunc_f64_s - local.tee $3 - local.get $3 - f64.convert_i32_s - local.get $1 - f64.ne - i32.add - i32.const 3 - i32.shr_s - i32.const 1 - i32.add - local.tee $3 - i32.const 3 - i32.shl - i32.sub - global.set $~lib/util/number/_K - i32.const 6340 - i32.load - local.get $3 - i32.const 3 - i32.shl - i32.add - i64.load - global.set $~lib/util/number/_frc_pow - i32.const 6564 - i32.load - local.get $3 - i32.const 1 - i32.shl - i32.add - i32.load16_s - global.set $~lib/util/number/_exp_pow - global.get $~lib/util/number/_frc_pow - local.tee $6 - i64.const 4294967295 - i64.and - local.set $2 - global.get $~lib/util/number/_frc_plus - local.tee $8 - i64.const 4294967295 - i64.and - local.tee $4 - local.get $6 - i64.const 32 - i64.shr_u - local.tee $6 - i64.mul - local.get $8 - i64.const 32 - i64.shr_u - local.tee $8 - local.get $2 - i64.mul - local.get $2 - local.get $4 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.tee $4 - i64.const 4294967295 - i64.and - i64.add - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u - local.get $6 - local.get $8 - i64.mul - local.get $4 - i64.const 32 - i64.shr_u - i64.add - i64.add - i64.const 1 - i64.sub - local.tee $8 - local.get $6 - global.get $~lib/util/number/_frc_minus - local.tee $4 - i64.const 4294967295 - i64.and - local.tee $9 - i64.mul - local.get $4 - i64.const 32 - i64.shr_u - local.tee $4 - local.get $2 - i64.mul - local.get $2 - local.get $9 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.tee $9 - i64.const 4294967295 - i64.and - i64.add - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u - local.get $4 - local.get $6 - i64.mul - local.get $9 - i64.const 32 - i64.shr_u - i64.add - i64.add - i64.const 1 - i64.add - i64.sub - local.set $4 - local.get $10 - i32.const 1 - i32.shl + block $~lib/util/number/grisu2|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $3 + i64.reinterpret_f64 + local.set $6 + local.get $6 + i64.const 9218868437227405312 + i64.and + i64.const 52 + i64.shr_u + i32.wrap_i64 + local.set $7 + local.get $6 + i64.const 4503599627370495 + i64.and + local.set $8 + local.get $7 + i32.const 0 + i32.ne + i64.extend_i32_u + i64.const 52 + i64.shl + local.get $8 + i64.add + local.set $9 + local.get $7 + i32.const 1 + local.get $7 + i32.const 0 + i32.ne + select + i32.const 1023 + i32.const 52 + i32.add + i32.sub + local.set $7 + block $~lib/util/number/normalizedBoundaries|inlined.0 + local.get $9 + local.set $10 + local.get $7 + local.set $11 + local.get $10 + i64.const 1 + i64.shl + i64.const 1 + i64.add + local.set $12 + local.get $11 + i32.const 1 + i32.sub + local.set $13 + local.get $12 + i64.clz + i32.wrap_i64 + local.set $14 + local.get $12 + local.get $14 + i64.extend_i32_s + i64.shl + local.set $12 + local.get $13 + local.get $14 + i32.sub + local.set $13 + i32.const 1 + local.get $10 + i64.const 4503599627370496 + i64.eq + i32.add + local.set $15 + local.get $12 + global.set $~lib/util/number/_frc_plus + local.get $10 + local.get $15 + i64.extend_i32_s + i64.shl + i64.const 1 + i64.sub + local.get $11 + local.get $15 + i32.sub + local.get $13 + i32.sub + i64.extend_i32_s + i64.shl + global.set $~lib/util/number/_frc_minus + local.get $13 + global.set $~lib/util/number/_exp + end + block $~lib/util/number/getCachedPower|inlined.0 + global.get $~lib/util/number/_exp + local.set $15 + i32.const -61 + local.get $15 + i32.sub + f64.convert_i32_s + f64.const 0.30102999566398114 + f64.mul + f64.const 347 + f64.add + local.set $16 + local.get $16 + i32.trunc_f64_s + local.set $14 + local.get $14 + local.get $14 + f64.convert_i32_s + local.get $16 + f64.ne + i32.add + local.set $14 + local.get $14 + i32.const 3 + i32.shr_s + i32.const 1 + i32.add + local.set $13 + i32.const 348 + local.get $13 + i32.const 3 + i32.shl + i32.sub + global.set $~lib/util/number/_K + i32.const 6224 + local.get $13 + call $~lib/array/Array#__unchecked_get + global.set $~lib/util/number/_frc_pow + i32.const 6448 + local.get $13 + call $~lib/array/Array#__unchecked_get + global.set $~lib/util/number/_exp_pow + end + local.get $9 + i64.clz + i32.wrap_i64 + local.set $13 + local.get $9 + local.get $13 + i64.extend_i32_s + i64.shl + local.set $9 + local.get $7 + local.get $13 + i32.sub + local.set $7 + global.get $~lib/util/number/_frc_pow + local.set $12 + global.get $~lib/util/number/_exp_pow + local.set $14 + block $~lib/util/number/umul64f|inlined.0 (result i64) + local.get $9 + local.set $17 + local.get $12 + local.set $10 + local.get $17 + i64.const 4294967295 + i64.and + local.set $18 + local.get $10 + i64.const 4294967295 + i64.and + local.set $19 + local.get $17 + i64.const 32 + i64.shr_u + local.set $20 + local.get $10 + i64.const 32 + i64.shr_u + local.set $21 + local.get $18 + local.get $19 + i64.mul + local.set $22 + local.get $20 + local.get $19 + i64.mul + local.get $22 + i64.const 32 + i64.shr_u + i64.add + local.set $23 + local.get $18 + local.get $21 + i64.mul + local.get $23 + i64.const 4294967295 + i64.and + i64.add + local.set $24 + local.get $24 + i64.const 2147483647 + i64.add + local.set $24 + local.get $23 + i64.const 32 + i64.shr_u + local.set $23 + local.get $24 + i64.const 32 + i64.shr_u + local.set $24 + local.get $20 + local.get $21 + i64.mul + local.get $23 + i64.add + local.get $24 + i64.add + end + local.set $24 + block $~lib/util/number/umul64e|inlined.0 (result i32) + local.get $7 + local.set $11 + local.get $14 + local.set $15 + local.get $11 + local.get $15 + i32.add + i32.const 64 + i32.add + end + local.set $15 + block $~lib/util/number/umul64f|inlined.1 (result i64) + global.get $~lib/util/number/_frc_plus + local.set $22 + local.get $12 + local.set $23 + local.get $22 + i64.const 4294967295 + i64.and + local.set $21 + local.get $23 + i64.const 4294967295 + i64.and + local.set $20 + local.get $22 + i64.const 32 + i64.shr_u + local.set $19 + local.get $23 + i64.const 32 + i64.shr_u + local.set $18 + local.get $21 + local.get $20 + i64.mul + local.set $10 + local.get $19 + local.get $20 + i64.mul + local.get $10 + i64.const 32 + i64.shr_u + i64.add + local.set $17 + local.get $21 + local.get $18 + i64.mul + local.get $17 + i64.const 4294967295 + i64.and + i64.add + local.set $25 + local.get $25 + i64.const 2147483647 + i64.add + local.set $25 + local.get $17 + i64.const 32 + i64.shr_u + local.set $17 + local.get $25 + i64.const 32 + i64.shr_u + local.set $25 + local.get $19 + local.get $18 + i64.mul + local.get $17 + i64.add + local.get $25 + i64.add + end + i64.const 1 + i64.sub + local.set $25 + block $~lib/util/number/umul64e|inlined.1 (result i32) + global.get $~lib/util/number/_exp + local.set $26 + local.get $14 + local.set $11 + local.get $26 + local.get $11 + i32.add + i32.const 64 + i32.add + end + local.set $11 + block $~lib/util/number/umul64f|inlined.2 (result i64) + global.get $~lib/util/number/_frc_minus + local.set $10 + local.get $12 + local.set $17 + local.get $10 + i64.const 4294967295 + i64.and + local.set $18 + local.get $17 + i64.const 4294967295 + i64.and + local.set $19 + local.get $10 + i64.const 32 + i64.shr_u + local.set $20 + local.get $17 + i64.const 32 + i64.shr_u + local.set $21 + local.get $18 + local.get $19 + i64.mul + local.set $23 + local.get $20 + local.get $19 + i64.mul + local.get $23 + i64.const 32 + i64.shr_u + i64.add + local.set $22 + local.get $18 + local.get $21 + i64.mul + local.get $22 + i64.const 4294967295 + i64.and + i64.add + local.set $27 + local.get $27 + i64.const 2147483647 + i64.add + local.set $27 + local.get $22 + i64.const 32 + i64.shr_u + local.set $22 + local.get $27 + i64.const 32 + i64.shr_u + local.set $27 + local.get $20 + local.get $21 + i64.mul + local.get $22 + i64.add + local.get $27 + i64.add + end + i64.const 1 + i64.add + local.set $27 + local.get $25 + local.get $27 + i64.sub + local.set $22 + local.get $5 + local.get $24 + local.get $15 + local.get $25 + local.get $11 + local.get $22 + local.get $4 + call $~lib/util/number/genDigits + end + local.set $28 local.get $0 - i32.add - local.get $0 - local.get $6 - local.get $5 - local.get $5 - i64.clz - i32.wrap_i64 - local.tee $0 - i64.extend_i32_s - i64.shl - local.tee $5 - i64.const 4294967295 - i64.and - local.tee $9 - i64.mul - local.get $5 - i64.const 32 - i64.shr_u - local.tee $5 local.get $2 - i64.mul - local.get $2 - local.get $9 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.tee $2 - i64.const 4294967295 - i64.and - i64.add - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u - local.get $5 - local.get $6 - i64.mul - local.get $2 - i64.const 32 - i64.shr_u - i64.add - i64.add - global.get $~lib/util/number/_exp_pow - local.tee $3 - local.get $7 - local.get $0 - i32.sub + i32.const 1 + i32.shl i32.add - i32.const -64 - i32.sub - local.get $8 - global.get $~lib/util/number/_exp - local.get $3 - i32.add - i32.const -64 - i32.sub - local.get $4 - local.get $10 - call $~lib/util/number/genDigits - local.get $10 + local.get $28 + local.get $2 i32.sub global.get $~lib/util/number/_K call $~lib/util/number/prettify - local.get $10 + local.set $28 + local.get $28 + local.get $2 i32.add ) - (func $~lib/util/number/dtoa (; 136 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/util/number/dtoa (; 244 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) + (local $3 i32) local.get $0 f64.const 0 f64.eq if - i32.const 5504 + i32.const 5392 + call $~lib/rt/purerc/__retain return end local.get $0 - local.get $0 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if - i32.const 5528 + i32.const 5416 + call $~lib/rt/purerc/__retain return end - i32.const 5552 - i32.const 5592 + i32.const 5440 + i32.const 5480 local.get $0 f64.const 0 f64.lt select + call $~lib/rt/purerc/__retain return end - i32.const 56 - call $~lib/util/runtime/allocate - local.tee $2 + i32.const 28 + i32.const 1 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $1 + local.get $1 local.get $0 call $~lib/util/number/dtoa_core - local.set $1 + local.set $2 local.get $2 + i32.const 28 + i32.eq + if + local.get $1 + call $~lib/rt/purerc/__retain + return + end local.get $1 + i32.const 0 + local.get $2 call $~lib/string/String#substring - local.set $1 - local.get $2 - call $~lib/util/runtime/discard + local.set $3 local.get $1 + call $~lib/rt/tlsf/__free + local.get $3 ) - (func $~lib/util/number/dtoa_stream (; 137 ;) (type $FUNCSIG$iiid) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) + (func $~lib/util/number/dtoa_stream (; 245 ;) (type $FUNCSIG$iiid) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) (local $3 i32) + (local $4 i32) + local.get $0 local.get $1 i32.const 1 i32.shl - local.get $0 i32.add local.set $0 local.get $2 @@ -7162,14 +12932,11 @@ return end local.get $2 - local.get $2 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if local.get $2 - local.get $2 - f64.ne + call $~lib/builtins/isNaN if local.get $0 i32.const 78 @@ -7186,474 +12953,650 @@ local.get $2 f64.const 0 f64.lt - local.tee $3 + local.set $3 i32.const 8 + local.get $3 i32.add - local.set $1 + local.set $4 local.get $0 - i32.const 5552 - i32.const 5592 + i32.const 5440 + i32.const 5480 local.get $3 select - local.get $1 + local.get $4 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $1 + local.get $4 return end unreachable + unreachable end local.get $0 local.get $2 call $~lib/util/number/dtoa_core ) - (func $~lib/array/Array#join_flt (; 138 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.load offset=12 - i32.const 1 - i32.sub - local.tee $2 - i32.const 0 - i32.lt_s - if - i32.const 4208 - return - end - local.get $0 - i32.load offset=4 - local.set $3 - local.get $2 - i32.eqz - if - local.get $3 - f64.load - call $~lib/util/number/dtoa - return - end - i32.const 5468 - i32.load - i32.const 1 - i32.shr_u - local.tee $4 - i32.const 28 - i32.add - local.get $2 - i32.mul - i32.const 28 - i32.add - local.tee $6 - i32.const 1 - i32.shl - call $~lib/util/runtime/allocate - local.set $1 - i32.const 0 - local.set $0 - loop $repeat|0 - local.get $5 - local.get $2 - i32.lt_s - if - local.get $1 - local.get $0 - local.get $5 - i32.const 3 - i32.shl - local.get $3 - i32.add - f64.load - call $~lib/util/number/dtoa_stream - local.get $0 - i32.add - local.set $0 - local.get $4 - if - local.get $0 - i32.const 1 - i32.shl - local.get $1 - i32.add - i32.const 5480 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $0 - local.get $4 - i32.add - local.set $0 - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $repeat|0 - end - end - local.get $6 - local.get $1 - local.get $0 - local.get $2 - i32.const 3 - i32.shl - local.get $3 - i32.add - f64.load - call $~lib/util/number/dtoa_stream - local.get $0 - i32.add - local.tee $0 - i32.gt_s - if - local.get $1 - local.get $0 - call $~lib/string/String#substring - local.set $0 - local.get $1 - call $~lib/util/runtime/discard - local.get $0 - return - end - local.get $1 - i32.const 16 - call $~lib/util/runtime/register - ) - (func $~lib/array/Array<~lib/string/String>#join_str (; 139 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_flt (; 246 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 f64) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 i32.sub - local.tee $5 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $6 - local.get $5 + local.set $4 + local.get $2 i32.eqz if - local.get $6 - i32.load + local.get $4 + f64.load + call $~lib/util/number/dtoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.set $7 - i32.const 0 - local.set $0 - local.get $5 - i32.const 1 + call $~lib/string/String#get:length + local.set $6 + i32.const 28 + local.get $6 i32.add - local.set $3 - loop $repeat|0 - local.get $0 - local.get $3 - i32.lt_s - if - local.get $0 - i32.const 2 - i32.shl - local.get $6 - i32.add - i32.load - local.tee $4 - if - local.get $4 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.get $2 - i32.add - local.set $2 - end - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - end - end - i32.const 0 - local.set $0 - local.get $5 - local.get $7 - i32.mul local.get $2 + i32.mul + i32.const 28 i32.add + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $2 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $3 - loop $repeat|1 - local.get $3 - local.get $5 - i32.lt_s - if + local.set $9 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 local.get $3 - i32.const 2 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 + i32.const 3 i32.shl - local.get $6 i32.add - i32.load - local.tee $4 + f64.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/dtoa_stream + i32.add + local.set $9 + local.get $6 if - local.get $0 + local.get $8 + local.get $9 i32.const 1 i32.shl - local.get $2 - i32.add - local.get $4 - local.get $4 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $0 - local.get $4 - i32.add - local.set $0 - end - local.get $7 - if - local.get $0 - i32.const 1 - i32.shl - local.get $2 i32.add local.get $1 - local.get $7 + local.get $6 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $0 - local.get $7 + local.get $9 + local.get $6 i32.add - local.set $0 + local.set $9 end local.get $3 i32.const 1 i32.add local.set $3 - br $repeat|1 + br $repeat|0 + unreachable end + unreachable end - local.get $5 - i32.const 2 - i32.shl - local.get $6 - i32.add - i32.load - local.tee $1 - if - local.get $0 - i32.const 1 - i32.shl - local.get $2 - i32.add - local.get $1 - local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - end + local.get $4 local.get $2 - i32.const 16 - call $~lib/util/runtime/register + i32.const 3 + i32.shl + i32.add + f64.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/dtoa_stream + i32.add + local.set $9 + local.get $7 + local.get $9 + i32.gt_s + if + local.get $8 + i32.const 0 + local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array<~lib/string/String>#join (; 140 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 247 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 - call $~lib/array/Array<~lib/string/String>#join_str + call $~lib/array/Array#join_flt + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return ) - (func $std/array/Ref#constructor (; 141 ;) (type $FUNCSIG$i) (result i32) - i32.const 0 - call $~lib/util/runtime/allocate - i32.const 32 - call $~lib/util/runtime/register - ) - (func $~lib/array/Array#join_ref (; 142 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/array/Array<~lib/string/String>#join_str (; 248 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 i32.sub - local.tee $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $5 + local.set $4 local.get $2 i32.eqz if - i32.const 6928 + local.get $4 + i32.load + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end - i32.const 4524 - i32.load + local.get $1 + call $~lib/string/String#get:length + local.set $5 + i32.const 0 + local.set $6 + i32.const 0 + local.set $7 + block $break|0 + block + i32.const 0 + local.set $3 + local.get $2 + i32.const 1 + i32.add + local.set $8 + end + loop $repeat|0 + local.get $3 + local.get $8 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $6 + local.get $7 + call $~lib/string/String#get:length + i32.add + local.set $6 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + i32.const 0 + local.set $9 + local.get $6 + local.get $5 + local.get $2 + i32.mul + i32.add i32.const 1 - i32.shr_u - local.tee $3 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $10 + block $break|1 + i32.const 0 + local.set $8 + loop $repeat|1 + local.get $8 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $4 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $7 + call $~lib/string/String#get:length + local.set $3 + local.get $10 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $7 + local.get $3 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $3 + i32.add + local.set $9 + end + local.get $5 + if + local.get $10 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $5 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $5 + i32.add + local.set $9 + end + local.get $8 + i32.const 1 + i32.add + local.set $8 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $10 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $7 + local.get $7 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + end + local.get $10 + local.set $8 + local.get $1 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $8 + ) + (func $~lib/array/Array<~lib/string/String>#join (; 249 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#join_str + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return + ) + (func $std/array/Ref#constructor (; 250 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 32 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + ) + (func $~lib/array/Array#join_ref (; 251 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s + if + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $0 + i32.load offset=4 + local.set $4 + local.get $2 + i32.eqz + if + i32.const 6720 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $1 + call $~lib/string/String#get:length + local.set $5 i32.const 15 + local.get $5 i32.add local.get $2 i32.mul i32.const 15 i32.add - local.tee $6 + local.set $6 + local.get $6 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $1 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $7 i32.const 0 - local.set $0 - loop $repeat|0 - local.get $4 - local.get $2 - i32.lt_s - if + local.set $8 + i32.const 0 + local.set $9 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 local.get $4 + local.get $3 i32.const 2 i32.shl - local.get $5 i32.add i32.load + local.get $9 + call $~lib/rt/purerc/__retainRelease + local.set $9 + local.get $9 if - local.get $0 + local.get $7 + local.get $8 i32.const 1 i32.shl - local.get $1 i32.add - i32.const 6928 - i32.const 30 + i32.const 6720 + i32.const 15 + i32.const 1 + i32.shl call $~lib/memory/memory.copy - local.get $0 + local.get $8 i32.const 15 i32.add - local.set $0 + local.set $8 end - local.get $3 + local.get $5 if - local.get $0 + local.get $7 + local.get $8 i32.const 1 i32.shl - local.get $1 i32.add - i32.const 4536 - local.get $3 + local.get $1 + local.get $5 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $0 - local.get $3 + local.get $8 + local.get $5 i32.add - local.set $0 + local.set $8 end - local.get $4 + local.get $3 i32.const 1 i32.add - local.set $4 + local.set $3 br $repeat|0 + unreachable end + unreachable end - block (result i32) - local.get $2 - i32.const 2 - i32.shl - local.get $5 - i32.add - i32.load - if - local.get $0 - i32.const 1 - i32.shl - local.get $1 - i32.add - i32.const 6928 - i32.const 30 - call $~lib/memory/memory.copy - local.get $0 - i32.const 15 - i32.add - local.set $0 - end - local.get $6 - local.get $0 - i32.gt_s - end + local.get $4 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load if - local.get $1 - local.get $0 + local.get $7 + local.get $8 + i32.const 1 + i32.shl + i32.add + i32.const 6720 + i32.const 15 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $8 + i32.const 15 + i32.add + local.set $8 + end + local.get $6 + local.get $8 + i32.gt_s + if + local.get $7 + i32.const 0 + local.get $8 call $~lib/string/String#substring - local.set $0 + local.set $3 local.get $1 - call $~lib/util/runtime/discard - local.get $0 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $3 return end + local.get $7 + local.set $3 local.get $1 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#toString (; 143 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#join (; 252 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_ref + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return + ) + (func $~lib/array/Array#toString (; 253 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4536 call $~lib/array/Array#join ) - (func $~lib/util/number/itoa_stream (; 144 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa (; 254 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/util/number/itoa32 + return + ) + (func $~lib/util/number/itoa_stream (; 255 ;) (type $FUNCSIG$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) + local.get $0 local.get $1 i32.const 1 i32.shl - local.get $0 i32.add local.set $0 local.get $2 - i32.const 255 - i32.and + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s i32.eqz if local.get $0 @@ -7662,6 +13605,8 @@ i32.const 1 return end + i32.const 0 + local.set $3 local.get $2 i32.const 24 i32.shl @@ -7669,7 +13614,8 @@ i32.shr_s i32.const 0 i32.lt_s - local.tee $1 + local.set $4 + local.get $4 if i32.const 0 local.get $2 @@ -7681,140 +13627,223 @@ i32.shl i32.const 24 i32.shr_s - local.tee $3 call $~lib/util/number/decimalCount32 - local.get $1 + local.get $4 i32.add - local.set $2 - local.get $0 - local.get $3 - local.get $2 - call $~lib/util/number/utoa32_lut - local.get $1 + local.set $3 + block $~lib/util/number/utoa32_core|inlined.6 + local.get $0 + local.set $7 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + local.set $6 + local.get $3 + local.set $5 + local.get $7 + local.get $6 + local.get $5 + call $~lib/util/number/utoa32_lut + end + local.get $4 if local.get $0 i32.const 45 i32.store16 end - local.get $2 + local.get $3 ) - (func $~lib/array/Array#join_int (; 145 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/array/Array#join_int (; 256 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 i32.sub - local.tee $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - local.get $3 + local.get $4 i32.load8_s - call $~lib/util/number/itoa32 + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end - i32.const 4524 - i32.load - i32.const 1 - i32.shr_u - local.tee $4 + local.get $1 + call $~lib/string/String#get:length + local.set $6 i32.const 11 + local.get $6 i32.add local.get $2 i32.mul i32.const 11 i32.add - local.tee $6 + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $1 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $0 - loop $repeat|0 - local.get $5 - local.get $2 - i32.lt_s - if - local.get $1 - local.get $0 + local.set $9 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 local.get $3 - local.get $5 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 + i32.const 0 + i32.shl i32.add i32.load8_s + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream - local.get $0 i32.add - local.set $0 - local.get $4 + local.set $9 + local.get $6 if - local.get $0 + local.get $8 + local.get $9 i32.const 1 i32.shl - local.get $1 i32.add - i32.const 4536 - local.get $4 + local.get $1 + local.get $6 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $0 - local.get $4 + local.get $9 + local.get $6 i32.add - local.set $0 + local.set $9 end - local.get $5 + local.get $3 i32.const 1 i32.add - local.set $5 + local.set $3 br $repeat|0 + unreachable end + unreachable end - local.get $6 - local.get $1 - local.get $0 + local.get $4 local.get $2 - local.get $3 + i32.const 0 + i32.shl i32.add i32.load8_s + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream - local.get $0 i32.add - local.tee $0 + local.set $9 + local.get $7 + local.get $9 i32.gt_s if - local.get $1 - local.get $0 + local.get $8 + i32.const 0 + local.get $9 call $~lib/string/String#substring - local.set $0 + local.set $3 local.get $1 - call $~lib/util/runtime/discard - local.get $0 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end + local.get $8 + local.set $3 local.get $1 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/util/number/itoa_stream (; 146 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#join (; 257 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return + ) + (func $~lib/array/Array#toString (; 258 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4536 + call $~lib/array/Array#join + ) + (func $~lib/util/number/itoa (; 259 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 65535 + i32.and + call $~lib/util/number/utoa32 + return + ) + (func $~lib/util/number/itoa_stream (; 260 ;) (type $FUNCSIG$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.get $0 local.get $1 i32.const 1 i32.shl - local.get $0 i32.add local.set $0 local.get $2 @@ -7828,277 +13857,389 @@ i32.const 1 return end + i32.const 0 + local.set $3 local.get $2 i32.const 65535 i32.and - local.tee $2 call $~lib/util/number/decimalCount32 - local.set $1 - local.get $0 - local.get $2 - local.get $1 - call $~lib/util/number/utoa32_lut - local.get $1 + local.set $3 + block $~lib/util/number/utoa32_core|inlined.7 + local.get $0 + local.set $6 + local.get $2 + i32.const 65535 + i32.and + local.set $5 + local.get $3 + local.set $4 + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/number/utoa32_lut + end + local.get $3 ) - (func $~lib/array/Array#join_int (; 147 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/array/Array#join_int (; 261 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 i32.sub - local.tee $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - local.get $3 + local.get $4 i32.load16_u - call $~lib/util/number/utoa32 + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end - i32.const 4524 - i32.load - i32.const 1 - i32.shr_u - local.tee $4 + local.get $1 + call $~lib/string/String#get:length + local.set $6 i32.const 10 + local.get $6 i32.add local.get $2 i32.mul i32.const 10 i32.add - local.tee $6 + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $1 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $0 - loop $repeat|0 - local.get $5 - local.get $2 - i32.lt_s - if - local.get $1 - local.get $0 - local.get $5 + local.set $9 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 i32.const 1 i32.shl - local.get $3 i32.add i32.load16_u + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream - local.get $0 i32.add - local.set $0 - local.get $4 + local.set $9 + local.get $6 if - local.get $0 + local.get $8 + local.get $9 i32.const 1 i32.shl - local.get $1 i32.add - i32.const 4536 - local.get $4 + local.get $1 + local.get $6 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $0 - local.get $4 + local.get $9 + local.get $6 i32.add - local.set $0 + local.set $9 end - local.get $5 + local.get $3 i32.const 1 i32.add - local.set $5 + local.set $3 br $repeat|0 + unreachable end + unreachable end - local.get $6 - local.get $1 - local.get $0 + local.get $4 local.get $2 i32.const 1 i32.shl - local.get $3 i32.add i32.load16_u + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream - local.get $0 i32.add - local.tee $0 + local.set $9 + local.get $7 + local.get $9 i32.gt_s if - local.get $1 - local.get $0 + local.get $8 + i32.const 0 + local.get $9 call $~lib/string/String#substring - local.set $0 + local.set $3 local.get $1 - call $~lib/util/runtime/discard - local.get $0 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end + local.get $8 + local.set $3 local.get $1 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/util/number/decimalCount64 (; 148 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/array/Array#join (; 262 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return + ) + (func $~lib/array/Array#toString (; 263 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4536 + call $~lib/array/Array#join + ) + (func $~lib/util/number/decimalCount64 (; 264 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (local $1 i32) local.get $0 i64.const 1000000000000000 i64.lt_u - if (result i32) + if local.get $0 i64.const 1000000000000 i64.lt_u - if (result i32) + if i32.const 11 i32.const 12 local.get $0 i64.const 100000000000 i64.lt_u select + return else - i32.const 13 i32.const 14 i32.const 15 local.get $0 i64.const 100000000000000 i64.lt_u select + local.set $1 + i32.const 13 + local.get $1 local.get $0 i64.const 10000000000000 i64.lt_u select + return end + unreachable + unreachable else local.get $0 i64.const 100000000000000000 i64.lt_u - if (result i32) + if i32.const 16 i32.const 17 local.get $0 i64.const 10000000000000000 i64.lt_u select + return else - i32.const 18 i32.const 19 i32.const 20 local.get $0 i64.const -8446744073709551616 i64.lt_u select + local.set $1 + i32.const 18 + local.get $1 local.get $0 i64.const 1000000000000000000 i64.lt_u select + return end + unreachable + unreachable end + unreachable + unreachable ) - (func $~lib/util/number/utoa64_lut (; 149 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/util/number/utoa64_lut (; 265 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i32) - (local $4 i32) + (local $4 i64) (local $5 i32) (local $6 i32) - i32.const 5100 - i32.load + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i64) + (local $13 i64) + i32.const 5072 + i32.load offset=4 local.set $3 - loop $continue|0 - local.get $1 - i64.const 100000000 - i64.ge_u - if - local.get $1 + block $break|0 + loop $continue|0 local.get $1 i64.const 100000000 - i64.div_u - local.tee $1 - i64.const 100000000 - i64.mul - i64.sub - i32.wrap_i64 - local.tee $4 - i32.const 10000 - i32.div_u - local.tee $5 - i32.const 100 - i32.div_u - local.set $6 - local.get $5 - i32.const 100 - i32.rem_u - local.set $5 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $4 - i32.const 10000 - i32.rem_u - local.tee $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $6 - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - local.get $5 - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - br $continue|0 + i64.ge_u + if + local.get $1 + i64.const 100000000 + i64.div_u + local.set $4 + local.get $1 + local.get $4 + i64.const 100000000 + i64.mul + i64.sub + i32.wrap_i64 + local.set $5 + local.get $4 + local.set $1 + local.get $5 + i32.const 10000 + i32.div_u + local.set $6 + local.get $5 + i32.const 10000 + i32.rem_u + local.set $7 + local.get $6 + i32.const 100 + i32.div_u + local.set $8 + local.get $6 + i32.const 100 + i32.rem_u + local.set $9 + local.get $7 + i32.const 100 + i32.div_u + local.set $10 + local.get $7 + i32.const 100 + i32.rem_u + local.set $11 + local.get $3 + local.get $10 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $12 + local.get $3 + local.get $11 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $13 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $12 + local.get $13 + i64.const 32 + i64.shl + i64.or + i64.store + local.get $3 + local.get $8 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $12 + local.get $3 + local.get $9 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $13 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $12 + local.get $13 + i64.const 32 + i64.shl + i64.or + i64.store + br $continue|0 + end end end local.get $0 @@ -8107,276 +14248,91 @@ local.get $2 call $~lib/util/number/utoa32_lut ) - (func $~lib/util/number/utoa64 (; 150 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i64.eqz - if - i32.const 4656 - return - end - local.get $0 - i64.const 4294967295 - i64.le_u - if - local.get $0 - i32.wrap_i64 - local.tee $1 - call $~lib/util/number/decimalCount32 - local.tee $3 - i32.const 1 - i32.shl - call $~lib/util/runtime/allocate - local.tee $2 - local.get $1 - local.get $3 - call $~lib/util/number/utoa32_lut - else - local.get $0 - call $~lib/util/number/decimalCount64 - local.tee $1 - i32.const 1 - i32.shl - call $~lib/util/runtime/allocate - local.tee $2 - local.get $0 - local.get $1 - call $~lib/util/number/utoa64_lut - end - local.get $2 - i32.const 16 - call $~lib/util/runtime/register - ) - (func $~lib/util/number/itoa_stream (; 151 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) - (local $3 i32) - local.get $1 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.set $0 - local.get $2 - i64.eqz - if - local.get $0 - i32.const 48 - i32.store16 - i32.const 1 - return - end - local.get $2 - i64.const 4294967295 - i64.le_u - if - local.get $2 - i32.wrap_i64 - local.tee $3 - call $~lib/util/number/decimalCount32 - local.set $1 - local.get $0 - local.get $3 - local.get $1 - call $~lib/util/number/utoa32_lut - else - local.get $0 - local.get $2 - local.get $2 - call $~lib/util/number/decimalCount64 - local.tee $1 - call $~lib/util/number/utoa64_lut - end - local.get $1 - ) - (func $~lib/array/Array#join_int (; 152 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/utoa64 (; 266 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.load offset=12 - i32.const 1 - i32.sub - local.tee $2 - i32.const 0 - i32.lt_s - if - i32.const 4208 - return - end - local.get $0 - i32.load offset=4 - local.set $3 - local.get $2 - i32.eqz - if - local.get $3 - i64.load - call $~lib/util/number/utoa64 - return - end - i32.const 4524 - i32.load - i32.const 1 - i32.shr_u - local.tee $4 - i32.const 20 - i32.add - local.get $2 - i32.mul - i32.const 20 - i32.add - local.tee $6 - i32.const 1 - i32.shl - call $~lib/util/runtime/allocate - local.set $1 - i32.const 0 - local.set $0 - loop $repeat|0 - local.get $5 - local.get $2 - i32.lt_s - if - local.get $1 - local.get $0 - local.get $5 - i32.const 3 - i32.shl - local.get $3 - i32.add - i64.load - call $~lib/util/number/itoa_stream - local.get $0 - i32.add - local.set $0 - local.get $4 - if - local.get $0 - i32.const 1 - i32.shl - local.get $1 - i32.add - i32.const 4536 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $0 - local.get $4 - i32.add - local.set $0 - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $repeat|0 - end - end - local.get $6 - local.get $1 - local.get $0 - local.get $2 - i32.const 3 - i32.shl - local.get $3 - i32.add - i64.load - call $~lib/util/number/itoa_stream - local.get $0 - i32.add - local.tee $0 - i32.gt_s - if - local.get $1 - local.get $0 - call $~lib/string/String#substring - local.set $0 - local.get $1 - call $~lib/util/runtime/discard - local.get $0 - return - end - local.get $1 - i32.const 16 - call $~lib/util/runtime/register - ) - (func $~lib/util/number/itoa64 (; 153 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) + (local $7 i64) local.get $0 i64.eqz if - i32.const 4656 + i32.const 4632 + call $~lib/rt/purerc/__retain return end - block (result i32) - local.get $0 - i64.const 0 - i64.lt_s - local.tee $1 - if - i64.const 0 - local.get $0 - i64.sub - local.set $0 - end - local.get $0 - i64.const 4294967295 - i64.le_u - end + local.get $0 + i64.const 4294967295 + i64.le_u if local.get $0 i32.wrap_i64 - local.tee $2 + local.set $2 + local.get $2 call $~lib/util/number/decimalCount32 - local.get $1 - i32.add - local.tee $4 + local.set $3 + local.get $3 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.tee $3 - local.get $2 - local.get $4 - call $~lib/util/number/utoa32_lut + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $1 + block $~lib/util/number/utoa32_core|inlined.8 + local.get $1 + local.set $6 + local.get $2 + local.set $5 + local.get $3 + local.set $4 + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/number/utoa32_lut + end else local.get $0 call $~lib/util/number/decimalCount64 - local.get $1 - i32.add - local.tee $2 + local.set $3 + local.get $3 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.tee $3 - local.get $0 - local.get $2 - call $~lib/util/number/utoa64_lut + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $1 + block $~lib/util/number/utoa64_core|inlined.0 + local.get $1 + local.set $4 + local.get $0 + local.set $7 + local.get $3 + local.set $2 + local.get $4 + local.get $7 + local.get $2 + call $~lib/util/number/utoa64_lut + end end local.get $1 - if - local.get $3 - i32.const 45 - i32.store16 - end - local.get $3 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/itoa_stream (; 154 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (func $~lib/util/number/itoa (; 267 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + local.get $0 + call $~lib/util/number/utoa64 + return + ) + (func $~lib/util/number/itoa_stream (; 268 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + local.get $0 local.get $1 i32.const 1 i32.shl - local.get $0 i32.add local.set $0 local.get $2 @@ -8388,44 +14344,398 @@ i32.const 1 return end - block (result i32) - local.get $2 - i64.const 0 - i64.lt_s - local.tee $1 - if - i64.const 0 - local.get $2 - i64.sub - local.set $2 - end - local.get $2 - i64.const 4294967295 - i64.le_u - end + i32.const 0 + local.set $3 + local.get $2 + i64.const 4294967295 + i64.le_u if local.get $2 i32.wrap_i64 - local.tee $4 + local.set $4 + local.get $4 + call $~lib/util/number/decimalCount32 + local.set $3 + block $~lib/util/number/utoa32_core|inlined.9 + local.get $0 + local.set $7 + local.get $4 + local.set $6 + local.get $3 + local.set $5 + local.get $7 + local.get $6 + local.get $5 + call $~lib/util/number/utoa32_lut + end + else + local.get $2 + call $~lib/util/number/decimalCount64 + local.set $3 + block $~lib/util/number/utoa64_core|inlined.1 + local.get $0 + local.set $5 + local.get $2 + local.set $8 + local.get $3 + local.set $4 + local.get $5 + local.get $8 + local.get $4 + call $~lib/util/number/utoa64_lut + end + end + local.get $3 + ) + (func $~lib/array/Array#join_int (; 269 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i64) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s + if + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $0 + i32.load offset=4 + local.set $4 + local.get $2 + i32.eqz + if + local.get $4 + i64.load + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 + return + end + local.get $1 + call $~lib/string/String#get:length + local.set $6 + i32.const 20 + local.get $6 + i32.add + local.get $2 + i32.mul + i32.const 20 + i32.add + local.set $7 + local.get $7 + i32.const 1 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 + i32.const 0 + local.set $9 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 + i32.const 3 + i32.shl + i32.add + i64.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $4 + local.get $2 + i32.const 3 + i32.shl + i32.add + i64.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $7 + local.get $9 + i32.gt_s + if + local.get $8 + i32.const 0 + local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + ) + (func $~lib/array/Array#join (; 270 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return + ) + (func $~lib/array/Array#toString (; 271 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4536 + call $~lib/array/Array#join + ) + (func $~lib/util/number/itoa64 (; 272 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + local.get $0 + i64.eqz + if + i32.const 4632 + call $~lib/rt/purerc/__retain + return + end + local.get $0 + i64.const 0 + i64.lt_s + local.set $1 + local.get $1 + if + i64.const 0 + local.get $0 + i64.sub + local.set $0 + end + local.get $0 + i64.const 4294967295 + i64.le_u + if + local.get $0 + i32.wrap_i64 + local.set $3 + local.get $3 call $~lib/util/number/decimalCount32 local.get $1 i32.add + local.set $4 + local.get $4 + i32.const 1 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $2 + block $~lib/util/number/utoa32_core|inlined.10 + local.get $2 + local.set $7 + local.get $3 + local.set $6 + local.get $4 + local.set $5 + local.get $7 + local.get $6 + local.get $5 + call $~lib/util/number/utoa32_lut + end + else + local.get $0 + call $~lib/util/number/decimalCount64 + local.get $1 + i32.add + local.set $4 + local.get $4 + i32.const 1 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $2 + block $~lib/util/number/utoa64_core|inlined.2 + local.get $2 + local.set $5 + local.get $0 + local.set $8 + local.get $4 + local.set $3 + local.get $5 + local.get $8 + local.get $3 + call $~lib/util/number/utoa64_lut + end + end + local.get $1 + if + local.get $2 + i32.const 45 + i32.store16 + end + local.get $2 + call $~lib/rt/purerc/__retain + ) + (func $~lib/util/number/itoa (; 273 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + local.get $0 + call $~lib/util/number/itoa64 + return + ) + (func $~lib/util/number/itoa_stream (; 274 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i64) + local.get $0 + local.get $1 + i32.const 1 + i32.shl + i32.add + local.set $0 + local.get $2 + i64.eqz + if + local.get $0 + i32.const 48 + i32.store16 + i32.const 1 + return + end + i32.const 0 + local.set $3 + local.get $2 + i64.const 0 + i64.lt_s + local.set $4 + local.get $4 + if + i64.const 0 + local.get $2 + i64.sub + local.set $2 + end + local.get $2 + i64.const 4294967295 + i64.le_u + if + local.get $2 + i32.wrap_i64 + local.set $5 + local.get $5 + call $~lib/util/number/decimalCount32 + local.get $4 + i32.add local.set $3 - local.get $0 - local.get $4 - local.get $3 - call $~lib/util/number/utoa32_lut + block $~lib/util/number/utoa32_core|inlined.11 + local.get $0 + local.set $8 + local.get $5 + local.set $7 + local.get $3 + local.set $6 + local.get $8 + local.get $7 + local.get $6 + call $~lib/util/number/utoa32_lut + end else - local.get $0 - local.get $2 local.get $2 call $~lib/util/number/decimalCount64 - local.get $1 + local.get $4 i32.add - local.tee $3 - call $~lib/util/number/utoa64_lut + local.set $3 + block $~lib/util/number/utoa64_core|inlined.3 + local.get $0 + local.set $6 + local.get $2 + local.set $9 + local.get $3 + local.set $5 + local.get $6 + local.get $9 + local.get $5 + call $~lib/util/number/utoa64_lut + end end - local.get $1 + local.get $4 if local.get $0 i32.const 45 @@ -8433,227 +14743,602 @@ end local.get $3 ) - (func $~lib/array/Array#join_int (; 155 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/array/Array#join_int (; 275 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i64) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 i32.sub - local.tee $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - local.get $3 + local.get $4 i64.load - call $~lib/util/number/itoa64 + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end - i32.const 4524 - i32.load - i32.const 1 - i32.shr_u - local.tee $4 + local.get $1 + call $~lib/string/String#get:length + local.set $6 i32.const 21 + local.get $6 i32.add local.get $2 i32.mul i32.const 21 i32.add - local.tee $6 + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $1 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $0 - loop $repeat|0 - local.get $5 - local.get $2 - i32.lt_s - if - local.get $1 - local.get $0 - local.get $5 + local.set $9 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 i32.const 3 i32.shl - local.get $3 i32.add i64.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream - local.get $0 i32.add - local.set $0 - local.get $4 + local.set $9 + local.get $6 if - local.get $0 + local.get $8 + local.get $9 i32.const 1 i32.shl - local.get $1 i32.add - i32.const 4536 - local.get $4 + local.get $1 + local.get $6 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $0 - local.get $4 + local.get $9 + local.get $6 i32.add - local.set $0 + local.set $9 end - local.get $5 + local.get $3 i32.const 1 i32.add - local.set $5 + local.set $3 br $repeat|0 + unreachable end + unreachable end - local.get $6 - local.get $1 - local.get $0 + local.get $4 local.get $2 i32.const 3 i32.shl - local.get $3 i32.add i64.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream - local.get $0 i32.add - local.tee $0 + local.set $9 + local.get $7 + local.get $9 i32.gt_s if - local.get $1 - local.get $0 + local.get $8 + i32.const 0 + local.get $9 call $~lib/string/String#substring - local.set $0 + local.set $3 local.get $1 - call $~lib/util/runtime/discard - local.get $0 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + ) + (func $~lib/array/Array#join (; 276 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return + ) + (func $~lib/array/Array#toString (; 277 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4536 + call $~lib/array/Array#join + ) + (func $~lib/array/Array<~lib/string/String | null>#join_str (; 278 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s + if + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $0 + i32.load offset=4 + local.set $4 + local.get $2 + i32.eqz + if + local.get $4 + i32.load + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $1 + call $~lib/string/String#get:length + local.set $5 + i32.const 0 + local.set $6 + i32.const 0 + local.set $7 + block $break|0 + block + i32.const 0 + local.set $3 + local.get $2 + i32.const 1 + i32.add + local.set $8 + end + loop $repeat|0 + local.get $3 + local.get $8 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $6 + local.get $7 + call $~lib/string/String#get:length + i32.add + local.set $6 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + i32.const 0 + local.set $9 + local.get $6 + local.get $5 + local.get $2 + i32.mul + i32.add + i32.const 1 + i32.shl i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $10 + block $break|1 + i32.const 0 + local.set $8 + loop $repeat|1 + local.get $8 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $4 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $7 + call $~lib/string/String#get:length + local.set $3 + local.get $10 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $7 + local.get $3 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $3 + i32.add + local.set $9 + end + local.get $5 + if + local.get $10 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $5 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $5 + i32.add + local.set $9 + end + local.get $8 + i32.const 1 + i32.add + local.set $8 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $10 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $7 + local.get $7 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + end + local.get $10 + local.set $8 + local.get $1 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $8 ) - (func $~lib/array/Array<~lib/string/String | null>#toString (; 156 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#join (; 279 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String | null>#join_str + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return + ) + (func $~lib/array/Array<~lib/string/String | null>#toString (; 280 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4536 + call $~lib/array/Array<~lib/string/String | null>#join + ) + (func $~lib/array/Array<~lib/string/String>#toString (; 281 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4536 call $~lib/array/Array<~lib/string/String>#join ) - (func $~lib/array/Array<~lib/array/Array>#join_arr (; 157 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 282 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 i32.sub - local.tee $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end - i32.const 4208 - local.set $1 - i32.const 4524 - i32.load - i32.const 1 - i32.shr_u + i32.const 4272 + call $~lib/rt/purerc/__retain local.set $4 + local.get $1 + call $~lib/string/String#get:length + local.set $5 local.get $0 i32.load offset=4 - local.set $3 + local.set $6 + i32.const 0 + local.set $7 local.get $2 i32.eqz if - local.get $3 + local.get $6 i32.load - local.tee $0 + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 if (result i32) - local.get $0 - i32.const 4536 + local.get $7 + local.get $1 call $~lib/array/Array#join else - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain end + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $3 return end - i32.const 0 - local.set $0 - loop $repeat|0 - local.get $0 - local.get $2 - i32.lt_s - if - local.get $0 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $6 + local.get $3 i32.const 2 i32.shl - local.get $3 i32.add i32.load - local.tee $5 + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 if + local.get $4 + local.get $7 local.get $1 - local.get $5 - i32.const 4536 call $~lib/array/Array#join + local.tee $8 call $~lib/string/String.__concat - local.set $1 + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $8 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release end - local.get $4 + local.get $5 if + local.get $4 local.get $1 - i32.const 4536 call $~lib/string/String.__concat - local.set $1 + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $9 + call $~lib/rt/purerc/__release end - local.get $0 + local.get $3 i32.const 1 i32.add - local.set $0 + local.set $3 br $repeat|0 + unreachable end + unreachable end + local.get $6 local.get $2 i32.const 2 i32.shl - local.get $3 i32.add i32.load - local.tee $0 - if (result i32) + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if + local.get $4 + local.get $7 local.get $1 - local.get $0 - i32.const 4536 call $~lib/array/Array#join + local.tee $3 call $~lib/string/String.__concat - else - local.get $1 + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release end + local.get $4 + local.set $9 + local.get $1 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $9 ) - (func $~lib/util/number/itoa_stream (; 158 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join (; 283 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#join_arr + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return + ) + (func $~lib/array/Array<~lib/array/Array>#toString (; 284 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4536 + call $~lib/array/Array<~lib/array/Array>#join + ) + (func $~lib/util/number/itoa (; 285 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 255 + i32.and + call $~lib/util/number/utoa32 + return + ) + (func $~lib/util/number/itoa_stream (; 286 ;) (type $FUNCSIG$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.get $0 local.get $1 i32.const 1 i32.shl - local.get $0 i32.add local.set $0 local.get $2 @@ -8667,4783 +15352,6551 @@ i32.const 1 return end + i32.const 0 + local.set $3 local.get $2 i32.const 255 i32.and - local.tee $2 call $~lib/util/number/decimalCount32 - local.set $1 - local.get $0 - local.get $2 - local.get $1 - call $~lib/util/number/utoa32_lut - local.get $1 + local.set $3 + block $~lib/util/number/utoa32_core|inlined.12 + local.get $0 + local.set $6 + local.get $2 + i32.const 255 + i32.and + local.set $5 + local.get $3 + local.set $4 + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/number/utoa32_lut + end + local.get $3 ) - (func $~lib/array/Array#join_int (; 159 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#join_int (; 287 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s + if + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $0 + i32.load offset=4 + local.set $4 + local.get $2 + i32.eqz + if + local.get $4 + i32.load8_u + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 + return + end + local.get $1 + call $~lib/string/String#get:length + local.set $6 + i32.const 10 + local.get $6 + i32.add + local.get $2 + i32.mul + i32.const 10 + i32.add + local.set $7 + local.get $7 + i32.const 1 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 + i32.const 0 + local.set $9 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $4 + local.get $2 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $7 + local.get $9 + i32.gt_s + if + local.get $8 + i32.const 0 + local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + ) + (func $~lib/array/Array#join (; 288 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return + ) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 289 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s + if + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $4 + local.get $1 + call $~lib/string/String#get:length + local.set $5 + local.get $0 + i32.load offset=4 + local.set $6 + i32.const 0 + local.set $7 + local.get $2 + i32.eqz + if + local.get $6 + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if (result i32) + local.get $7 + local.get $1 + call $~lib/array/Array#join + else + i32.const 4272 + call $~lib/rt/purerc/__retain + end + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $3 + return + end + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $6 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array#join + local.tee $8 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $8 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $5 + if + local.get $4 + local.get $1 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $6 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array#join + local.tee $3 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $4 + local.set $9 + local.get $1 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $9 + ) + (func $~lib/array/Array<~lib/array/Array>#join (; 290 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#join_arr + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return + ) + (func $~lib/array/Array<~lib/array/Array>#toString (; 291 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4536 + call $~lib/array/Array<~lib/array/Array>#join + ) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 292 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s + if + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $4 + local.get $1 + call $~lib/string/String#get:length + local.set $5 + local.get $0 + i32.load offset=4 + local.set $6 + i32.const 0 + local.set $7 + local.get $2 + i32.eqz + if + local.get $6 + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if (result i32) + local.get $7 + local.get $1 + call $~lib/array/Array#join + else + i32.const 4272 + call $~lib/rt/purerc/__retain + end + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $3 + return + end + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $6 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array#join + local.tee $8 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $8 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $5 + if + local.get $4 + local.get $1 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $6 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array#join + local.tee $3 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $4 + local.set $9 + local.get $1 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $9 + ) + (func $~lib/array/Array<~lib/array/Array>#join (; 293 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#join_arr + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return + ) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join_arr (; 294 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s + if + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $4 + local.get $1 + call $~lib/string/String#get:length + local.set $5 + local.get $0 + i32.load offset=4 + local.set $6 + i32.const 0 + local.set $7 + local.get $2 + i32.eqz + if + local.get $6 + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if (result i32) + local.get $7 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#join + else + i32.const 4272 + call $~lib/rt/purerc/__retain + end + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $3 + return + end + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $6 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#join + local.tee $8 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $8 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $5 + if + local.get $4 + local.get $1 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $6 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#join + local.tee $3 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $4 + local.set $9 + local.get $1 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $9 + ) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join (; 295 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join_arr + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + return + ) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString (; 296 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4536 + call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join + ) + (func $start:std/array (; 297 ;) (type $FUNCSIG$v) + (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.load offset=12 - i32.const 1 - i32.sub - local.tee $2 + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i32) + (local $19 i32) + (local $20 i32) + (local $21 i32) + (local $22 i32) + (local $23 i32) + (local $24 i32) + (local $25 i32) + (local $26 i32) + (local $27 i32) + (local $28 i32) + (local $29 i32) + (local $30 i32) + (local $31 i32) + (local $32 i32) + (local $33 i32) + (local $34 i32) + (local $35 i32) + (local $36 i32) + (local $37 i32) + (local $38 i32) + (local $39 i32) + (local $40 i32) + (local $41 i32) + (local $42 i32) + (local $43 i32) + (local $44 i32) + (local $45 i32) + (local $46 i32) + (local $47 i32) + (local $48 i32) + (local $49 i32) + (local $50 i32) + (local $51 i32) + (local $52 i32) + (local $53 i32) + (local $54 i32) + (local $55 i32) + (local $56 i32) i32.const 0 - i32.lt_s - if - i32.const 4208 - return - end - local.get $0 - i32.load offset=4 - local.set $3 - local.get $2 - i32.eqz - if - local.get $3 - i32.load8_u - call $~lib/util/number/utoa32 - return - end - i32.const 4524 - i32.load - i32.const 1 - i32.shr_u - local.tee $4 - i32.const 10 - i32.add - local.get $2 - i32.mul - i32.const 10 - i32.add - local.tee $6 - i32.const 1 - i32.shl - call $~lib/util/runtime/allocate - local.set $1 i32.const 0 - local.set $0 - loop $repeat|0 - local.get $5 - local.get $2 - i32.lt_s - if - local.get $1 - local.get $0 - local.get $3 - local.get $5 - i32.add - i32.load8_u - call $~lib/util/number/itoa_stream - local.get $0 - i32.add - local.set $0 - local.get $4 - if - local.get $0 - i32.const 1 - i32.shl - local.get $1 - i32.add - i32.const 4536 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $0 - local.get $4 - i32.add - local.set $0 - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $repeat|0 - end - end - local.get $6 - local.get $1 - local.get $0 - local.get $2 - local.get $3 - i32.add - i32.load8_u - call $~lib/util/number/itoa_stream - local.get $0 - i32.add - local.tee $0 - i32.gt_s - if - local.get $1 - local.get $0 - call $~lib/string/String#substring - local.set $0 - local.get $1 - call $~lib/util/runtime/discard - local.get $0 - return - end - local.get $1 - i32.const 16 - call $~lib/util/runtime/register - ) - (func $~lib/array/Array<~lib/array/Array>#join_arr (; 160 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=12 - i32.const 1 - i32.sub - local.tee $2 - i32.const 0 - i32.lt_s - if - i32.const 4208 - return - end - i32.const 4208 - local.set $1 - i32.const 4524 - i32.load - i32.const 1 - i32.shr_u - local.set $4 - local.get $0 - i32.load offset=4 - local.set $3 - local.get $2 - i32.eqz - if - local.get $3 - i32.load - local.tee $0 - if (result i32) - local.get $0 - call $~lib/array/Array#join_int - else - i32.const 4208 - end - return - end - i32.const 0 - local.set $0 - loop $repeat|0 - local.get $0 - local.get $2 - i32.lt_s - if - local.get $0 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load - local.tee $5 - if - local.get $1 - local.get $5 - call $~lib/array/Array#join_int - call $~lib/string/String.__concat - local.set $1 - end - local.get $4 - if - local.get $1 - i32.const 4536 - call $~lib/string/String.__concat - local.set $1 - end - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - end - end - local.get $2 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load - local.tee $0 - if (result i32) - local.get $1 - local.get $0 - call $~lib/array/Array#join_int - call $~lib/string/String.__concat - else - local.get $1 - end - ) - (func $~lib/array/Array<~lib/array/Array>#join_arr (; 161 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=12 - i32.const 1 - i32.sub - local.tee $2 - i32.const 0 - i32.lt_s - if - i32.const 4208 - return - end - i32.const 4208 - local.set $1 - i32.const 4524 - i32.load - i32.const 1 - i32.shr_u - local.set $4 - local.get $0 - i32.load offset=4 - local.set $3 - local.get $2 - i32.eqz - if - local.get $3 - i32.load - local.tee $0 - if (result i32) - local.get $0 - i32.const 4536 - call $~lib/array/Array#join - else - i32.const 4208 - end - return - end - i32.const 0 - local.set $0 - loop $repeat|0 - local.get $0 - local.get $2 - i32.lt_s - if - local.get $0 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load - local.tee $5 - if - local.get $1 - local.get $5 - i32.const 4536 - call $~lib/array/Array#join - call $~lib/string/String.__concat - local.set $1 - end - local.get $4 - if - local.get $1 - i32.const 4536 - call $~lib/string/String.__concat - local.set $1 - end - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - end - end - local.get $2 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load - local.tee $0 - if (result i32) - local.get $1 - local.get $0 - i32.const 4536 - call $~lib/array/Array#join - call $~lib/string/String.__concat - else - local.get $1 - end - ) - (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join_arr (; 162 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=12 - i32.const 1 - i32.sub - local.tee $2 - i32.const 0 - i32.lt_s - if - i32.const 4208 - return - end - i32.const 4208 - local.set $1 - i32.const 4524 - i32.load - i32.const 1 - i32.shr_u - local.set $4 - local.get $0 - i32.load offset=4 - local.set $3 - local.get $2 - i32.eqz - if - local.get $3 - i32.load - local.tee $0 - if (result i32) - local.get $0 - call $~lib/array/Array<~lib/array/Array>#join_arr - else - i32.const 4208 - end - return - end - i32.const 0 - local.set $0 - loop $repeat|0 - local.get $0 - local.get $2 - i32.lt_s - if - local.get $0 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load - local.tee $5 - if - local.get $1 - local.get $5 - call $~lib/array/Array<~lib/array/Array>#join_arr - call $~lib/string/String.__concat - local.set $1 - end - local.get $4 - if - local.get $1 - i32.const 4536 - call $~lib/string/String.__concat - local.set $1 - end - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - end - end - local.get $2 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load - local.tee $0 - if (result i32) - local.get $1 - local.get $0 - call $~lib/array/Array<~lib/array/Array>#join_arr - call $~lib/string/String.__concat - else - local.get $1 - end - ) - (func $start:std/array (; 163 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - (local $2 i32) - i32.const 8400 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset call $~lib/array/Array#constructor global.set $std/array/arr - global.get $std/array/Null - if + block i32.const 0 - i32.const 160 - i32.const 39 + call $~lib/array/Array.isArray<~lib/array/Array | null> i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - i32.ne - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 40 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - call $~lib/util/runtime/allocate - i32.const 18 - call $~lib/util/runtime/register - drop - i32.const 12 - call $~lib/util/runtime/allocate - i32.const 19 - call $~lib/util/runtime/register - i32.const 1 - i32.const 0 - call $~lib/arraybuffer/ArrayBufferView#constructor - drop - global.get $std/array/arr8 - i32.const 1 - i32.const 1 - i32.const 3 - call $~lib/array/Array#fill - global.get $std/array/arr8 - i32.const 5 - i32.const 0 - i32.const 20 - i32.const 256 - call $~lib/util/runtime/makeArray - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 51 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr8 - i32.const 0 - i32.const 0 - i32.const 2147483647 - call $~lib/array/Array#fill - global.get $std/array/arr8 - i32.const 5 - i32.const 0 - i32.const 20 - i32.const 328 - call $~lib/util/runtime/makeArray - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 54 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr8 - i32.const 1 - i32.const 0 - i32.const -3 - call $~lib/array/Array#fill - global.get $std/array/arr8 - i32.const 5 - i32.const 0 - i32.const 20 - i32.const 352 - call $~lib/util/runtime/makeArray - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 57 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr8 - i32.const 2 - i32.const -2 - i32.const 2147483647 - call $~lib/array/Array#fill - global.get $std/array/arr8 - i32.const 5 - i32.const 0 - i32.const 20 - i32.const 376 - call $~lib/util/runtime/makeArray - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 60 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr8 - i32.const 0 - i32.const 1 - i32.const 0 - call $~lib/array/Array#fill - global.get $std/array/arr8 - i32.const 5 - i32.const 0 - i32.const 20 - i32.const 400 - call $~lib/util/runtime/makeArray - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 63 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr32 - i32.const 1 - i32.const 1 - i32.const 3 - call $~lib/array/Array#fill - global.get $std/array/arr32 - i32.const 5 - i32.const 2 - i32.const 21 - i32.const 496 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 68 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr32 - i32.const 0 - i32.const 0 - i32.const 2147483647 - call $~lib/array/Array#fill - global.get $std/array/arr32 - i32.const 5 - i32.const 2 - i32.const 21 - i32.const 536 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 71 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr32 - i32.const 1 - i32.const 0 - i32.const -3 - call $~lib/array/Array#fill - global.get $std/array/arr32 - i32.const 5 - i32.const 2 - i32.const 21 - i32.const 576 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 74 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr32 - i32.const 2 - i32.const -2 - i32.const 2147483647 - call $~lib/array/Array#fill - global.get $std/array/arr32 - i32.const 5 - i32.const 2 - i32.const 21 - i32.const 616 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 77 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr32 - i32.const 0 - i32.const 1 - i32.const 0 - call $~lib/array/Array#fill - global.get $std/array/arr32 - i32.const 5 - i32.const 2 - i32.const 21 - i32.const 656 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 80 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - if - i32.const 0 - i32.const 160 - i32.const 84 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - if - i32.const 0 - i32.const 160 - i32.const 85 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 42 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 42 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 89 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 90 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 91 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - global.set $std/array/i - global.get $std/array/i - i32.const 42 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 95 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - if - i32.const 0 - i32.const 160 - i32.const 96 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 97 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - call $~lib/array/Array#push - global.get $std/array/arr - i32.load offset=12 - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 101 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 102 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 103 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 44 - call $~lib/array/Array#push - global.get $std/array/arr - i32.load offset=12 - i32.const 2 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 107 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 2 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 108 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 109 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 44 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 110 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 45 - call $~lib/array/Array#push - global.get $std/array/arr - i32.load offset=12 - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 114 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 115 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 116 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 44 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 117 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 45 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 118 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - call $~lib/array/Array#constructor - global.set $std/array/other - global.get $std/array/arr - global.get $std/array/other - call $~lib/array/Array#concat - global.set $std/array/out - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 125 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 126 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.load offset=12 - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 127 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 696 - call $~lib/util/runtime/makeArray - call $~lib/array/Array#concat - drop - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 130 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 132 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 1 - call $~lib/array/Array#__get - i32.const 44 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 133 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 2 - call $~lib/array/Array#__get - i32.const 45 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 134 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/other - i32.const 46 - call $~lib/array/Array#push - global.get $std/array/other - i32.const 47 - call $~lib/array/Array#push - global.get $std/array/arr - global.get $std/array/other - call $~lib/array/Array#concat - global.set $std/array/out - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 141 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/other - i32.load offset=12 - i32.const 2 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 142 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.load offset=12 - i32.const 5 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 143 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 144 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 1 - call $~lib/array/Array#__get - i32.const 44 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 145 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 2 - call $~lib/array/Array#__get - i32.const 45 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 146 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 3 - call $~lib/array/Array#__get - i32.const 46 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 147 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 4 - call $~lib/array/Array#__get - i32.const 47 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 148 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - call $~lib/array/Array#pop - drop - global.get $std/array/out - i32.load offset=12 - i32.const 4 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 151 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#concat - global.set $std/array/out - global.get $std/array/out - i32.load offset=12 - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 154 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 2 - call $~lib/array/Array#__get - i32.const 45 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 155 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/source - i32.load offset=12 - if - i32.const 0 - i32.const 160 - i32.const 158 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/source - global.get $std/array/arr - call $~lib/array/Array#concat - global.set $std/array/out - global.get $std/array/out - i32.load offset=12 - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 160 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/source - i32.load offset=12 - if - i32.const 0 - i32.const 160 - i32.const 161 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 760 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 0 - i32.const 3 - i32.const 2147483647 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 800 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 167 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 840 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 1 - i32.const 3 - i32.const 2147483647 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 880 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 169 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 920 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 1 - i32.const 2 - i32.const 2147483647 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 960 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 171 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1000 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 2 - i32.const 2 - i32.const 2147483647 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1040 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 173 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1080 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 0 - i32.const 3 - i32.const 4 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1120 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 175 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1160 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 1 - i32.const 3 - i32.const 4 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1200 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 177 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1240 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 1 - i32.const 2 - i32.const 4 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1280 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 179 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1320 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 0 - i32.const -2 - i32.const 2147483647 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1360 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 181 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1400 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 0 - i32.const -2 - i32.const -1 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1440 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 183 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1480 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const -4 - i32.const -3 - i32.const -2 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1520 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 185 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1560 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const -4 - i32.const -3 - i32.const -1 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1600 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 187 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1640 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const -4 - i32.const -3 - i32.const 2147483647 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1680 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 189 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 42 - call $~lib/array/Array#unshift - global.get $std/array/arr - i32.load offset=12 - i32.const 4 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 195 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 4 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 196 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 42 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 197 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 43 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 198 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 44 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 199 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#__get - i32.const 45 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 200 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 41 - call $~lib/array/Array#unshift - global.get $std/array/arr - i32.load offset=12 - i32.const 5 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 204 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 5 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 205 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 41 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 206 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 42 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 207 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 43 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 208 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#__get - i32.const 44 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 209 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 4 - call $~lib/array/Array#__get - i32.const 45 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 210 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#shift - global.set $std/array/i - global.get $std/array/i - i32.const 41 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 216 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 4 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 217 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 5 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 218 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 42 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 219 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 43 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 220 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 44 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 221 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#__get - i32.const 45 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 222 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - global.set $std/array/i - global.get $std/array/i - i32.const 45 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 226 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 227 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 5 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 228 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 42 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 229 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 43 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 230 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 44 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 231 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#reverse - global.get $std/array/arr - i32.load offset=12 - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 237 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 5 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 238 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 44 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 239 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 43 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 240 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 42 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 241 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 44 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 44 - i32.const 0 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - if - i32.const 0 - i32.const 160 - i32.const 250 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 42 - i32.const 0 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 2 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 254 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 45 - i32.const 0 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 258 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 100 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 262 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const -100 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 266 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const -2 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 270 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const -4 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 274 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 0 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 278 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 1 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 282 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 2 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 286 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 44 - i32.const 0 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 292 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 42 - i32.const 0 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 296 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 45 - i32.const 0 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - if - i32.const 0 - i32.const 160 - i32.const 300 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 100 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - if - i32.const 0 - i32.const 160 - i32.const 304 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const -100 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 308 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const -2 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 312 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const -4 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 316 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 0 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 320 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 1 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 324 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 2 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 328 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - i32.const 1 - call $~lib/array/Array#splice - drop - global.get $std/array/arr - i32.load offset=12 - i32.const 4 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 332 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 2 - i32.shr_s - i32.const 5 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 333 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 44 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 334 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 42 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 335 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 0 - i32.const 2147483647 - call $~lib/array/Array#splice - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1792 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 340 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 1832 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 341 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1848 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 2 - i32.const 2147483647 - call $~lib/array/Array#splice - i32.const 3 - i32.const 2 - i32.const 17 - i32.const 1888 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 344 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 1920 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 345 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1944 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 2 - i32.const 2 - call $~lib/array/Array#splice - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 1984 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 348 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 3 - i32.const 2 - i32.const 17 - i32.const 2008 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 349 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2040 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 0 - i32.const 1 - call $~lib/array/Array#splice - i32.const 1 - i32.const 2 - i32.const 17 - i32.const 2080 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 352 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 4 - i32.const 2 - i32.const 17 - i32.const 2104 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 353 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2136 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const -1 - i32.const 2147483647 - call $~lib/array/Array#splice - i32.const 1 - i32.const 2 - i32.const 17 - i32.const 2176 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 356 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 4 - i32.const 2 - i32.const 17 - i32.const 2200 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 357 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2232 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const -2 - i32.const 2147483647 - call $~lib/array/Array#splice - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 2272 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 360 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 3 - i32.const 2 - i32.const 17 - i32.const 2296 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 361 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2328 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const -2 - i32.const 1 - call $~lib/array/Array#splice - i32.const 1 - i32.const 2 - i32.const 17 - i32.const 2368 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 364 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 4 - i32.const 2 - i32.const 17 - i32.const 2392 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 365 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2424 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const -7 - i32.const 1 - call $~lib/array/Array#splice - i32.const 1 - i32.const 2 - i32.const 17 - i32.const 2464 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 368 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 4 - i32.const 2 - i32.const 17 - i32.const 2488 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 369 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2520 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const -2 - i32.const -1 - call $~lib/array/Array#splice - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 2560 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 372 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2576 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 373 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2616 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 1 - i32.const -2 - call $~lib/array/Array#splice - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 2656 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 376 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2672 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 377 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2712 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 4 - i32.const 0 - call $~lib/array/Array#splice - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 2752 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 380 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2768 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 381 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2808 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 7 - i32.const 0 - call $~lib/array/Array#splice - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 2848 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 384 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2864 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 385 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2904 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 7 - i32.const 5 - call $~lib/array/Array#splice - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 2944 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 388 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2960 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 389 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - i32.const 0 - call $~lib/array/Array#__set - global.get $std/array/arr - i32.const 1 - i32.const 1 - call $~lib/array/Array#__set - global.get $std/array/arr - i32.const 2 - i32.const 2 - call $~lib/array/Array#__set - global.get $std/array/arr - i32.const 3 - i32.const 3 - call $~lib/array/Array#__set - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - if - i32.const 0 - i32.const 160 - i32.const 399 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 402 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 405 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 4 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 413 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 8 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 414 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 5 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.eq - if - i32.const 0 - i32.const 160 - i32.const 416 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 6 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 429 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 2 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 430 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 7 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 438 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 8 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - if - i32.const 0 - i32.const 160 - i32.const 441 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 9 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 449 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 8 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 450 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 10 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - if - i32.const 0 - i32.const 160 - i32.const 452 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 11 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 465 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 2 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 466 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 12 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 474 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 13 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - if - i32.const 0 - i32.const 160 - i32.const 477 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 14 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - if - i32.const 0 - i32.const 160 - i32.const 485 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 8 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 486 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 15 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 488 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 16 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - if - i32.const 0 - i32.const 160 - i32.const 501 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 2 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 502 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 17 - call $~lib/array/Array#forEach - global.get $std/array/i - i32.const 6 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 511 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 18 - call $~lib/array/Array#forEach - global.get $std/array/i - i32.const 6 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 520 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 8 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 521 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 19 - call $~lib/array/Array#forEach - global.get $std/array/i - i32.const 406 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 524 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 20 - call $~lib/array/Array#forEach - global.get $std/array/i - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 538 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 2 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 539 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 21 - call $~lib/array/Array#forEach - global.get $std/array/arr - i32.load offset=12 - i32.const 100 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 564 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_s + i32.eq + i32.eqz if - global.get $std/array/arr - call $~lib/array/Array#pop - drop - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 + i32.const 0 + i32.const 232 + i32.const 37 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array.isArray<~lib/array/Array> + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $std/array/P#constructor + local.tee $0 + call $~lib/array/Array.isArray + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 39 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/array/Array.isArray<~lib/typedarray/Uint8Array> + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $~lib/array/Array.isArray + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 41 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 272 + call $~lib/array/Array.isArray<~lib/string/String> + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 42 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + end + block + i32.const 5 + i32.const 0 + i32.const 20 + i32.const 296 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $0 + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 + i32.const 1 + i32.const 1 + i32.const 3 + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $1 + i32.const 5 + i32.const 0 + i32.const 20 + i32.const 376 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $3 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 50 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 0 + i32.const 0 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $1 + i32.const 5 + i32.const 0 + i32.const 20 + i32.const 504 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $4 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 53 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.const 0 + i32.const -3 + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $1 + i32.const 5 + i32.const 0 + i32.const 20 + i32.const 528 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $5 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 56 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 2 + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $1 + i32.const 5 + i32.const 0 + i32.const 20 + i32.const 552 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $6 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 59 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 0 + i32.const 1 + i32.const 0 + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $1 + i32.const 5 + i32.const 0 + i32.const 20 + i32.const 576 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $7 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 62 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + end + block + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 600 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $6 + call $~lib/rt/purerc/__retain + local.set $7 + local.get $7 + i32.const 1 + i32.const 1 + i32.const 3 + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 640 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $4 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 69 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 + i32.const 0 + i32.const 0 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 680 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $3 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 72 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 + i32.const 1 + i32.const 0 + i32.const -3 + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 720 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $1 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 75 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 + i32.const 2 + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 760 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $0 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 78 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 + i32.const 0 + i32.const 1 + i32.const 0 + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 800 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $2 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 81 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $6 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + end + block + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 87 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 88 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 42 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 92 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 93 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 94 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + local.set $2 + local.get $2 + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 98 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 99 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 100 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + call $~lib/array/Array#push + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 105 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 106 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 44 + call $~lib/array/Array#push + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 110 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 111 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 112 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 113 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 45 + call $~lib/array/Array#push + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 117 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 118 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 119 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 120 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 121 + i32.const 2 + call $~lib/builtins/abort + unreachable end end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - global.get $std/array/arr - call $~lib/array/Array#map - global.set $std/array/newArr - global.get $std/array/newArr - i32.load offset=12 - i32.const 4 - i32.ne - if + block i32.const 0 - i32.const 160 - i32.const 575 i32.const 0 - call $~lib/builtins/abort - unreachable + call $~lib/array/Array#constructor + local.set $2 + global.get $std/array/arr + local.get $2 + call $~lib/array/Array#concat + local.set $0 + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 130 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 131 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 132 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 888 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $3 + call $~lib/array/Array#concat + call $~lib/rt/purerc/__release + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 135 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 137 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 138 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 139 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 46 + call $~lib/array/Array#push + drop + local.get $2 + i32.const 47 + call $~lib/array/Array#push + drop + block (result i32) + local.get $0 + call $~lib/rt/purerc/__release + global.get $std/array/arr + local.get $2 + call $~lib/array/Array#concat + end + local.set $0 + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 146 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 147 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/array/Array#get:length + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 148 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 149 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 150 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 151 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + call $~lib/array/Array#__get + i32.const 46 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 152 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 4 + call $~lib/array/Array#__get + i32.const 47 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 153 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/array/Array#pop + drop + local.get $0 + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 156 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $0 + call $~lib/rt/purerc/__release + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#concat + end + local.set $0 + local.get $0 + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 159 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 160 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 904 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $4 + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 + call $~lib/array/Array#get:length + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 163 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + global.get $std/array/arr + call $~lib/array/Array#concat + end + local.set $0 + local.get $0 + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 165 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/array/Array#get:length + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 166 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release end - global.get $std/array/newArr - i32.const 0 - call $~lib/array/Array#__get - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - f32.convert_i32_s - f32.ne - if + block i32.const 0 - i32.const 160 - i32.const 576 + local.set $1 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 920 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $3 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 i32.const 0 - call $~lib/builtins/abort - unreachable + i32.const 3 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $4 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 960 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $2 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 174 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1000 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $7 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 1 + i32.const 3 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $0 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1040 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $5 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 176 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1080 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $8 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 1 + i32.const 2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $6 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1120 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $10 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 178 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1160 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $11 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 2 + i32.const 2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $9 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1200 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $13 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 180 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1240 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $14 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 0 + i32.const 3 + i32.const 4 + call $~lib/array/Array#copyWithin + local.tee $12 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1280 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $16 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 182 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1320 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $17 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 1 + i32.const 3 + i32.const 4 + call $~lib/array/Array#copyWithin + local.tee $15 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1360 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $19 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 184 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1400 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $20 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 1 + i32.const 2 + i32.const 4 + call $~lib/array/Array#copyWithin + local.tee $18 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1440 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $22 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 186 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1480 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $23 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 0 + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $21 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1520 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $25 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 188 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1560 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $26 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 0 + i32.const -2 + i32.const -1 + call $~lib/array/Array#copyWithin + local.tee $24 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1600 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $28 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 190 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1640 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $29 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const -4 + i32.const -3 + i32.const -2 + call $~lib/array/Array#copyWithin + local.tee $27 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1680 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $31 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 192 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1720 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $32 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const -4 + i32.const -3 + i32.const -1 + call $~lib/array/Array#copyWithin + local.tee $30 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1760 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $34 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 194 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1800 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $35 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const -4 + i32.const -3 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $33 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1840 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $37 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 196 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $10 + call $~lib/rt/purerc/__release + local.get $11 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $13 + call $~lib/rt/purerc/__release + local.get $14 + call $~lib/rt/purerc/__release + local.get $12 + call $~lib/rt/purerc/__release + local.get $16 + call $~lib/rt/purerc/__release + local.get $17 + call $~lib/rt/purerc/__release + local.get $15 + call $~lib/rt/purerc/__release + local.get $19 + call $~lib/rt/purerc/__release + local.get $20 + call $~lib/rt/purerc/__release + local.get $18 + call $~lib/rt/purerc/__release + local.get $22 + call $~lib/rt/purerc/__release + local.get $23 + call $~lib/rt/purerc/__release + local.get $21 + call $~lib/rt/purerc/__release + local.get $25 + call $~lib/rt/purerc/__release + local.get $26 + call $~lib/rt/purerc/__release + local.get $24 + call $~lib/rt/purerc/__release + local.get $28 + call $~lib/rt/purerc/__release + local.get $29 + call $~lib/rt/purerc/__release + local.get $27 + call $~lib/rt/purerc/__release + local.get $31 + call $~lib/rt/purerc/__release + local.get $32 + call $~lib/rt/purerc/__release + local.get $30 + call $~lib/rt/purerc/__release + local.get $34 + call $~lib/rt/purerc/__release + local.get $35 + call $~lib/rt/purerc/__release + local.get $33 + call $~lib/rt/purerc/__release + local.get $37 + call $~lib/rt/purerc/__release end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 23 - call $~lib/array/Array#map - global.get $std/array/i - i32.const 6 - i32.ne - if + block + global.get $std/array/arr + i32.const 42 + call $~lib/array/Array#unshift + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 204 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 205 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - i32.const 160 - i32.const 585 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 206 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 207 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 208 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 209 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 41 + call $~lib/array/Array#unshift + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 213 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 214 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - call $~lib/builtins/abort - unreachable + call $~lib/array/Array#__get + i32.const 41 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 215 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 216 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 217 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 218 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 4 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 219 + i32.const 2 + call $~lib/builtins/abort + unreachable + end end - global.get $std/array/arr - i32.load offset=12 - i32.const 8 - i32.ne - if + block + global.get $std/array/arr + call $~lib/array/Array#shift + global.set $std/array/i + global.get $std/array/i + i32.const 41 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 228 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 229 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 230 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - i32.const 160 - i32.const 586 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 231 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 232 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 233 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 234 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + global.set $std/array/i + global.get $std/array/i + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 238 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 239 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 240 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - call $~lib/builtins/abort - unreachable + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 241 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 242 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 243 + i32.const 2 + call $~lib/builtins/abort + unreachable + end end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 24 - call $~lib/array/Array#map - global.get $std/array/i - i32.const 406 - i32.ne - if + block + global.get $std/array/arr + call $~lib/array/Array#reverse + call $~lib/rt/purerc/__release + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 251 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 252 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - i32.const 160 - i32.const 593 - i32.const 0 - call $~lib/builtins/abort - unreachable + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 253 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 254 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 255 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 44 + call $~lib/array/Array#push + drop end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 25 - call $~lib/array/Array#map - global.get $std/array/i - i32.const 1 - i32.ne - if + block + global.get $std/array/arr + i32.const 44 i32.const 0 - i32.const 160 - i32.const 608 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i i32.const 0 - call $~lib/builtins/abort - unreachable + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 265 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 42 + i32.const 0 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 268 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 45 + i32.const 0 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 271 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 100 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 274 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -100 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 277 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -2 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 280 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -4 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 283 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 0 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 286 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 1 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 289 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 2 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 292 + i32.const 2 + call $~lib/builtins/abort + unreachable + end end - global.get $std/array/arr - i32.load offset=12 - i32.const 2 - i32.ne - if + block + global.get $std/array/arr + i32.const 44 i32.const 0 - i32.const 160 - i32.const 609 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 299 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 42 i32.const 0 - call $~lib/builtins/abort - unreachable + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 302 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 45 + i32.const 0 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 305 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 100 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 308 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -100 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 311 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -2 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 314 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -4 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 317 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 0 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 320 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 1 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 323 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 2 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 326 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + i32.const 1 + call $~lib/array/Array#splice + call $~lib/rt/purerc/__release + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 330 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 331 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 332 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 333 + i32.const 2 + call $~lib/builtins/abort + unreachable + end end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 26 - call $~lib/array/Array#filter - global.set $std/array/filteredArr - global.get $std/array/filteredArr - i32.load offset=12 - i32.const 2 - i32.ne - if + block + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1880 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $33 + call $~lib/rt/purerc/__retain + local.set $37 + local.get $37 i32.const 0 - i32.const 160 - i32.const 617 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#splice + local.tee $35 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1920 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $30 i32.const 0 - call $~lib/builtins/abort - unreachable + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 340 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 1960 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $32 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 341 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1976 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $31 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#splice + local.tee $34 + i32.const 3 + i32.const 2 + i32.const 17 + i32.const 2016 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $29 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 344 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 2048 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $28 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 345 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2072 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $24 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 2 + i32.const 2 + call $~lib/array/Array#splice + local.tee $27 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 2112 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $25 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 348 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 3 + i32.const 2 + i32.const 17 + i32.const 2136 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $21 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 349 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2168 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $23 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 0 + i32.const 1 + call $~lib/array/Array#splice + local.tee $26 + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 2208 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $18 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 352 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 2232 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $20 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 353 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2264 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $19 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const -1 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#splice + local.tee $22 + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 2304 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $17 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 356 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 2328 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $16 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 357 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2360 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $12 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#splice + local.tee $15 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 2400 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $13 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 360 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 3 + i32.const 2 + i32.const 17 + i32.const 2424 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $9 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 361 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2456 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $11 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const -2 + i32.const 1 + call $~lib/array/Array#splice + local.tee $14 + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 2496 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $6 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 364 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 2520 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $8 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 365 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2552 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $5 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const -7 + i32.const 1 + call $~lib/array/Array#splice + local.tee $10 + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 2592 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $7 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 368 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 2616 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $2 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 369 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2648 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $4 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const -2 + i32.const -1 + call $~lib/array/Array#splice + local.tee $0 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 2688 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $1 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 372 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2704 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $36 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 373 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2744 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $38 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 1 + i32.const -2 + call $~lib/array/Array#splice + local.tee $3 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 2784 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $40 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 376 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2800 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $41 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 377 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2840 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $42 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 4 + i32.const 0 + call $~lib/array/Array#splice + local.tee $39 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 2880 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $44 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 380 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2896 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $45 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 381 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2936 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $46 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 7 + i32.const 0 + call $~lib/array/Array#splice + local.tee $43 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 2976 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $48 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 384 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2992 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $49 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 385 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 3032 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $50 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 7 + i32.const 5 + call $~lib/array/Array#splice + local.tee $47 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 3072 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $52 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 388 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 3088 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $53 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 389 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $33 + call $~lib/rt/purerc/__release + local.get $37 + call $~lib/rt/purerc/__release + local.get $35 + call $~lib/rt/purerc/__release + local.get $30 + call $~lib/rt/purerc/__release + local.get $32 + call $~lib/rt/purerc/__release + local.get $31 + call $~lib/rt/purerc/__release + local.get $34 + call $~lib/rt/purerc/__release + local.get $29 + call $~lib/rt/purerc/__release + local.get $28 + call $~lib/rt/purerc/__release + local.get $24 + call $~lib/rt/purerc/__release + local.get $27 + call $~lib/rt/purerc/__release + local.get $25 + call $~lib/rt/purerc/__release + local.get $21 + call $~lib/rt/purerc/__release + local.get $23 + call $~lib/rt/purerc/__release + local.get $26 + call $~lib/rt/purerc/__release + local.get $18 + call $~lib/rt/purerc/__release + local.get $20 + call $~lib/rt/purerc/__release + local.get $19 + call $~lib/rt/purerc/__release + local.get $22 + call $~lib/rt/purerc/__release + local.get $17 + call $~lib/rt/purerc/__release + local.get $16 + call $~lib/rt/purerc/__release + local.get $12 + call $~lib/rt/purerc/__release + local.get $15 + call $~lib/rt/purerc/__release + local.get $13 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $11 + call $~lib/rt/purerc/__release + local.get $14 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $10 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $36 + call $~lib/rt/purerc/__release + local.get $38 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $40 + call $~lib/rt/purerc/__release + local.get $41 + call $~lib/rt/purerc/__release + local.get $42 + call $~lib/rt/purerc/__release + local.get $39 + call $~lib/rt/purerc/__release + local.get $44 + call $~lib/rt/purerc/__release + local.get $45 + call $~lib/rt/purerc/__release + local.get $46 + call $~lib/rt/purerc/__release + local.get $43 + call $~lib/rt/purerc/__release + local.get $48 + call $~lib/rt/purerc/__release + local.get $49 + call $~lib/rt/purerc/__release + local.get $50 + call $~lib/rt/purerc/__release + local.get $47 + call $~lib/rt/purerc/__release + local.get $52 + call $~lib/rt/purerc/__release + local.get $53 + call $~lib/rt/purerc/__release end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 27 - call $~lib/array/Array#filter - drop - global.get $std/array/i - i32.const 6 - i32.ne - if + block + global.get $std/array/arr i32.const 0 - i32.const 160 - i32.const 626 i32.const 0 - call $~lib/builtins/abort - unreachable + call $~lib/array/Array#__set + global.get $std/array/arr + i32.const 1 + i32.const 1 + call $~lib/array/Array#__set + global.get $std/array/arr + i32.const 2 + i32.const 2 + call $~lib/array/Array#__set + global.get $std/array/arr + i32.const 3 + i32.const 3 + call $~lib/array/Array#__set + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 402 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 405 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 408 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 4 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 416 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 417 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 5 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 419 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 6 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 432 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 433 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop end - global.get $std/array/arr - i32.load offset=12 - i32.const 8 - i32.ne - if + block + global.get $std/array/arr + i32.const 7 + call $~lib/array/Array#every + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 443 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 8 + call $~lib/array/Array#every + local.set $53 + local.get $53 i32.const 0 - i32.const 160 - i32.const 627 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 446 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 9 + call $~lib/array/Array#every + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 454 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 455 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 10 + call $~lib/array/Array#every + local.set $53 + local.get $53 i32.const 0 - call $~lib/builtins/abort - unreachable + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 457 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 11 + call $~lib/array/Array#every + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 470 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 471 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 28 - call $~lib/array/Array#filter - drop - global.get $std/array/i - i32.const 406 - i32.ne - if + block + global.get $std/array/arr + i32.const 12 + call $~lib/array/Array#some + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 481 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 13 + call $~lib/array/Array#some + local.set $53 + local.get $53 i32.const 0 - i32.const 160 - i32.const 634 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 484 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 14 + call $~lib/array/Array#some + local.set $53 + local.get $53 i32.const 0 - call $~lib/builtins/abort - unreachable + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 492 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 493 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 15 + call $~lib/array/Array#some + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 495 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 16 + call $~lib/array/Array#some + local.set $53 + local.get $53 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 508 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 509 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 29 - call $~lib/array/Array#filter - drop - global.get $std/array/i - i32.const 1 - i32.ne - if + block i32.const 0 - i32.const 160 - i32.const 649 + global.set $std/array/i + global.get $std/array/arr + i32.const 17 + call $~lib/array/Array#forEach + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 520 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - call $~lib/builtins/abort - unreachable + global.set $std/array/i + global.get $std/array/arr + i32.const 18 + call $~lib/array/Array#forEach + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 529 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 19 + call $~lib/array/Array#forEach + global.get $std/array/i + i32.const 406 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 533 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 20 + call $~lib/array/Array#forEach + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 547 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 548 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 21 + call $~lib/array/Array#forEach + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 573 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|0 + i32.const 0 + local.set $53 + loop $repeat|0 + local.get $53 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|0 + global.get $std/array/arr + call $~lib/array/Array#pop + drop + local.get $53 + i32.const 1 + i32.add + local.set $53 + br $repeat|0 + unreachable + end + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop end - global.get $std/array/arr - i32.load offset=12 - i32.const 2 - i32.ne - if + block + global.get $std/array/arr + i32.const 22 + call $~lib/array/Array#map + local.set $53 + local.get $53 + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 587 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $53 i32.const 0 - i32.const 160 - i32.const 650 + call $~lib/array/Array#__get + global.get $std/array/arr i32.const 0 - call $~lib/builtins/abort - unreachable + call $~lib/array/Array#__get + f32.convert_i32_s + f32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 588 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 23 + call $~lib/array/Array#map + call $~lib/rt/purerc/__release + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 597 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 598 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 24 + call $~lib/array/Array#map + call $~lib/rt/purerc/__release + global.get $std/array/i + i32.const 406 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 605 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 25 + call $~lib/array/Array#map + call $~lib/rt/purerc/__release + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 620 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 621 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + local.get $53 + call $~lib/rt/purerc/__release end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 30 - i32.const 0 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.ne - if + block + global.get $std/array/arr + i32.const 26 + call $~lib/array/Array#filter + local.set $53 + local.get $53 + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 631 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - i32.const 160 - i32.const 658 + global.set $std/array/i + global.get $std/array/arr + i32.const 27 + call $~lib/array/Array#filter + call $~lib/rt/purerc/__release + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 640 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 641 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - call $~lib/builtins/abort - unreachable + global.set $std/array/i + global.get $std/array/arr + i32.const 28 + call $~lib/array/Array#filter + call $~lib/rt/purerc/__release + global.get $std/array/i + i32.const 406 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 648 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 29 + call $~lib/array/Array#filter + call $~lib/rt/purerc/__release + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 663 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 664 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + local.get $53 + call $~lib/rt/purerc/__release end - global.get $std/array/arr - i32.const 31 - i32.const 4 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 10 - i32.ne - if + block + global.get $std/array/arr + i32.const 30 i32.const 0 - i32.const 160 - i32.const 662 + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 674 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 31 + i32.const 4 + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 678 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 32 i32.const 0 - call $~lib/builtins/abort - unreachable + call $~lib/array/Array#reduce + local.set $53 + local.get $53 + i32.const 0 + i32.ne + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 681 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 33 + i32.const 0 + call $~lib/array/Array#reduce + local.set $53 + local.get $53 + i32.const 0 + i32.ne + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 684 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 34 + i32.const 0 + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 692 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 693 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 35 + i32.const 0 + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 695 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 36 + i32.const 0 + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 708 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 709 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop end - global.get $std/array/arr - i32.const 32 - i32.const 0 - call $~lib/array/Array#reduce - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal - i32.const 1 - i32.ne - if + block + global.get $std/array/arr + i32.const 37 i32.const 0 - i32.const 160 - i32.const 665 + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 719 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 38 + i32.const 4 + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 723 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 39 i32.const 0 - call $~lib/builtins/abort - unreachable + call $~lib/array/Array#reduceRight + local.set $53 + local.get $53 + i32.const 0 + i32.ne + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 726 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 40 + i32.const 0 + call $~lib/array/Array#reduceRight + local.set $53 + local.get $53 + i32.const 0 + i32.ne + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 729 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 41 + i32.const 0 + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 737 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 738 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 42 + i32.const 0 + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 740 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 43 + i32.const 0 + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 753 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 754 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop end - global.get $std/array/arr - i32.const 33 - i32.const 0 - call $~lib/array/Array#reduce - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal - if - i32.const 0 - i32.const 160 - i32.const 668 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 34 - i32.const 0 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 676 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 8 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 677 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 35 - i32.const 0 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 10 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 679 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 36 - i32.const 0 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 692 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 2 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 693 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 37 - i32.const 0 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 701 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 38 - i32.const 4 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 10 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 705 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 39 - i32.const 0 - call $~lib/array/Array#reduceRight - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 708 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 40 - i32.const 0 - call $~lib/array/Array#reduceRight - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal - if - i32.const 0 - i32.const 160 - i32.const 711 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 41 - i32.const 0 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 719 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - i32.const 8 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 720 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 42 - i32.const 0 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 10 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 722 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 43 - i32.const 0 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.ne - if - i32.const 0 - i32.const 160 - i32.const 735 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.load offset=12 - if - i32.const 0 - i32.const 160 - i32.const 736 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push call $~lib/bindings/Math/random i64.reinterpret_f64 call $~lib/math/NativeMath.seedRandom - i32.const 0 - global.set $~lib/argc - global.get $std/array/f32ArrayTyped - local.set $1 - i32.const 0 - local.set $0 - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - br_table $0of1 $1of1 $outOfRange - end + block + i32.const 8 + i32.const 2 + i32.const 22 + i32.const 3360 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $52 + call $~lib/rt/purerc/__retain + local.set $53 + i32.const 0 + global.set $~lib/argc + local.get $53 + i32.const 0 + call $~lib/array/Array#sort|trampoline + call $~lib/rt/purerc/__release + local.get $53 + i32.const 8 + i32.const 2 + i32.const 22 + i32.const 3408 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $50 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 843 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 44 - local.set $0 - end - local.get $1 - local.get $0 - call $~lib/array/Array#sort - global.get $std/array/f32ArrayTyped - i32.const 8 - i32.const 2 - i32.const 22 - i32.const 3312 - call $~lib/util/runtime/makeArray - call $std/array/isArraysEqual - i32.eqz - if + i32.const 8 + i32.const 3 + i32.const 23 + i32.const 3456 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $49 + call $~lib/rt/purerc/__retain + local.set $47 i32.const 0 - i32.const 160 - i32.const 824 + global.set $~lib/argc + local.get $47 i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - global.set $~lib/argc - global.get $std/array/f64ArrayTyped - local.set $1 - i32.const 0 - local.set $0 - block $1of143 - block $0of144 - block $outOfRange45 - global.get $~lib/argc - br_table $0of144 $1of143 $outOfRange45 - end + call $~lib/array/Array#sort|trampoline + call $~lib/rt/purerc/__release + local.get $47 + i32.const 8 + i32.const 3 + i32.const 23 + i32.const 3536 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $43 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 847 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 45 - local.set $0 - end - local.get $1 - local.get $0 - call $~lib/array/Array#sort - global.get $std/array/f64ArrayTyped - i32.const 8 - i32.const 3 - i32.const 23 - i32.const 3472 - call $~lib/util/runtime/makeArray - call $std/array/isArraysEqual - i32.eqz - if + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 3616 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $46 + call $~lib/rt/purerc/__retain + local.set $48 i32.const 0 - i32.const 160 - i32.const 828 + global.set $~lib/argc + local.get $48 i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - global.set $~lib/argc - global.get $std/array/i32ArrayTyped - local.set $1 - i32.const 0 - local.set $0 - block $1of146 - block $0of147 - block $outOfRange48 - global.get $~lib/argc - br_table $0of147 $1of146 $outOfRange48 - end + call $~lib/array/Array#sort|trampoline + call $~lib/rt/purerc/__release + local.get $48 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 3656 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $44 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 851 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 46 - local.set $0 - end - local.get $1 - local.get $0 - call $~lib/array/Array#sort - drop - global.get $std/array/i32ArrayTyped - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 3624 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 3696 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $39 + call $~lib/rt/purerc/__retain + local.set $45 i32.const 0 - i32.const 160 - i32.const 832 + global.set $~lib/argc + local.get $45 i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - global.set $~lib/argc - global.get $std/array/u32ArrayTyped - local.set $1 - i32.const 0 - local.set $0 - block $1of149 - block $0of150 - block $outOfRange51 - global.get $~lib/argc - br_table $0of150 $1of149 $outOfRange51 - end + call $~lib/array/Array#sort|trampoline + call $~lib/rt/purerc/__release + local.get $45 + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 3736 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $41 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 855 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 47 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 3776 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $40 + call $~lib/rt/purerc/__retain + local.set $42 + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 3792 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $38 + call $~lib/rt/purerc/__retain + local.set $3 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 3816 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $1 + call $~lib/rt/purerc/__retain + local.set $36 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 3840 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $4 + call $~lib/rt/purerc/__retain local.set $0 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 3872 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $7 + call $~lib/rt/purerc/__retain + local.set $2 + i32.const 64 + call $std/array/createReverseOrderedArray + local.set $10 + i32.const 128 + call $std/array/createReverseOrderedArray + local.set $5 + i32.const 1024 + call $std/array/createReverseOrderedArray + local.set $8 + i32.const 10000 + call $std/array/createReverseOrderedArray + local.set $6 + i32.const 512 + call $std/array/createRandomOrderedArray + local.set $14 + local.get $42 + call $std/array/assertSortedDefault + local.get $3 + call $std/array/assertSortedDefault + local.get $3 + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 3960 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $9 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 875 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $36 + call $std/array/assertSortedDefault + local.get $36 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 3984 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $13 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 878 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $std/array/assertSortedDefault + local.get $0 + local.get $2 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 881 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $10 + call $std/array/assertSortedDefault + local.get $10 + local.get $2 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 884 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $5 + call $std/array/assertSortedDefault + local.get $5 + local.get $2 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 887 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $8 + call $std/array/assertSortedDefault + local.get $8 + local.get $2 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 890 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $6 + call $std/array/assertSortedDefault + local.get $6 + local.get $2 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 893 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $14 + call $std/array/assertSortedDefault + local.get $52 + call $~lib/rt/purerc/__release + local.get $53 + call $~lib/rt/purerc/__release + local.get $50 + call $~lib/rt/purerc/__release + local.get $49 + call $~lib/rt/purerc/__release + local.get $47 + call $~lib/rt/purerc/__release + local.get $43 + call $~lib/rt/purerc/__release + local.get $46 + call $~lib/rt/purerc/__release + local.get $48 + call $~lib/rt/purerc/__release + local.get $44 + call $~lib/rt/purerc/__release + local.get $39 + call $~lib/rt/purerc/__release + local.get $45 + call $~lib/rt/purerc/__release + local.get $41 + call $~lib/rt/purerc/__release + local.get $40 + call $~lib/rt/purerc/__release + local.get $42 + call $~lib/rt/purerc/__release + local.get $38 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $36 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $10 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $14 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $13 + call $~lib/rt/purerc/__release end - local.get $1 - local.get $0 - call $~lib/array/Array#sort - drop - global.get $std/array/u32ArrayTyped - i32.const 5 - i32.const 2 - i32.const 21 - i32.const 3736 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 836 - i32.const 0 - call $~lib/builtins/abort - unreachable + block + i32.const 64 + call $std/array/createRandomOrderedArray + local.set $13 + i32.const 257 + call $std/array/createRandomOrderedArray + local.set $9 + local.get $13 + i32.const 49 + call $std/array/assertSorted + local.get $13 + i32.const 50 + call $std/array/assertSorted + local.get $9 + i32.const 51 + call $std/array/assertSorted + local.get $9 + i32.const 52 + call $std/array/assertSorted + local.get $13 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release end - i32.const 64 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed64 - i32.const 128 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed128 - i32.const 1024 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed1024 - i32.const 10000 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed10000 - i32.const 512 - call $std/array/createRandomOrderedArray - global.set $std/array/randomized512 - global.get $std/array/reversed0 - call $std/array/assertSortedDefault - global.get $std/array/reversed1 - call $std/array/assertSortedDefault - global.get $std/array/reversed1 - i32.const 1 - i32.const 2 - i32.const 17 - i32.const 4064 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 856 - i32.const 0 - call $~lib/builtins/abort - unreachable + block + i32.const 2 + call $std/array/createReverseOrderedNestedArray + local.set $9 + local.get $9 + i32.const 53 + call $std/array/assertSorted<~lib/array/Array> + local.get $9 + call $~lib/rt/purerc/__release end - global.get $std/array/reversed2 - call $std/array/assertSortedDefault - global.get $std/array/reversed2 - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 4088 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 859 - i32.const 0 - call $~lib/builtins/abort - unreachable + block + i32.const 512 + call $std/array/createReverseOrderedElementsArray + local.set $9 + local.get $9 + i32.const 54 + call $std/array/assertSorted> + local.get $9 + call $~lib/rt/purerc/__release end - global.get $std/array/reversed4 - call $std/array/assertSortedDefault - global.get $std/array/reversed4 - global.get $std/array/expected4 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + block + i32.const 7 + i32.const 2 + i32.const 27 + i32.const 4288 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $13 + call $~lib/rt/purerc/__retain + local.set $9 + i32.const 7 + i32.const 2 + i32.const 27 + i32.const 4336 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $6 + call $~lib/rt/purerc/__retain + local.set $14 + i32.const 1 + global.set $~lib/argc + local.get $9 i32.const 0 - i32.const 160 - i32.const 862 + call $std/array/assertSorted<~lib/string/String | null>|trampoline + local.get $9 + local.get $14 i32.const 0 - call $~lib/builtins/abort - unreachable + call $std/array/isArraysEqual<~lib/string/String | null> + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 930 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 400 + call $std/array/createRandomStringArray + local.set $8 + i32.const 1 + global.set $~lib/argc + local.get $8 + i32.const 0 + call $std/array/assertSorted<~lib/string/String>|trampoline + local.get $13 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $14 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release end - global.get $std/array/reversed64 - call $std/array/assertSortedDefault - global.get $std/array/reversed64 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual - i32.eqz - if + block + i32.const 2 i32.const 0 - i32.const 160 - i32.const 865 - i32.const 0 - call $~lib/builtins/abort - unreachable + i32.const 29 + i32.const 4456 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $14 + i32.const 4536 + call $~lib/array/Array#join + local.tee $8 + i32.const 4560 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 941 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 2 + i32.const 17 + i32.const 4600 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $9 + i32.const 4272 + call $~lib/array/Array#join + local.tee $6 + i32.const 5104 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 942 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 2 + i32.const 21 + i32.const 5136 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $5 + i32.const 5168 + call $~lib/array/Array#join + local.tee $13 + i32.const 5104 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 943 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 5192 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $2 + i32.const 5216 + call $~lib/array/Array#join + local.tee $10 + i32.const 5240 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 944 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 6 + i32.const 3 + i32.const 23 + i32.const 5304 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $0 + i32.const 5368 + call $~lib/array/Array#join + local.tee $7 + i32.const 6568 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 945 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 2 + i32.const 28 + i32.const 6688 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $36 + i32.const 4272 + call $~lib/array/Array<~lib/string/String>#join + local.tee $4 + i32.const 6664 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 946 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 3 + i32.const 2 + i32.const 33 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $1 + local.get $1 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 0 + call $std/array/Ref#constructor + local.tee $38 + call $~lib/rt/purerc/__retain + i32.store + local.get $3 + i32.const 0 + call $~lib/rt/purerc/__retain + i32.store offset=4 + local.get $3 + i32.const 0 + call $std/array/Ref#constructor + local.tee $42 + call $~lib/rt/purerc/__retain + i32.store offset=8 + local.get $1 + end + call $~lib/rt/purerc/__retain + local.set $3 + local.get $3 + i32.const 4536 + call $~lib/array/Array#join + local.tee $1 + i32.const 6768 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 948 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $14 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $13 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $10 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $36 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $38 + call $~lib/rt/purerc/__release + local.get $42 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release end - global.get $std/array/reversed128 - call $std/array/assertSortedDefault - global.get $std/array/reversed128 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual - i32.eqz - if + block i32.const 0 - i32.const 160 - i32.const 868 + i32.const 2 + i32.const 17 + i32.const 6848 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $1 + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 6864 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $38 + call $~lib/rt/purerc/__retain + local.set $42 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 6888 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $36 + call $~lib/rt/purerc/__retain + local.set $4 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 6912 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $0 + call $~lib/rt/purerc/__retain + local.set $7 + local.get $1 + call $~lib/array/Array#toString + local.tee $10 + i32.const 4272 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 958 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $42 + call $~lib/array/Array#toString + local.tee $2 + i32.const 6664 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 959 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $4 + call $~lib/array/Array#toString + local.tee $13 + i32.const 6944 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 960 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 + call $~lib/array/Array#toString + local.tee $5 + i32.const 6968 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 961 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed1024 - call $std/array/assertSortedDefault - global.get $std/array/reversed1024 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 871 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed10000 - call $std/array/assertSortedDefault - global.get $std/array/reversed10000 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 874 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/randomized512 - call $std/array/assertSortedDefault - i32.const 64 - call $std/array/createRandomOrderedArray - global.set $std/array/randomized64 - i32.const 257 - call $std/array/createRandomOrderedArray - global.set $std/array/randomized257 - global.get $std/array/randomized64 - i32.const 49 - call $std/array/assertSorted - global.get $std/array/randomized64 - i32.const 50 - call $std/array/assertSorted - global.get $std/array/randomized257 - i32.const 51 - call $std/array/assertSorted - global.get $std/array/randomized257 - i32.const 52 - call $std/array/assertSorted - call $std/array/createReverseOrderedNestedArray - global.set $std/array/reversedNested512 - global.get $std/array/reversedNested512 - i32.const 53 - call $std/array/assertSorted<~lib/array/Array> - call $std/array/createReverseOrderedElementsArray - global.set $std/array/reversedElements512 - global.get $std/array/reversedElements512 - i32.const 54 - call $std/array/assertSorted<~lib/array/Array> - i32.const 1 - global.set $~lib/argc - global.get $std/array/randomStringsActual - call $std/array/assertSorted<~lib/string/String | null>|trampoline - global.get $std/array/randomStringsActual - global.get $std/array/randomStringsExpected - call $std/array/isArraysEqual<~lib/string/String | null> - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 904 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - call $std/array/createRandomStringArray - global.set $std/array/randomStrings400 - i32.const 1 - global.set $~lib/argc - global.get $std/array/randomStrings400 - local.set $1 - i32.const 0 - local.set $0 - block $1of152 - block $0of153 - block $outOfRange54 - global.get $~lib/argc + i32.const 34 + i32.const 7000 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $9 + call $~lib/array/Array#toString + local.tee $6 + i32.const 7024 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 963 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 1 + i32.const 35 + i32.const 7056 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $14 + call $~lib/array/Array#toString + local.tee $8 + i32.const 7080 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 964 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 3 + i32.const 30 + i32.const 7120 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $41 + call $~lib/array/Array#toString + local.tee $40 + i32.const 7160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 965 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 3 + i32.const 36 + i32.const 7224 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $39 + call $~lib/array/Array#toString + local.tee $45 + i32.const 7272 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 966 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 7 + i32.const 2 + i32.const 27 + i32.const 7376 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $48 + call $~lib/rt/purerc/__retain + local.set $44 + local.get $44 + call $~lib/array/Array<~lib/string/String | null>#toString + local.tee $46 + i32.const 7424 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 970 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 2 + i32.const 28 + i32.const 7520 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $47 + call $~lib/array/Array<~lib/string/String>#toString + local.tee $43 + i32.const 7552 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 971 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 2 + i32.const 2 + i32.const 24 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $49 + local.get $49 + i32.load offset=4 + local.set $50 + local.get $50 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 7584 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $52 + call $~lib/rt/purerc/__retain + i32.store + local.get $50 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 7608 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $11 + call $~lib/rt/purerc/__retain + i32.store offset=4 + local.get $49 + end + call $~lib/rt/purerc/__retain + local.set $54 + local.get $54 + call $~lib/array/Array<~lib/array/Array>#toString + local.tee $50 + i32.const 7632 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 974 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 2 + i32.const 2 + i32.const 37 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $49 + local.get $49 + i32.load offset=4 + local.set $53 + local.get $53 + i32.const 2 + i32.const 0 + i32.const 20 + i32.const 7664 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $12 + call $~lib/rt/purerc/__retain + i32.store + local.get $53 + i32.const 2 + i32.const 0 + i32.const 20 + i32.const 7688 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $16 + call $~lib/rt/purerc/__retain + i32.store offset=4 + local.get $49 + end + call $~lib/rt/purerc/__retain + local.set $55 + local.get $55 + call $~lib/array/Array<~lib/array/Array>#toString + local.tee $53 + i32.const 7632 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 977 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 1 + i32.const 2 + i32.const 39 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $49 + local.get $49 + i32.load offset=4 + local.set $15 + local.get $15 + block (result i32) i32.const 1 - i32.sub - br_table $0of153 $1of152 $outOfRange54 + i32.const 2 + i32.const 38 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $17 + local.get $17 + i32.load offset=4 + local.set $22 + local.get $22 + i32.const 1 + i32.const 2 + i32.const 21 + i32.const 7712 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $20 + call $~lib/rt/purerc/__retain + i32.store + local.get $17 end + call $~lib/rt/purerc/__retain + i32.store + local.get $49 + end + call $~lib/rt/purerc/__retain + local.set $56 + local.get $56 + call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString + local.tee $15 + i32.const 6664 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 980 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 56 - local.set $0 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $38 + call $~lib/rt/purerc/__release + local.get $42 + call $~lib/rt/purerc/__release + local.get $36 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $10 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $13 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $14 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $41 + call $~lib/rt/purerc/__release + local.get $40 + call $~lib/rt/purerc/__release + local.get $39 + call $~lib/rt/purerc/__release + local.get $45 + call $~lib/rt/purerc/__release + local.get $48 + call $~lib/rt/purerc/__release + local.get $44 + call $~lib/rt/purerc/__release + local.get $46 + call $~lib/rt/purerc/__release + local.get $47 + call $~lib/rt/purerc/__release + local.get $43 + call $~lib/rt/purerc/__release + local.get $52 + call $~lib/rt/purerc/__release + local.get $11 + call $~lib/rt/purerc/__release + local.get $50 + call $~lib/rt/purerc/__release + local.get $12 + call $~lib/rt/purerc/__release + local.get $16 + call $~lib/rt/purerc/__release + local.get $53 + call $~lib/rt/purerc/__release + local.get $20 + call $~lib/rt/purerc/__release + local.get $15 + call $~lib/rt/purerc/__release end - local.get $1 - local.get $0 - call $std/array/assertSorted<~lib/array/Array> - i32.const 2 i32.const 0 - i32.const 29 - i32.const 4560 - call $~lib/util/runtime/makeArray - call $~lib/array/Array#join_bool - i32.const 4584 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 913 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 3 - i32.const 2 - i32.const 17 - i32.const 5128 - call $~lib/util/runtime/makeArray - i32.const 4208 - call $~lib/array/Array#join - i32.const 5160 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 914 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 3 - i32.const 2 - i32.const 21 - i32.const 5248 - call $~lib/util/runtime/makeArray - i32.const 5224 - call $~lib/array/Array#join - i32.const 5160 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 915 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 5328 - call $~lib/util/runtime/makeArray - i32.const 5304 - call $~lib/array/Array#join - i32.const 5352 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 916 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 6 - i32.const 3 - i32.const 23 - i32.const 6680 - call $~lib/util/runtime/makeArray - call $~lib/array/Array#join_flt - i32.const 6744 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 917 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 3 - i32.const 2 - i32.const 28 - i32.const 6896 - call $~lib/util/runtime/makeArray - i32.const 4208 - call $~lib/array/Array<~lib/string/String>#join - i32.const 6840 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 918 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 3 - i32.const 2 - i32.const 33 - i32.const 0 - call $~lib/util/runtime/makeArray - local.tee $1 - i32.load offset=4 - local.tee $0 - call $std/array/Ref#constructor - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - call $std/array/Ref#constructor - i32.store offset=8 - local.get $1 - global.set $std/array/refArr - global.get $std/array/refArr - call $~lib/array/Array#join_ref - i32.const 6976 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 920 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed0 - call $~lib/array/Array#toString - i32.const 4208 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 924 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed1 - call $~lib/array/Array#toString - i32.const 6840 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 925 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed2 - call $~lib/array/Array#toString - i32.const 7056 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 926 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed4 - call $~lib/array/Array#toString - i32.const 7080 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 927 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 3 - i32.const 0 - i32.const 34 - i32.const 7136 - call $~lib/util/runtime/makeArray - call $~lib/array/Array#join_int - i32.const 7160 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 929 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 3 - i32.const 1 - i32.const 35 - i32.const 7216 - call $~lib/util/runtime/makeArray - call $~lib/array/Array#join_int - i32.const 7240 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 930 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 3 - i32.const 3 - i32.const 30 - i32.const 7320 - call $~lib/util/runtime/makeArray - call $~lib/array/Array#join_int - i32.const 7360 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 931 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 4 - i32.const 3 - i32.const 36 - i32.const 7472 - call $~lib/util/runtime/makeArray - call $~lib/array/Array#join_int - i32.const 7520 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 932 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/randomStringsExpected - call $~lib/array/Array<~lib/string/String | null>#toString - i32.const 7624 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 933 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 4 - i32.const 2 - i32.const 28 - i32.const 7752 - call $~lib/util/runtime/makeArray - call $~lib/array/Array<~lib/string/String | null>#toString - i32.const 7784 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 934 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 2 - i32.const 2 - i32.const 24 - i32.const 0 - call $~lib/util/runtime/makeArray - local.tee $0 - i32.load offset=4 - local.tee $1 - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 7840 - call $~lib/util/runtime/makeArray - i32.store - local.get $1 - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 7864 - call $~lib/util/runtime/makeArray - i32.store offset=4 - local.get $0 - global.set $std/array/subarr32 - global.get $std/array/subarr32 - call $~lib/array/Array<~lib/array/Array>#join_arr - i32.const 7888 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 937 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 2 - i32.const 2 - i32.const 37 - i32.const 0 - call $~lib/util/runtime/makeArray - local.tee $0 - i32.load offset=4 - local.tee $1 - i32.const 2 - i32.const 0 - i32.const 20 - i32.const 7944 - call $~lib/util/runtime/makeArray - i32.store - local.get $1 - i32.const 2 - i32.const 0 - i32.const 20 - i32.const 7968 - call $~lib/util/runtime/makeArray - i32.store offset=4 - local.get $0 - global.set $std/array/subarr8 - global.get $std/array/subarr8 - call $~lib/array/Array<~lib/array/Array>#join_arr - i32.const 7888 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 940 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1 - i32.const 2 - i32.const 39 - i32.const 0 - call $~lib/util/runtime/makeArray - local.tee $0 - i32.load offset=4 - local.set $1 - i32.const 1 - i32.const 2 - i32.const 38 - i32.const 0 - call $~lib/util/runtime/makeArray - local.tee $2 - i32.load offset=4 - i32.const 1 - i32.const 2 - i32.const 21 - i32.const 8064 - call $~lib/util/runtime/makeArray - i32.store - local.get $1 - local.get $2 - i32.store - local.get $0 - global.set $std/array/subarrU32 - global.get $std/array/subarrU32 - call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join_arr - i32.const 6840 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 943 - i32.const 0 - call $~lib/builtins/abort - unreachable - end + global.get $std/array/arr + call $~lib/rt/purerc/__retainRelease + global.set $std/array/arr + local.get $54 + call $~lib/rt/purerc/__release + local.get $55 + call $~lib/rt/purerc/__release + local.get $56 + call $~lib/rt/purerc/__release ) - (func $std/array/main (; 164 ;) (type $FUNCSIG$v) + (func $std/array/main (; 298 ;) (type $FUNCSIG$v) global.get $~lib/started i32.eqz if - call $start:std/array - i32.const 0 - call $~lib/util/runtime/allocate - i32.const 40 - call $~lib/util/runtime/register - global.set $~lib/runtime/ROOT + call $start i32.const 1 global.set $~lib/started end ) - (func $~lib/runtime/runtime.instanceof (; 165 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/purerc/__release (; 299 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/purerc/markGray (; 300 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 301 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 302 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 303 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__collect (; 304 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + local.get $0 + local.set $1 + block $break|0 + block + local.get $1 + local.set $2 + global.get $~lib/rt/purerc/CUR + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $2 + i32.load + local.set $4 + local.get $4 + i32.load offset=4 + local.set $5 + local.get $5 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/purerc/markGray + local.get $1 + local.get $4 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else + local.get $5 + i32.const 1879048192 + i32.and + i32.const 0 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $5 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + end + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + global.set $~lib/rt/purerc/CUR + block $break|1 + local.get $0 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $5 + i32.load + call $~lib/rt/purerc/scan + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + block $break|2 + local.get $0 + local.set $5 + loop $repeat|2 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $5 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + local.get $4 + call $~lib/rt/purerc/collectWhite + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/common/__instanceof (; 305 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) local.get $0 i32.const 16 i32.sub - i32.load - local.tee $0 + i32.load offset=8 + local.set $2 + global.get $~lib/builtins/RTTI_BASE + local.set $3 + local.get $2 if (result i32) - local.get $0 - i32.const 8072 + local.get $2 + local.get $3 i32.load i32.le_u else @@ -13451,157 +21904,905 @@ end if loop $continue|0 - local.get $0 + local.get $2 local.get $1 i32.eq if i32.const 1 return end - local.get $0 - i32.const 3 - i32.shl - i32.const 8072 + local.get $3 + local.get $2 + i32.const 8 + i32.mul i32.add i32.load offset=4 - local.tee $0 + local.tee $2 br_if $continue|0 end end i32.const 0 ) - (func $~lib/runtime/runtime.flags (; 166 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - if (result i32) - local.get $0 - i32.const 8072 - i32.load - i32.gt_u - else - i32.const 1 - end - if (result i32) - unreachable - else - local.get $0 - i32.const 3 - i32.shl - i32.const 8072 - i32.add - i32.load - end + (func $start (; 306 ;) (type $FUNCSIG$v) + call $start:std/array ) - (func $~lib/runtime/runtime.newObject (; 167 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - call $~lib/util/runtime/allocate - local.get $1 - call $~lib/util/runtime/register + (func $~lib/array/Array#__visit_impl (; 307 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop ) - (func $~lib/runtime/runtime.newString (; 168 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#__visit_impl (; 308 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 309 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 310 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 311 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/rt/purerc/__visit (; 312 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end local.get $0 - i32.const 1 - i32.shl i32.const 16 - call $~lib/runtime/runtime.newObject + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 320 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 320 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 320 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end ) - (func $~lib/runtime/runtime.newArrayBuffer (; 169 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 15 - call $~lib/runtime/runtime.newObject - ) - (func $~lib/runtime/runtime.newArray (; 170 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 313 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 - local.tee $2 - if (result i32) - local.get $2 - i32.const 8072 - i32.load - i32.gt_u - else - i32.const 1 - end - if (result i32) - unreachable - else - local.get $2 - i32.const 3 - i32.shl - i32.const 8072 - i32.add - i32.load - end - local.tee $0 - i32.const 16 - i32.div_u - i32.const 31 - i32.and - local.set $4 - local.get $1 - if (result i32) - local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - else - i32.const 0 - call $~lib/runtime/runtime.newArrayBuffer - local.set $1 - i32.const 0 - end - local.set $3 + i32.load offset=4 + local.set $2 local.get $2 - i32.const 16 - call $~lib/runtime/runtime.newObject - local.tee $2 - i32.load - drop - local.get $2 - local.get $1 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - local.get $3 - i32.store offset=8 - local.get $2 - local.get $3 - local.get $4 - i32.shr_u - i32.store offset=12 local.get $0 - i32.const 1024 - i32.and - if - local.get $1 - local.get $3 - i32.add - local.set $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 loop $continue|0 - local.get $1 - local.get $0 + local.get $2 + local.get $3 i32.lt_u if - local.get $1 + local.get $2 i32.load - drop - local.get $1 + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 i32.const 4 i32.add - local.set $1 + local.set $2 br $continue|0 end end end + ) + (func $~lib/array/Array>#__visit_impl (; 314 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end ) - (func $~lib/runtime/runtime.retain (; 171 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/array/Array<~lib/string/String | null>#__visit_impl (; 315 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 316 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/array/Array#__visit_impl (; 317 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/runtime/runtime.collect (; 172 ;) (type $FUNCSIG$v) + (func $~lib/array/Array#__visit_impl (; 318 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) + (func $~lib/array/Array#__visit_impl (; 319 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 320 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/array/Array#__visit_impl (; 321 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 322 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 323 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 324 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 325 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#__visit_impl (; 326 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/builtins/__visit_members (; 327 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $block$16$break + block + end + block $switch$1$leave + block $switch$1$case$41 + block $switch$1$case$40 + block $switch$1$case$39 + block $switch$1$case$38 + block $switch$1$case$37 + block $switch$1$case$36 + block $switch$1$case$35 + block $switch$1$case$33 + block $switch$1$case$32 + block $switch$1$case$31 + block $switch$1$case$30 + block $switch$1$case$29 + block $switch$1$case$28 + block $switch$1$case$26 + block $switch$1$case$25 + block $switch$1$case$24 + block $switch$1$case$23 + block $switch$1$case$22 + block $switch$1$case$19 + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$19 $switch$1$case$3 $switch$1$case$16 $switch$1$case$22 $switch$1$case$23 $switch$1$case$24 $switch$1$case$25 $switch$1$case$26 $switch$1$case$3 $switch$1$case$28 $switch$1$case$29 $switch$1$case$30 $switch$1$case$31 $switch$1$case$32 $switch$1$case$33 $switch$1$case$3 $switch$1$case$35 $switch$1$case$36 $switch$1$case$37 $switch$1$case$38 $switch$1$case$39 $switch$1$case$40 $switch$1$case$41 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + br $block$16$break + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String | null>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + end + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + ) + (func $null (; 328 ;) (type $FUNCSIG$v) + ) ) diff --git a/tests/compiler/std/array.ts b/tests/compiler/std/array.ts index 0a6fce0a..bfdc7c31 100644 --- a/tests/compiler/std/array.ts +++ b/tests/compiler/std/array.ts @@ -1,4 +1,3 @@ -import "collector/dummy"; import { Array } from "array"; import { COMPARATOR } from "util/sort"; @@ -33,712 +32,732 @@ var arr = new Array(); // Array.isArray /////////////////////////////////////////////////////////////////////////////////// class P {} -var num = 1; -var Null: i32[] | null = null; -var str = "abc"; -assert(Array.isArray(Null) == false); -assert(Array.isArray(arr) == true); -assert(Array.isArray(new P()) == false); -assert(Array.isArray(new Uint8Array(1)) == false); -assert(Array.isArray(num) == false); -assert(Array.isArray(str) == false); + +{ + assert(Array.isArray(null) == false); + assert(Array.isArray(arr) == true); + assert(Array.isArray(new P()) == false); + assert(Array.isArray(new Uint8Array(1)) == false); + assert(Array.isArray(1) == false); + assert(Array.isArray("abc") == false); +} // Array#fill ////////////////////////////////////////////////////////////////////////////////////// +{ + let arr8: u8[] = [1, 2, 3, 4, 5]; -var arr8: u8[] = [1, 2, 3, 4, 5]; + arr8.fill(1, 1, 3); + assert(isArraysEqual(arr8, [1, 1, 1, 4, 5])); -arr8.fill(1, 1, 3); -assert(isArraysEqual(arr8, [1, 1, 1, 4, 5])); + arr8.fill(0); + assert(isArraysEqual(arr8, [0, 0, 0, 0, 0])); -arr8.fill(0); -assert(isArraysEqual(arr8, [0, 0, 0, 0, 0])); + arr8.fill(1, 0, -3); + assert(isArraysEqual(arr8, [1, 1, 0, 0, 0])); -arr8.fill(1, 0, -3); -assert(isArraysEqual(arr8, [1, 1, 0, 0, 0])); + arr8.fill(2, -2); + assert(isArraysEqual(arr8, [1, 1, 0, 2, 2])); -arr8.fill(2, -2); -assert(isArraysEqual(arr8, [1, 1, 0, 2, 2])); + arr8.fill(0, 1, 0); + assert(isArraysEqual(arr8, [1, 1, 0, 2, 2])); +} -arr8.fill(0, 1, 0); -assert(isArraysEqual(arr8, [1, 1, 0, 2, 2])); +{ + let arr32: u32[] = [1, 2, 3, 4, 5]; -var arr32: u32[] = [1, 2, 3, 4, 5]; + arr32.fill(1, 1, 3); + assert(isArraysEqual(arr32, [1, 1, 1, 4, 5])); -arr32.fill(1, 1, 3); -assert(isArraysEqual(arr32, [1, 1, 1, 4, 5])); + arr32.fill(0); + assert(isArraysEqual(arr32, [0, 0, 0, 0, 0])); -arr32.fill(0); -assert(isArraysEqual(arr32, [0, 0, 0, 0, 0])); + arr32.fill(1, 0, -3); + assert(isArraysEqual(arr32, [1, 1, 0, 0, 0])); -arr32.fill(1, 0, -3); -assert(isArraysEqual(arr32, [1, 1, 0, 0, 0])); + arr32.fill(2, -2); + assert(isArraysEqual(arr32, [1, 1, 0, 2, 2])); -arr32.fill(2, -2); -assert(isArraysEqual(arr32, [1, 1, 0, 2, 2])); - -arr32.fill(0, 1, 0); -assert(isArraysEqual(arr32, [1, 1, 0, 2, 2])); + arr32.fill(0, 1, 0); + assert(isArraysEqual(arr32, [1, 1, 0, 2, 2])); +} // Array#push/pop ////////////////////////////////////////////////////////////////////////////////// -assert(arr.length == 0); -assert(internalCapacity(arr) == 0); +{ + assert(arr.length == 0); + assert(internalCapacity(arr) == 0); -arr.push(42); + arr.push(42); -assert(arr[0] == 42); -assert(arr.length == 1); -assert(internalCapacity(arr) == 1); + assert(arr[0] == 42); + assert(arr.length == 1); + assert(internalCapacity(arr) == 1); -var i = arr.pop(); + let i = arr.pop(); -assert(i == 42); -assert(arr.length == 0); -assert(internalCapacity(arr) == 1); + assert(i == 42); + assert(arr.length == 0); + assert(internalCapacity(arr) == 1); -arr.push(43); + arr.push(43); -assert(arr.length == 1); -assert(internalCapacity(arr) == 1); -assert(arr[0] == 43); + assert(arr.length == 1); + assert(internalCapacity(arr) == 1); + assert(arr[0] == 43); -arr.push(44); + arr.push(44); -assert(arr.length == 2); -assert(internalCapacity(arr) == 2); -assert(arr[0] == 43); -assert(arr[1] == 44); + assert(arr.length == 2); + assert(internalCapacity(arr) == 2); + assert(arr[0] == 43); + assert(arr[1] == 44); -arr.push(45); + arr.push(45); -assert(arr.length == 3); -assert(internalCapacity(arr) == 3); -assert(arr[0] == 43); -assert(arr[1] == 44); -assert(arr[2] == 45); + assert(arr.length == 3); + assert(internalCapacity(arr) == 3); + assert(arr[0] == 43); + assert(arr[1] == 44); + assert(arr[2] == 45); +} // Array#concat /////////////////////////////////////////////////////////////////////////////////// -var other = new Array(); +{ + let other = new Array(); -var out = arr.concat(other); -assert(internalCapacity(arr) == 3); -assert(arr.length == 3); -assert(out.length == 3); + let out = arr.concat(other); + assert(internalCapacity(arr) == 3); + assert(arr.length == 3); + assert(out.length == 3); -out.concat([]); -assert(internalCapacity(arr) == 3); + out.concat([]); + assert(internalCapacity(arr) == 3); -assert(out[0] == 43); -assert(out[1] == 44); -assert(out[2] == 45); + assert(out[0] == 43); + assert(out[1] == 44); + assert(out[2] == 45); -other.push(46); -other.push(47); + other.push(46); + other.push(47); -out = arr.concat(other); + out = arr.concat(other); -assert(internalCapacity(arr) == 3); -assert(other.length == 2); -assert(out.length == 5); -assert(out[0] == 43); -assert(out[1] == 44); -assert(out[2] == 45); -assert(out[3] == 46); -assert(out[4] == 47); + assert(internalCapacity(arr) == 3); + assert(other.length == 2); + assert(out.length == 5); + assert(out[0] == 43); + assert(out[1] == 44); + assert(out[2] == 45); + assert(out[3] == 46); + assert(out[4] == 47); -out.pop(); -assert(out.length == 4); + out.pop(); + assert(out.length == 4); -out = arr.concat(null); -assert(out.length == 3); -assert(out[2] == 45); + out = arr.concat(null); + assert(out.length == 3); + assert(out[2] == 45); -var source: i32[] = []; -assert(source.length == 0); -out = source.concat(arr); -assert(out.length == 3); -assert(source.length == 0); + let source: i32[] = []; + assert(source.length == 0); + out = source.concat(arr); + assert(out.length == 3); + assert(source.length == 0); +} // Array#copyWithin //////////////////////////////////////////////////////////////////////////////// -var cwArr: i32[]; -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(0, 3), [4, 5, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(1, 3), [1, 4, 5, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(1, 2), [1, 3, 4, 5, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(2, 2), [1, 2, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(0, 3, 4), [4, 2, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(1, 3, 4), [1, 4, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(1, 2, 4), [1, 3, 4, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(0, -2), [4, 5, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(0, -2, -1), [4, 2, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(-4, -3, -2), [1, 3, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(-4, -3, -1), [1, 3, 4, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(-4, -3), [1, 3, 4, 5, 5])); +{ + let cwArr: i32[]; + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(0, 3), [4, 5, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(1, 3), [1, 4, 5, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(1, 2), [1, 3, 4, 5, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(2, 2), [1, 2, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(0, 3, 4), [4, 2, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(1, 3, 4), [1, 4, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(1, 2, 4), [1, 3, 4, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(0, -2), [4, 5, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(0, -2, -1), [4, 2, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(-4, -3, -2), [1, 3, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(-4, -3, -1), [1, 3, 4, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(-4, -3), [1, 3, 4, 5, 5])); +} // Array#unshift /////////////////////////////////////////////////////////////////////////////////// -arr.unshift(42); +{ + arr.unshift(42); -assert(arr.length == 4); -assert(internalCapacity(arr) == 4); -assert(arr[0] == 42); -assert(arr[1] == 43); -assert(arr[2] == 44); -assert(arr[3] == 45); + assert(arr.length == 4); + assert(internalCapacity(arr) == 4); + assert(arr[0] == 42); + assert(arr[1] == 43); + assert(arr[2] == 44); + assert(arr[3] == 45); -arr.unshift(41); + arr.unshift(41); -assert(arr.length == 5); -assert(internalCapacity(arr) == 5); -assert(arr[0] == 41); -assert(arr[1] == 42); -assert(arr[2] == 43); -assert(arr[3] == 44); -assert(arr[4] == 45); + assert(arr.length == 5); + assert(internalCapacity(arr) == 5); + assert(arr[0] == 41); + assert(arr[1] == 42); + assert(arr[2] == 43); + assert(arr[3] == 44); + assert(arr[4] == 45); +} // Array#shift ///////////////////////////////////////////////////////////////////////////////////// -i = arr.shift(); +var i: i32; +{ + i = arr.shift(); -assert(i == 41); -assert(arr.length == 4); -assert(internalCapacity(arr) == 5); -assert(arr[0] == 42); -assert(arr[1] == 43); -assert(arr[2] == 44); -assert(arr[3] == 45); + assert(i == 41); + assert(arr.length == 4); + assert(internalCapacity(arr) == 5); + assert(arr[0] == 42); + assert(arr[1] == 43); + assert(arr[2] == 44); + assert(arr[3] == 45); -i = arr.pop(); + i = arr.pop(); -assert(i == 45); -assert(arr.length == 3); -assert(internalCapacity(arr) == 5); -assert(arr[0] == 42); -assert(arr[1] == 43); -assert(arr[2] == 44); + assert(i == 45); + assert(arr.length == 3); + assert(internalCapacity(arr) == 5); + assert(arr[0] == 42); + assert(arr[1] == 43); + assert(arr[2] == 44); +} // Array#reverse /////////////////////////////////////////////////////////////////////////////////// -arr.reverse(); +{ + arr.reverse(); -assert(arr.length == 3); -assert(internalCapacity(arr) == 5); -assert(arr[0] == 44); -assert(arr[1] == 43); -assert(arr[2] == 42); + assert(arr.length == 3); + assert(internalCapacity(arr) == 5); + assert(arr[0] == 44); + assert(arr[1] == 43); + assert(arr[2] == 42); -arr.push(43); -arr.push(44); + arr.push(43); + arr.push(44); +} // Array#indexOf /////////////////////////////////////////////////////////////////////////////////// -i = arr.indexOf(44); +{ + i = arr.indexOf(44); + assert(i == 0); -assert(i == 0); + i = arr.indexOf(42); + assert(i == 2); -i = arr.indexOf(42); + i = arr.indexOf(45); + assert(i == - 1); -assert(i == 2); + i = arr.indexOf(43, 100); + assert(i == - 1); -i = arr.indexOf(45); + i = arr.indexOf(43, -100); + assert(i == 1); -assert(i == - 1); + i = arr.indexOf(43, -2); + assert(i == 3); -i = arr.indexOf(43, 100); + i = arr.indexOf(43, -4); + assert(i == 1); -assert(i == - 1); + i = arr.indexOf(43, 0); + assert(i == 1); -i = arr.indexOf(43, -100); + i = arr.indexOf(43, 1); + assert(i == 1); -assert(i == 1); - -i = arr.indexOf(43, -2); - -assert(i == 3); - -i = arr.indexOf(43, -4); - -assert(i == 1); - -i = arr.indexOf(43, 0); - -assert(i == 1); - -i = arr.indexOf(43, 1); - -assert(i == 1); - -i = arr.indexOf(43, 2); - -assert(i == 3); + i = arr.indexOf(43, 2); + assert(i == 3); +} // Array#includes ////////////////////////////////////////////////////////////////////////////////// -var includes = arr.includes(44); +{ + let includes = arr.includes(44); + assert(includes == true); -assert(includes == true); + includes = arr.includes(42); + assert(includes == true); -includes = arr.includes(42); + includes = arr.includes(45); + assert(includes == false); -assert(includes == true); + includes = arr.includes(43, 100); + assert(includes == false); -includes = arr.includes(45); + includes = arr.includes(43, -100); + assert(includes == true); -assert(includes == false); + includes = arr.includes(43, -2); + assert(includes == true); -includes = arr.includes(43, 100); + includes = arr.includes(43, -4); + assert(includes == true); -assert(includes == false); + includes = arr.includes(43, 0); + assert(includes == true); -includes = arr.includes(43, -100); + includes = arr.includes(43, 1); + assert(includes == true); -assert(includes == true); + includes = arr.includes(43, 2); + assert(includes == true); -includes = arr.includes(43, -2); + arr.splice(1, 1); -assert(includes == true); - -includes = arr.includes(43, -4); - -assert(includes == true); - -includes = arr.includes(43, 0); - -assert(includes == true); - -includes = arr.includes(43, 1); - -assert(includes == true); - -includes = arr.includes(43, 2); - -assert(includes == true); - -arr.splice(1, 1); - -assert(arr.length == 4); -assert(internalCapacity(arr) == 5); -assert(arr[0] == 44); -assert(arr[1] == 42); + assert(arr.length == 4); + assert(internalCapacity(arr) == 5); + assert(arr[0] == 44); + assert(arr[1] == 42); +} // Array#splice //////////////////////////////////////////////////////////////////////////////////// -var sarr: i32[] = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(0), [1, 2, 3, 4, 5])); -assert(isArraysEqual(sarr, [])); +{ + let sarr: i32[] = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(0), [1, 2, 3, 4, 5])); + assert(isArraysEqual(sarr, [])); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(2), [3, 4, 5])); -assert(isArraysEqual(sarr, [1, 2])); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(2), [3, 4, 5])); + assert(isArraysEqual(sarr, [1, 2])); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(2, 2), [3, 4])); -assert(isArraysEqual(sarr, [1, 2, 5])); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(2, 2), [3, 4])); + assert(isArraysEqual(sarr, [1, 2, 5])); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(0, 1), [1])); -assert(isArraysEqual(sarr, [2, 3, 4, 5])); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(0, 1), [1])); + assert(isArraysEqual(sarr, [2, 3, 4, 5])); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(-1), [5])); -assert(isArraysEqual(sarr, [1, 2, 3, 4])); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(-1), [5])); + assert(isArraysEqual(sarr, [1, 2, 3, 4])); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(-2), [4, 5])); -assert(isArraysEqual(sarr, [1, 2, 3])); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(-2), [4, 5])); + assert(isArraysEqual(sarr, [1, 2, 3])); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(-2, 1), [4])); -assert(isArraysEqual(sarr, [1, 2, 3, 5])); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(-2, 1), [4])); + assert(isArraysEqual(sarr, [1, 2, 3, 5])); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(-7, 1), [1])); -assert(isArraysEqual(sarr, [2, 3, 4, 5])); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(-7, 1), [1])); + assert(isArraysEqual(sarr, [2, 3, 4, 5])); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(-2, -1), [])); -assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(-2, -1), [])); + assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(1, -2), [])); -assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(1, -2), [])); + assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(4, 0), [])); -assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(4, 0), [])); + assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(7, 0), [])); -assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(7, 0), [])); + assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(7, 5), [])); -assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(7, 5), [])); + assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); +} // Array#findIndex ///////////////////////////////////////////////////////////////////////////////// -arr[0] = 0; -arr[1] = 1; -arr[2] = 2; -arr[3] = 3; +{ + arr[0] = 0; + arr[1] = 1; + arr[2] = 2; + arr[3] = 3; -i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 0); -assert(i == 0); + i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 0); -i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 1); -assert(i == 1); + assert(i == 0); -i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 100); -assert(i == -1); + i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 1); + assert(i == 1); -// Test side effect push -i = arr.findIndex((value: i32, index: i32, array: Array): bool => { - array.push(100); // push side effect should not affect this method by spec - return value == 100; -}); -// array should be changed, but this method result should be calculated for old array length -assert(i == -1); -assert(arr.length == 8); -i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 100); -assert(i != -1); + i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 100); + assert(i == -1); -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); + // Test side effect push + i = arr.findIndex((value: i32, index: i32, array: Array): bool => { + array.push(100); // push side effect should not affect this method by spec + return value == 100; + }); + // array should be changed, but this method result should be calculated for old array length + assert(i == -1); + assert(arr.length == 8); + i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 100); + assert(i != -1); -// Test side effect pop -i = arr.findIndex((value: i32, index: i32, array: Array): bool => { - array.pop(); // poped items shouldn't be looked up, and we shouldn't go out of bounds - return value == 100; -}); -// only 2 first items was looked up, since last 2 was removed by .pop() -assert(i == -1); -assert(arr.length == 2); + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); -arr.push(2); -arr.push(3); + // Test side effect pop + i = arr.findIndex((value: i32, index: i32, array: Array): bool => { + array.pop(); // popped items shouldn't be looked up, and we shouldn't go out of bounds + return value == 100; + }); + // only 2 first items was looked up, since last 2 was removed by .pop() + assert(i == -1); + assert(arr.length == 2); + + arr.push(2); + arr.push(3); +} // Array#every ///////////////////////////////////////////////////////////////////////////////////// -var every = arr.every((value: i32, index: i32, array: Array): bool => value >= 0); -assert(every == true); +{ + let every = arr.every((value: i32, index: i32, array: Array): bool => value >= 0); + assert(every == true); -every = arr.every((value: i32, index: i32, array: Array): bool => value <= 0); -assert(every == false); + every = arr.every((value: i32, index: i32, array: Array): bool => value <= 0); + assert(every == false); -// Test side effect push -every = arr.every((value: i32, index: i32, array: Array): bool => { - array.push(100); // push side effect should not affect this method by spec - return value < 10; -}); -// array should be changed, but this method result should be calculated for old array length -assert(every == true); -assert(arr.length == 8); -every = arr.every((value: i32, index: i32, array: Array): bool => value < 10); -assert(every == false); + // Test side effect push + every = arr.every((value: i32, index: i32, array: Array): bool => { + array.push(100); // push side effect should not affect this method by spec + return value < 10; + }); + // array should be changed, but this method result should be calculated for old array length + assert(every == true); + assert(arr.length == 8); + every = arr.every((value: i32, index: i32, array: Array): bool => value < 10); + assert(every == false); -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); -// Test side effect pop -every = arr.every((value: i32, index: i32, array: Array): bool => { - array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds - return value < 3; -}); -// only 2 first items was looked up, since last 2 was removed by .pop() -assert(every == true); -assert(arr.length == 2); + // Test side effect pop + every = arr.every((value: i32, index: i32, array: Array): bool => { + array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds + return value < 3; + }); + // only 2 first items was looked up, since last 2 was removed by .pop() + assert(every == true); + assert(arr.length == 2); -arr.push(2); -arr.push(3); + arr.push(2); + arr.push(3); +} // Array#some ////////////////////////////////////////////////////////////////////////////////////// -var some = arr.some((value: i32, index: i32, array: Array): bool => value >= 3); -assert(some == true); +{ + let some = arr.some((value: i32, index: i32, array: Array): bool => value >= 3); + assert(some == true); -some = arr.some((value: i32, index: i32, array: Array): bool => value <= -1); -assert(some == false); + some = arr.some((value: i32, index: i32, array: Array): bool => value <= -1); + assert(some == false); -// Test side effect push -some = arr.some((value: i32, index: i32, array: Array): bool => { - array.push(100); // push side effect should not affect this method by spec - return value > 10; -}); -// array should be changed, but this method result should be calculated for old array length -assert(some == false); -assert(arr.length == 8); -some = arr.some((value: i32, index: i32, array: Array): bool => value > 10); -assert(some == true); + // Test side effect push + some = arr.some((value: i32, index: i32, array: Array): bool => { + array.push(100); // push side effect should not affect this method by spec + return value > 10; + }); + // array should be changed, but this method result should be calculated for old array length + assert(some == false); + assert(arr.length == 8); + some = arr.some((value: i32, index: i32, array: Array): bool => value > 10); + assert(some == true); -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); -// Test side effect pop -some = arr.some((value: i32, index: i32, array: Array): bool => { - array.pop(); // poped items shouldn't be looked up, and we shouldn't go out of bounds - return value > 3; -}); -// only 2 first items was looked up, since last 2 was removed by .pop() -assert(some == false); -assert(arr.length == 2); + // Test side effect pop + some = arr.some((value: i32, index: i32, array: Array): bool => { + array.pop(); // poped items shouldn't be looked up, and we shouldn't go out of bounds + return value > 3; + }); + // only 2 first items was looked up, since last 2 was removed by .pop() + assert(some == false); + assert(arr.length == 2); -arr.push(2); -arr.push(3); + arr.push(2); + arr.push(3); +} // Array#forEach /////////////////////////////////////////////////////////////////////////////////// -i = 0; -arr.forEach((value: i32, index: i32, array: Array): void => { i += value; }); -assert(i == 6); +{ + i = 0; + arr.forEach((value: i32, index: i32, array: Array): void => { i += value; }); + assert(i == 6); -// Test side effect push -i = 0; -arr.forEach((value: i32, index: i32, array: Array): void => { - array.push(100); //push side effect should not affect this method by spec - i += value; -}); -// array should be changed, but this method result should be calculated for old array length -assert(i == 6); -assert(arr.length == 8); -i = 0; -arr.forEach((value: i32, index: i32, array: Array): void => { i += value; }); -assert(i == 406); + // Test side effect push + i = 0; + arr.forEach((value: i32, index: i32, array: Array): void => { + array.push(100); //push side effect should not affect this method by spec + i += value; + }); + // array should be changed, but this method result should be calculated for old array length + assert(i == 6); + assert(arr.length == 8); + i = 0; + arr.forEach((value: i32, index: i32, array: Array): void => { i += value; }); + assert(i == 406); -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); - -// Test side effect pop -i = 0; -arr.forEach((value: i32, index: i32, array: Array): void => { - array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds - i += value; -}); -// only 2 first items was looked up, since last 2 was removed by .pop() -assert(i == 1); -assert(arr.length == 2); - -arr.push(2); -arr.push(3); - -// Test rehash action effec -arr.forEach((value: i32, index: i32, array: Array): void => { - if (index == 0) { - for (let i = 0; i < 4; i++) { - array.pop(); - } - for (let i = 0; i < 100; i++) { - array.push(100 + i); - } - for (let i = 0; i < 100; i++) { - array.pop(); - } - for (let i = 0; i < 100; i++) { - array.push(i + 200); - } - } - if (index == 2) { - assert(value == 202); - } -}); -assert(arr.length == 100) -for (let i = 0; i < 100; i++) { arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); + + // Test side effect pop + i = 0; + arr.forEach((value: i32, index: i32, array: Array): void => { + array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds + i += value; + }); + // only 2 first items was looked up, since last 2 was removed by .pop() + assert(i == 1); + assert(arr.length == 2); + + arr.push(2); + arr.push(3); + + // Test rehash action effec + arr.forEach((value: i32, index: i32, array: Array): void => { + if (index == 0) { + for (let i = 0; i < 4; i++) { + array.pop(); + } + for (let i = 0; i < 100; i++) { + array.push(100 + i); + } + for (let i = 0; i < 100; i++) { + array.pop(); + } + for (let i = 0; i < 100; i++) { + array.push(i + 200); + } + } + if (index == 2) { + assert(value == 202); + } + }); + assert(arr.length == 100); + for (let i = 0; i < 100; i++) { + arr.pop(); + } + arr.push(0); + arr.push(1); + arr.push(2); + arr.push(3); } -arr.push(0); -arr.push(1); -arr.push(2); -arr.push(3); + // Array#map /////////////////////////////////////////////////////////////////////////////////////// -var newArr: f32[] = arr.map((value: i32, index: i32, array: Array): f32 => value); -assert(newArr.length == 4); -assert(newArr[0] == arr[0]); +{ + let newArr: f32[] = arr.map((value: i32, index: i32, array: Array): f32 => value); + assert(newArr.length == 4); + assert(newArr[0] == arr[0]); -// Test side effect push -i = 0; -arr.map((value: i32, index: i32, array: Array): i32 => { - array.push(100); //push side effect should not affect this method by spec - i += value; - return value; -}); -assert(i == 6); -assert(arr.length == 8); + // Test side effect push + i = 0; + arr.map((value: i32, index: i32, array: Array): i32 => { + array.push(100); //push side effect should not affect this method by spec + i += value; + return value; + }); + assert(i == 6); + assert(arr.length == 8); -i = 0; -arr.map((value: i32, index: i32, array: Array): i32 => { - i += value; - return value; -}); -assert(i == 406); + i = 0; + arr.map((value: i32, index: i32, array: Array): i32 => { + i += value; + return value; + }); + assert(i == 406); -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); -// Test side effect pop -i = 0; -arr.map((value: i32, index: i32, array: Array): i32 => { - array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds - i += value; - return value; -}); -// only 2 first items was looked up, since last 2 was removed by .pop() -assert(i == 1); -assert(arr.length == 2); + // Test side effect pop + i = 0; + arr.map((value: i32, index: i32, array: Array): i32 => { + array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds + i += value; + return value; + }); + // only 2 first items was looked up, since last 2 was removed by .pop() + assert(i == 1); + assert(arr.length == 2); -arr.push(2); -arr.push(3); + arr.push(2); + arr.push(3); +} // Array#filter //////////////////////////////////////////////////////////////////////////////////// -var filteredArr: i32[] = arr.filter((value: i32, index: i32, array: Array): bool => value >= 2); -assert(filteredArr.length == 2); +{ + let filteredArr: i32[] = arr.filter((value: i32, index: i32, array: Array): bool => value >= 2); + assert(filteredArr.length == 2); -// Test side effect push -i = 0; -arr.filter((value: i32, index: i32, array: Array): bool => { - array.push(100); //push side effect should not affect this method by spec - i += value; - return value >= 2; -}); -assert(i == 6); -assert(arr.length == 8); + // Test side effect push + i = 0; + arr.filter((value: i32, index: i32, array: Array): bool => { + array.push(100); //push side effect should not affect this method by spec + i += value; + return value >= 2; + }); + assert(i == 6); + assert(arr.length == 8); -i = 0; -arr.filter((value: i32, index: i32, array: Array): bool => { - i += value; - return value >= 2; -}); -assert(i == 406); + i = 0; + arr.filter((value: i32, index: i32, array: Array): bool => { + i += value; + return value >= 2; + }); + assert(i == 406); -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); -// Test side effect pop -i = 0; -arr.filter((value: i32, index: i32, array: Array): bool => { - array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds - i += value; - return value >= 2; -}); -// only 2 first items was looked up, since last 2 was removed by .pop() -assert(i == 1); -assert(arr.length == 2); + // Test side effect pop + i = 0; + arr.filter((value: i32, index: i32, array: Array): bool => { + array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds + i += value; + return value >= 2; + }); + // only 2 first items was looked up, since last 2 was removed by .pop() + assert(i == 1); + assert(arr.length == 2); -arr.push(2); -arr.push(3); + arr.push(2); + arr.push(3); +} // Array#reduce //////////////////////////////////////////////////////////////////////////////////// -i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); -assert(i == 6); +{ + i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); + assert(i == 6); -// init value -i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 4); -assert(i == 10); + // init value + i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 4); + assert(i == 10); -var boolVal = arr.reduce(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 2), false); -assert(boolVal == true); + let boolVal = arr.reduce(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 2), false); + assert(boolVal == true); -boolVal = arr.reduce(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 100), false); -assert(boolVal == false); + boolVal = arr.reduce(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 100), false); + assert(boolVal == false); -// Test side effect push -i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => { - array.push(1); // push side effect should not affect this method by spec - return prev + current; -}), 0); -// array should be changed, but this method result should be calculated for old array length -assert(i == 6); -assert(arr.length == 8); -i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); -assert(i == 10); + // Test side effect push + i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => { + array.push(1); // push side effect should not affect this method by spec + return prev + current; + }), 0); + // array should be changed, but this method result should be calculated for old array length + assert(i == 6); + assert(arr.length == 8); + i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); + assert(i == 10); -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); -// Test side effect pop -i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => { - array.pop(); //poped items shouldn't be reduced, and we shouldn't go out of bounds - return prev + current; -}), 0); -// only 2 first items was reduced, since last 2 was removed by .pop() -assert(i == 1); -assert(arr.length == 2); + // Test side effect pop + i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => { + array.pop(); //poped items shouldn't be reduced, and we shouldn't go out of bounds + return prev + current; + }), 0); + // only 2 first items was reduced, since last 2 was removed by .pop() + assert(i == 1); + assert(arr.length == 2); -arr.push(2); -arr.push(3); + arr.push(2); + arr.push(3); +} // Array#reduceRight /////////////////////////////////////////////////////////////////////////////// -i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); -assert(i == 6); +{ + i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); + assert(i == 6); -// init value -i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 4); -assert(i == 10); + // init value + i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 4); + assert(i == 10); -boolVal = arr.reduceRight(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 2), false); -assert(boolVal == true); + let boolVal = arr.reduceRight(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 2), false); + assert(boolVal == true); -boolVal = arr.reduceRight(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 100), false); -assert(boolVal == false); + boolVal = arr.reduceRight(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 100), false); + assert(boolVal == false); -// Test side effect push -i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => { - array.push(1); // push side effect should not affect this method by spec - return prev + current; -}), 0); -// array should be changed, but this method result should be calculated for old array length -assert(i == 6); -assert(arr.length == 8); -i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); -assert(i == 10); + // Test side effect push + i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => { + array.push(1); // push side effect should not affect this method by spec + return prev + current; + }), 0); + // array should be changed, but this method result should be calculated for old array length + assert(i == 6); + assert(arr.length == 8); + i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); + assert(i == 10); -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); -// Test side effect pop -i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => { - array.pop(); // poped items should be reduced - return prev + current; -}), 0); + // Test side effect pop + i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => { + array.pop(); // poped items should be reduced + return prev + current; + }), 0); -assert(i == 6); -assert(arr.length == 0); + assert(i == 6); + assert(arr.length == 0); -arr.push(0); -arr.push(1); -arr.push(2); -arr.push(3); + arr.push(0); + arr.push(1); + arr.push(2); + arr.push(3); +} // Array#sort ////////////////////////////////////////////////////////////////////////////////////// @@ -763,7 +782,7 @@ NativeMath.seedRandom(reinterpret(JSMath.random())); function createRandomOrderedArray(size: i32): Array { var arr = Array.create(size); for (let i = 0; i < size; i++) { - arr[i] = (NativeMath.random() *size); + arr[i] = (NativeMath.random() * size); } return arr; } @@ -818,126 +837,149 @@ function assertSortedDefault(arr: Array): void { } // Tests for default comparator +{ + let f32ArrayTyped: f32[] = [1.0, NaN, -Infinity, 1.00000001, 0.0, -1.0, -2.0, +Infinity]; + f32ArrayTyped.sort(); + assert(isArraysEqual(f32ArrayTyped, [-Infinity, -2.0, -1.0, 0.0, 1.0, 1.00000001, Infinity, NaN])); -var f32ArrayTyped: f32[] = [1.0, NaN, -Infinity, 1.00000001, 0.0, -1.0, -2.0, +Infinity]; -f32ArrayTyped.sort(); -assert(isArraysEqual(f32ArrayTyped, [-Infinity, -2.0, -1.0, 0.0, 1.0, 1.00000001, Infinity, NaN])); + let f64ArrayTyped: f64[] = [1.0, NaN, -Infinity, 1.000000000000001, 0.0, -1.0, -2.0, +Infinity]; + f64ArrayTyped.sort(); + assert(isArraysEqual(f64ArrayTyped, [-Infinity, -2.0, -1.0, 0.0, 1.0, 1.000000000000001, Infinity, NaN])); -var f64ArrayTyped: f64[] = [1.0, NaN, -Infinity, 1.000000000000001, 0.0, -1.0, -2.0, +Infinity]; -f64ArrayTyped.sort(); -assert(isArraysEqual(f64ArrayTyped, [-Infinity, -2.0, -1.0, 0.0, 1.0, 1.000000000000001, Infinity, NaN])); + let i32ArrayTyped: i32[] = [1, -2, -1, 0, 2]; + i32ArrayTyped.sort(); + assert(isArraysEqual(i32ArrayTyped, [-2, -1, 0, 1, 2])); -var i32ArrayTyped: i32[] = [1, -2, -1, 0, 2]; -i32ArrayTyped.sort(); -assert(isArraysEqual(i32ArrayTyped, [-2, -1, 0, 1, 2])); + let u32ArrayTyped: u32[] = [1, 4294967295, 4294967294, 0, 2]; + u32ArrayTyped.sort(); + assert(isArraysEqual(u32ArrayTyped, [0, 1, 2, 4294967294, 4294967295])); -var u32ArrayTyped: u32[] = [1, 4294967295, 4294967294, 0, 2]; -u32ArrayTyped.sort(); -assert(isArraysEqual(u32ArrayTyped, [0, 1, 2, 4294967294, 4294967295])); + let reversed0: i32[] = []; + let reversed1: i32[] = [1]; + let reversed2: i32[] = [2, 1]; + let reversed4: i32[] = [3, 2, 1, 0]; + let expected4: i32[] = [0, 1, 2, 3]; -var reversed0: i32[] = []; -var reversed1: i32[] = [1]; -var reversed2: i32[] = [2, 1]; -var reversed4: i32[] = [3, 2, 1, 0]; -var expected4: i32[] = [0, 1, 2, 3]; + let reversed64 = createReverseOrderedArray(64); + let reversed128 = createReverseOrderedArray(128); + let reversed1024 = createReverseOrderedArray(1024); + let reversed10000 = createReverseOrderedArray(10000); -var reversed64 = createReverseOrderedArray(64); -var reversed128 = createReverseOrderedArray(128); -var reversed1024 = createReverseOrderedArray(1024); -var reversed10000 = createReverseOrderedArray(10000); + let randomized512 = createRandomOrderedArray(512); -var randomized512 = createRandomOrderedArray(512); + // Test sorting with with default comparator -// Test sorting with with default comparator + assertSortedDefault(reversed0); -assertSortedDefault(reversed0); + assertSortedDefault(reversed1); + assert(isArraysEqual(reversed1, [1])); -assertSortedDefault(reversed1); -assert(isArraysEqual(reversed1, [1])); + assertSortedDefault(reversed2); + assert(isArraysEqual(reversed2, [1, 2])); -assertSortedDefault(reversed2); -assert(isArraysEqual(reversed2, [1, 2])); + assertSortedDefault(reversed4); + assert(isArraysEqual(reversed4, expected4)); -assertSortedDefault(reversed4); -assert(isArraysEqual(reversed4, expected4)); + assertSortedDefault(reversed64); + assert(isArraysEqual(reversed64, expected4, 4)); -assertSortedDefault(reversed64); -assert(isArraysEqual(reversed64, expected4, 4)); + assertSortedDefault(reversed128); + assert(isArraysEqual(reversed128, expected4, 4)); -assertSortedDefault(reversed128); -assert(isArraysEqual(reversed128, expected4, 4)); + assertSortedDefault(reversed1024); + assert(isArraysEqual(reversed1024, expected4, 4)); -assertSortedDefault(reversed1024); -assert(isArraysEqual(reversed1024, expected4, 4)); + assertSortedDefault(reversed10000); + assert(isArraysEqual(reversed10000, expected4, 4)); -assertSortedDefault(reversed10000); -assert(isArraysEqual(reversed10000, expected4, 4)); - -assertSortedDefault(randomized512); + assertSortedDefault(randomized512); +} // Test sorting with custom comparator -var randomized64 = createRandomOrderedArray(64); -var randomized257 = createRandomOrderedArray(257); +{ + let randomized64 = createRandomOrderedArray(64); + let randomized257 = createRandomOrderedArray(257); -assertSorted(randomized64, (a: i32, b: i32): i32 => a - b); -assertSorted(randomized64, (a: i32, b: i32): i32 => b - a); + assertSorted(randomized64, (a: i32, b: i32): i32 => a - b); + assertSorted(randomized64, (a: i32, b: i32): i32 => b - a); -assertSorted(randomized257, (a: i32, b: i32): i32 => a - b); -assertSorted(randomized257, (a: i32, b: i32): i32 => b - a); + assertSorted(randomized257, (a: i32, b: i32): i32 => a - b); + assertSorted(randomized257, (a: i32, b: i32): i32 => b - a); +} // Test sorting complex objects - -var reversedNested512 = createReverseOrderedNestedArray(512); -assertSorted(reversedNested512, (a: i32[], b: i32[]): i32 => a[0] - b[0]); +{ + let reversedNested512 = createReverseOrderedNestedArray(2); + assertSorted(reversedNested512, (a: i32[], b: i32[]): i32 => a[0] - b[0]); +} // Test sorting reference elements -var reversedElements512 = createReverseOrderedElementsArray(512); -assertSorted>(reversedElements512, (a: Proxy, b: Proxy): i32 => a.x - b.x); +{ + let reversedElements512 = createReverseOrderedElementsArray(512); + assertSorted>(reversedElements512, (a: Proxy, b: Proxy): i32 => a.x - b.x); +} // Test sorting strings -var randomStringsActual: (string | null)[] = ["a", "b", "a", "ab", "ba", "", null]; -var randomStringsExpected: (string | null)[] = ["", "a", "a", "ab", "b", "ba", null]; +{ + let randomStringsActual: (string | null)[] = ["a", "b", "a", "ab", "ba", "", null]; + let randomStringsExpected: (string | null)[] = ["", "a", "a", "ab", "b", "ba", null]; -assertSorted(randomStringsActual); -assert(isArraysEqual(randomStringsActual, randomStringsExpected)); + assertSorted(randomStringsActual); + assert(isArraysEqual(randomStringsActual, randomStringsExpected)); -var randomStrings400 = createRandomStringArray(400); -assertSorted(randomStrings400); + let randomStrings400 = createRandomStringArray(400); + assertSorted(randomStrings400); +} // Array#join ////////////////////////////////////////////////////////////////////////////////////// class Ref { constructor() {} } -assert(([true, false]).join() == "true,false"); -assert(([1,-2,-3]).join("") == "1-2-3"); -assert(([1, 2, 3]).join("-") == "1-2-3"); -assert(([i32.MIN_VALUE, i32.MIN_VALUE]).join("__") == "-2147483648__-2147483648"); -assert(([0.0, 1.0, -2.0, NaN, -Infinity, Infinity]).join(", ") == "0.0, 1.0, -2.0, NaN, -Infinity, Infinity"); -assert((["", "1", null]).join("") == "1"); -var refArr: (Ref | null)[] = [new Ref(), null, new Ref()]; -assert(refArr.join() == "[object Object],,[object Object]"); +{ + assert(([true, false]).join() == "true,false"); + assert(([1,-2,-3]).join("") == "1-2-3"); + assert(([1, 2, 3]).join("-") == "1-2-3"); + assert(([i32.MIN_VALUE, i32.MIN_VALUE]).join("__") == "-2147483648__-2147483648"); + assert(([0.0, 1.0, -2.0, NaN, -Infinity, Infinity]).join(", ") == "0.0, 1.0, -2.0, NaN, -Infinity, Infinity"); + assert((["", "1", null]).join("") == "1"); + let refArr: (Ref | null)[] = [new Ref(), null, new Ref()]; + assert(refArr.join() == "[object Object],,[object Object]"); +} // Array#toString ////////////////////////////////////////////////////////////////////////////////// +{ + let arr0: i32[] = []; + let arr1: i32[] = [1]; + let arr2: i32[] = [1,2]; + let arr3: i32[] = [0,1,2,3]; -assert(reversed0.toString() == ""); -assert(reversed1.toString() == "1"); -assert(reversed2.toString() == "1,2"); -assert(reversed4.toString() == "0,1,2,3"); + assert(arr0.toString() == ""); + assert(arr1.toString() == "1"); + assert(arr2.toString() == "1,2"); + assert(arr3.toString() == "0,1,2,3"); -assert(([1, -1, 0]).toString() == "1,-1,0"); -assert(([1, 0xFFFF, 0]).toString() == "1,65535,0"); -assert(([1, 0xFFFFFFFFFFFFFFFF, 0]).toString() == "1,18446744073709551615,0"); -assert(([-1, -1234567890123456, 0, i64.MAX_VALUE]).toString() == "-1,-1234567890123456,0,9223372036854775807"); -assert(randomStringsExpected.toString() == ",a,a,ab,b,ba,"); -assert((["1", "2", null, "4"]).toString() == "1,2,,4"); + assert(([1, -1, 0]).toString() == "1,-1,0"); + assert(([1, 0xFFFF, 0]).toString() == "1,65535,0"); + assert(([1, 0xFFFFFFFFFFFFFFFF, 0]).toString() == "1,18446744073709551615,0"); + assert(([-1, -1234567890123456, 0, i64.MAX_VALUE]).toString() == "-1,-1234567890123456,0,9223372036854775807"); -var subarr32: i32[][] = [[1,2], [3,4]]; -assert(subarr32.toString() == "1,2,3,4"); + let arrStr: (string | null)[] = ["", "a", "a", "ab", "b", "ba", null] -var subarr8: u8[][] = [[1,2], [3,4]]; -assert(subarr8.toString() == "1,2,3,4"); + assert(arrStr.toString() == ",a,a,ab,b,ba,"); + assert((["1", "2", null, "4"]).toString() == "1,2,,4"); -var subarrU32: u32[][][] = [[[1]]]; -assert(subarrU32.toString() == "1"); + var subarr32: i32[][] = [[1,2], [3,4]]; + assert(subarr32.toString() == "1,2,3,4"); + + var subarr8: u8[][] = [[1,2], [3,4]]; + assert(subarr8.toString() == "1,2,3,4"); + + var subarrU32: u32[][][] = [[[1]]]; + assert(subarrU32.toString() == "1"); +} + +// Unleak globals that'd otherwise retain a reference + +arr = changetype(0); diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 153a667d..9cf78a70 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -2,11 +2,12 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$fiii (func (param i32 i32 i32) (result f32))) (type $FUNCSIG$fii (func (param i32 i32) (result f32))) (type $FUNCSIG$d (func (result f64))) @@ -25,258 +26,203 @@ (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$viji (func (param i32 i64 i32))) (type $FUNCSIG$iiij (func (param i32 i32 i64) (result i32))) - (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00&\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 64) "\10\00\00\00(\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00") - (data (i32.const 120) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00a\00b\00c\00") - (data (i32.const 144) "\10\00\00\00\18\00\00\00\00\00\00\00\00\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 184) "\0f\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00\01\02\03\04\05") - (data (i32.const 208) "\14\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\c8\00\00\00\c8\00\00\00\05\00\00\00\05\00\00\00") - (data (i32.const 240) "\0f\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00\01\01\01\04\05") - (data (i32.const 264) "\10\00\00\00\1a\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 312) "\0f\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 336) "\0f\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00\01\01\00\00\00") - (data (i32.const 360) "\0f\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00\01\01\00\02\02") - (data (i32.const 384) "\0f\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00\01\01\00\02\02") - (data (i32.const 408) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 448) "\15\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\a8\01\00\00\a8\01\00\00\14\00\00\00\05\00\00\00") - (data (i32.const 480) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 520) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 560) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 600) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02\00\00\00") - (data (i32.const 640) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02\00\00\00") - (data (i32.const 680) "\0f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 696) "\0f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 712) "\11\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\c8\02\00\00\c8\02\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 744) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 784) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\05\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 824) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 864) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00\05\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 904) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 944) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\05\00\00\00") - (data (i32.const 984) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1024) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1064) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1104) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1144) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1184) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1224) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1264) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1304) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1344) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\05\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1384) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1424) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1464) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1504) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1544) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1584) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1624) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1664) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\05\00\00\00") - (data (i32.const 1704) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1744) "\11\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\b8\06\00\00\b8\06\00\00\14\00\00\00\05\00\00\00") - (data (i32.const 1776) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1816) "\0f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 1832) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1872) "\0f\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1904) "\0f\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 1928) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 1968) "\0f\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\03\00\00\00\04\00\00\00") - (data (i32.const 1992) "\0f\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\05\00\00\00") - (data (i32.const 2024) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2064) "\0f\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00") - (data (i32.const 2088) "\0f\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2120) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2160) "\0f\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\05\00\00\00") - (data (i32.const 2184) "\0f\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00") - (data (i32.const 2216) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2256) "\0f\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2280) "\0f\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") - (data (i32.const 2312) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2352) "\0f\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00") - (data (i32.const 2376) "\0f\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\05\00\00\00") - (data (i32.const 2408) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2448) "\0f\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00") - (data (i32.const 2472) "\0f\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2504) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2544) "\0f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 2560) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2600) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2640) "\0f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 2656) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2696) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2736) "\0f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 2752) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2792) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2832) "\0f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 2848) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2888) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2928) "\0f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 2944) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2984) "\10\00\00\00\18\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00") - (data (i32.const 3024) "\10\00\00\00\ac\00\00\00\00\00\00\00\00\00\00\00A\00B\00C\00D\00E\00F\00G\00H\00I\00J\00K\00L\00M\00N\00O\00P\00Q\00R\00S\00T\00U\00V\00W\00X\00Y\00Z\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\000\001\002\003\004\005\006\007\008\009\00_\00-\00,\00.\00+\00/\00\\\00[\00]\00{\00}\00(\00)\00<\00>\00*\00&\00$\00%\00^\00@\00#\00!\00?\00") - (data (i32.const 3216) "\0f\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f") - (data (i32.const 3264) "\16\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\a0\0c\00\00\a0\0c\00\00 \00\00\00\08\00\00\00") - (data (i32.const 3296) "\0f\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f") - (data (i32.const 3344) "\0f\00\00\00@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f") - (data (i32.const 3424) "\17\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00 \0d\00\00 \0d\00\00@\00\00\00\08\00\00\00") - (data (i32.const 3456) "\0f\00\00\00@\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f") - (data (i32.const 3536) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02\00\00\00") - (data (i32.const 3576) "\11\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\e0\0d\00\00\e0\0d\00\00\14\00\00\00\05\00\00\00") - (data (i32.const 3608) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 3648) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02\00\00\00") - (data (i32.const 3688) "\15\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00P\0e\00\00P\0e\00\00\14\00\00\00\05\00\00\00") - (data (i32.const 3720) "\0f\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff") - (data (i32.const 3760) "\0f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3776) "\11\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\c0\0e\00\00\c0\0e\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3808) "\0f\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00") - (data (i32.const 3832) "\11\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\f0\0e\00\00\f0\0e\00\00\04\00\00\00\01\00\00\00") - (data (i32.const 3864) "\0f\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\01\00\00\00") - (data (i32.const 3888) "\11\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00(\0f\00\00(\0f\00\00\08\00\00\00\02\00\00\00") - (data (i32.const 3920) "\0f\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\03\00\00\00\02\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 3952) "\11\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00`\0f\00\00`\0f\00\00\10\00\00\00\04\00\00\00") - (data (i32.const 3984) "\0f\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") - (data (i32.const 4016) "\11\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\a0\0f\00\00\a0\0f\00\00\10\00\00\00\04\00\00\00") - (data (i32.const 4048) "\0f\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00") - (data (i32.const 4072) "\0f\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 4096) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00a\00") - (data (i32.const 4120) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00b\00") - (data (i32.const 4144) "\10\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00a\00b\00") - (data (i32.const 4168) "\10\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00b\00a\00") - (data (i32.const 4192) "\10\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4208) "\0f\00\00\00\1c\00\00\00\00\00\00\00\00\00\00\00\10\10\00\00(\10\00\00\10\10\00\00@\10\00\00X\10\00\00p\10\00\00\00\00\00\00") - (data (i32.const 4256) "\1b\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\80\10\00\00\80\10\00\00\1c\00\00\00\07\00\00\00") - (data (i32.const 4288) "\0f\00\00\00\1c\00\00\00\00\00\00\00\00\00\00\00p\10\00\00\10\10\00\00\10\10\00\00@\10\00\00(\10\00\00X\10\00\00\00\00\00\00") - (data (i32.const 4336) "\1b\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\d0\10\00\00\d0\10\00\00\1c\00\00\00\07\00\00\00") - (data (i32.const 4368) "\10\00\00\00\1c\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 4416) "\10\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00n\00u\00l\00l\00") - (data (i32.const 4440) "\0f\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\01\00") - (data (i32.const 4464) "\10\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00t\00r\00u\00e\00") - (data (i32.const 4488) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00f\00a\00l\00s\00e\00") - (data (i32.const 4520) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00,\00") - (data (i32.const 4544) "\0f\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\01\00") - (data (i32.const 4568) "\10\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e\00") - (data (i32.const 4608) "\0f\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") - (data (i32.const 4640) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\000\00") - (data (i32.const 4664) "\0f\00\00\00\90\01\00\00\00\00\00\00\00\00\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00") - (data (i32.const 5080) "\15\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00H\12\00\00H\12\00\00\90\01\00\00d\00\00\00") - (data (i32.const 5112) "\0f\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") - (data (i32.const 5144) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\001\00-\002\00-\003\00") - (data (i32.const 5176) "\0f\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") - (data (i32.const 5208) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00-\00") - (data (i32.const 5232) "\0f\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") - (data (i32.const 5264) "\0f\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\00\00\00\80\00\00\00\80") - (data (i32.const 5288) "\10\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00_\00_\00") - (data (i32.const 5312) "\0f\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\00\00\00\80\00\00\00\80") - (data (i32.const 5336) "\10\00\00\000\00\00\00\00\00\00\00\00\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008\00") - (data (i32.const 5400) "\0f\00\00\000\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") - (data (i32.const 5464) "\10\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00,\00 \00") - (data (i32.const 5488) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\000\00.\000\00") - (data (i32.const 5512) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00N\00a\00N\00") - (data (i32.const 5536) "\10\00\00\00\12\00\00\00\00\00\00\00\00\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 5576) "\10\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 5608) "\0f\00\00\00\b8\02\00\00\00\00\00\00\00\00\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\00*\00&\00$\00%\00^\00@\00#\00!\00?\00") + (data (i32.const 3344) " \00\00\00\01\00\00\00\0f\00\00\00 \00\00\00\00\00\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f") + (data (i32.const 3392) " \00\00\00\01\00\00\00\0f\00\00\00 \00\00\00\00\00\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f") + (data (i32.const 3440) "@\00\00\00\01\00\00\00\0f\00\00\00@\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f") + (data (i32.const 3520) "@\00\00\00\01\00\00\00\0f\00\00\00@\00\00\00\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f") + (data (i32.const 3600) "\14\00\00\00\01\00\00\00\0f\00\00\00\14\00\00\00\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02\00\00\00") + (data (i32.const 3640) "\14\00\00\00\01\00\00\00\0f\00\00\00\14\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 3680) "\14\00\00\00\01\00\00\00\0f\00\00\00\14\00\00\00\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02\00\00\00") + (data (i32.const 3720) "\14\00\00\00\01\00\00\00\0f\00\00\00\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff") + (data (i32.const 3760) "\00\00\00\00\01\00\00\00\0f\00\00\00\00\00\00\00") + (data (i32.const 3776) "\04\00\00\00\01\00\00\00\0f\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 3800) "\08\00\00\00\01\00\00\00\0f\00\00\00\08\00\00\00\02\00\00\00\01\00\00\00") + (data (i32.const 3824) "\10\00\00\00\01\00\00\00\0f\00\00\00\10\00\00\00\03\00\00\00\02\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 3856) "\10\00\00\00\01\00\00\00\0f\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") + (data (i32.const 3888) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00P\00R\00N\00G\00 \00m\00u\00s\00t\00 \00b\00e\00 \00s\00e\00e\00d\00e\00d\00.\00") + (data (i32.const 3944) "\04\00\00\00\01\00\00\00\0f\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 3968) "\08\00\00\00\01\00\00\00\0f\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 3992) "^\00\00\00\01\00\00\00\10\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00") + (data (i32.const 4104) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 4160) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00a\00") + (data (i32.const 4184) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00b\00") + (data (i32.const 4208) "\04\00\00\00\01\00\00\00\10\00\00\00\04\00\00\00a\00b\00") + (data (i32.const 4232) "\04\00\00\00\01\00\00\00\10\00\00\00\04\00\00\00b\00a\00") + (data (i32.const 4256) "\00\00\00\00\01\00\00\00\10\00\00\00\00\00\00\00") + (data (i32.const 4272) "\1c\00\00\00\01\00\00\00\0f\00\00\00\1c\00\00\00P\10\00\00h\10\00\00P\10\00\00\80\10\00\00\98\10\00\00\b0\10\00\00\00\00\00\00") + (data (i32.const 4320) "\1c\00\00\00\01\00\00\00\0f\00\00\00\1c\00\00\00\b0\10\00\00P\10\00\00P\10\00\00\80\10\00\00h\10\00\00\98\10\00\00\00\00\00\00") + (data (i32.const 4368) "\1c\00\00\00\01\00\00\00\10\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") + (data (i32.const 4416) "\08\00\00\00\01\00\00\00\10\00\00\00\08\00\00\00n\00u\00l\00l\00") + (data (i32.const 4440) "\02\00\00\00\01\00\00\00\0f\00\00\00\02\00\00\00\01\00") + (data (i32.const 4464) "\08\00\00\00\01\00\00\00\10\00\00\00\08\00\00\00t\00r\00u\00e\00") + (data (i32.const 4488) "\n\00\00\00\01\00\00\00\10\00\00\00\n\00\00\00f\00a\00l\00s\00e\00") + (data (i32.const 4520) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00,\00") + (data (i32.const 4544) "\14\00\00\00\01\00\00\00\10\00\00\00\14\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e\00") + (data (i32.const 4584) "\0c\00\00\00\01\00\00\00\0f\00\00\00\0c\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") + (data (i32.const 4616) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\000\00") + (data (i32.const 4640) "\90\01\00\00\01\00\00\00\0f\00\00\00\90\01\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00") + (data (i32.const 5056) "\10\00\00\00\01\00\00\00\15\00\00\00\10\00\00\000\12\00\000\12\00\00\90\01\00\00d\00\00\00") + (data (i32.const 5088) "\n\00\00\00\01\00\00\00\10\00\00\00\n\00\00\001\00-\002\00-\003\00") + (data (i32.const 5120) "\0c\00\00\00\01\00\00\00\0f\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") + (data (i32.const 5152) "\02\00\00\00\01\00\00\00\10\00\00\00\02\00\00\00-\00") + (data (i32.const 5176) "\08\00\00\00\01\00\00\00\0f\00\00\00\08\00\00\00\00\00\00\80\00\00\00\80") + (data (i32.const 5200) "\04\00\00\00\01\00\00\00\10\00\00\00\04\00\00\00_\00_\00") + (data (i32.const 5224) "0\00\00\00\01\00\00\00\10\00\00\000\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008\00") + (data (i32.const 5288) "0\00\00\00\01\00\00\00\0f\00\00\000\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") + (data (i32.const 5352) "\04\00\00\00\01\00\00\00\10\00\00\00\04\00\00\00,\00 \00") + (data (i32.const 5376) "\06\00\00\00\01\00\00\00\10\00\00\00\06\00\00\000\00.\000\00") + (data (i32.const 5400) "\06\00\00\00\01\00\00\00\10\00\00\00\06\00\00\00N\00a\00N\00") + (data (i32.const 5424) "\12\00\00\00\01\00\00\00\10\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") + (data (i32.const 5464) "\10\00\00\00\01\00\00\00\10\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") + (data (i32.const 5496) "\b8\02\00\00\01\00\00\00\0f\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|1 $start:std/array~anonymous|43 $start:std/array~anonymous|44 $start:std/array~anonymous|45 $start:std/array~anonymous|46 $start:std/array~anonymous|47 $start:std/array~anonymous|48 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0) - (global $~lib/util/runtime/HEADER_SIZE i32 (i32.const 16)) - (global $~lib/util/runtime/MAX_BYTELENGTH i32 (i32.const 1073741808)) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/util/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) - (global $~lib/ASC_NO_ASSERT i32 (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $std/array/arr (mut i32) (i32.const 0)) - (global $std/array/num (mut i32) (i32.const 1)) - (global $std/array/Null (mut i32) (i32.const 0)) - (global $std/array/str (mut i32) (i32.const 136)) - (global $std/array/arr8 (mut i32) (i32.const 224)) (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) - (global $std/array/arr32 (mut i32) (i32.const 464)) (global $std/array/i (mut i32) (i32.const 0)) - (global $std/array/other (mut i32) (i32.const 0)) - (global $std/array/out (mut i32) (i32.const 0)) - (global $std/array/source (mut i32) (i32.const 728)) - (global $std/array/cwArr (mut i32) (i32.const 0)) - (global $std/array/includes (mut i32) (i32.const 0)) - (global $std/array/sarr (mut i32) (i32.const 1760)) (global $~lib/argc (mut i32) (i32.const 0)) - (global $std/array/every (mut i32) (i32.const 0)) - (global $std/array/some (mut i32) (i32.const 0)) - (global $std/array/newArr (mut i32) (i32.const 0)) - (global $std/array/filteredArr (mut i32) (i32.const 0)) - (global $std/array/boolVal (mut i32) (i32.const 0)) (global $~lib/math/random_seeded (mut i32) (i32.const 0)) (global $~lib/math/random_state0_64 (mut i64) (i64.const 0)) (global $~lib/math/random_state1_64 (mut i64) (i64.const 0)) (global $~lib/math/random_state0_32 (mut i32) (i32.const 0)) (global $~lib/math/random_state1_32 (mut i32) (i32.const 0)) - (global $std/array/charset i32 (i32.const 3040)) - (global $std/array/f32ArrayTyped (mut i32) (i32.const 3280)) - (global $std/array/f64ArrayTyped (mut i32) (i32.const 3440)) - (global $std/array/i32ArrayTyped (mut i32) (i32.const 3592)) - (global $std/array/u32ArrayTyped (mut i32) (i32.const 3704)) - (global $std/array/reversed0 (mut i32) (i32.const 3792)) - (global $std/array/reversed1 (mut i32) (i32.const 3848)) - (global $std/array/reversed2 (mut i32) (i32.const 3904)) - (global $std/array/reversed4 (mut i32) (i32.const 3968)) - (global $std/array/expected4 (mut i32) (i32.const 4032)) - (global $std/array/reversed64 (mut i32) (i32.const 0)) - (global $std/array/reversed128 (mut i32) (i32.const 0)) - (global $std/array/reversed1024 (mut i32) (i32.const 0)) - (global $std/array/reversed10000 (mut i32) (i32.const 0)) - (global $std/array/randomized512 (mut i32) (i32.const 0)) - (global $std/array/randomized64 (mut i32) (i32.const 0)) - (global $std/array/randomized257 (mut i32) (i32.const 0)) - (global $std/array/reversedNested512 (mut i32) (i32.const 0)) - (global $std/array/reversedElements512 (mut i32) (i32.const 0)) - (global $std/array/randomStringsActual (mut i32) (i32.const 4272)) - (global $std/array/randomStringsExpected (mut i32) (i32.const 4352)) - (global $std/array/randomStrings400 (mut i32) (i32.const 0)) + (global $std/array/charset i32 (i32.const 3168)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/builtins/i32.MIN_VALUE i32 (i32.const -2147483648)) (global $~lib/util/number/_frc_plus (mut i64) (i64.const 0)) @@ -285,506 +231,1395 @@ (global $~lib/util/number/_K (mut i32) (i32.const 0)) (global $~lib/util/number/_frc_pow (mut i64) (i64.const 0)) (global $~lib/util/number/_exp_pow (mut i32) (i32.const 0)) - (global $std/array/refArr (mut i32) (i32.const 0)) (global $~lib/builtins/u32.MAX_VALUE i32 (i32.const -1)) (global $~lib/builtins/i64.MAX_VALUE i64 (i64.const 9223372036854775807)) - (global $std/array/subarr32 (mut i32) (i32.const 0)) - (global $std/array/subarr8 (mut i32) (i32.const 0)) - (global $std/array/subarrU32 (mut i32) (i32.const 0)) (global $~lib/started (mut i32) (i32.const 0)) - (global $~lib/runtime/ROOT (mut i32) (i32.const 0)) - (global $~lib/runtime/RTTI_BASE i32 (i32.const 8072)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8400)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 7720)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 8040)) (export "memory" (memory $0)) (export "main" (func $std/array/main)) - (export "$.instanceof" (func $~lib/runtime/runtime.instanceof)) - (export "$.flags" (func $~lib/runtime/runtime.flags)) - (export "$.newObject" (func $~lib/runtime/runtime.newObject)) - (export "$.newString" (func $~lib/runtime/runtime.newString)) - (export "$.newArrayBuffer" (func $~lib/runtime/runtime.newArrayBuffer)) - (export "$.newArray" (func $~lib/runtime/runtime.newArray)) - (export "$.retain" (func $~lib/runtime/runtime.retain)) - (export "$.release" (func $~lib/runtime/runtime.release)) - (export "$.collect" (func $~lib/runtime/runtime.collect)) - (func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (export "__alloc" (func $~lib/rt/tlsf/__alloc)) + (export "__realloc" (func $~lib/rt/tlsf/__realloc)) + (export "__free" (func $~lib/rt/tlsf/__free)) + (export "__retain" (func $~lib/rt/purerc/__retain)) + (export "__release" (func $~lib/rt/purerc/__release)) + (export "__collect" (func $~lib/rt/purerc/__collect)) + (export "__instanceof" (func $~lib/rt/common/__instanceof)) + (export "__typeinfo" (func $~lib/rt/common/__typeinfo)) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 i32.const 1 - i32.const 32 - local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end ) - (func $~lib/allocator/arena/__mem_allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 - local.get $2 - local.get $3 - i32.gt_u - select + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 i32.add - i32.const 7 - i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 + local.set $0 current_memory - local.set $5 - local.get $4 - local.get $5 + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and i32.const 16 - i32.shl - i32.gt_u - if - local.get $4 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 local.get $1 i32.sub - i32.const 65535 + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl i32.add - i32.const 65535 + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 i32.const -1 i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $2 - local.get $5 - local.tee $3 local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if local.get $3 grow_memory i32.const 0 i32.lt_s if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end + unreachable end end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/memory/memory.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + current_memory + local.set $7 local.get $0 - call $~lib/allocator/arena/__mem_allocate - return + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop ) - (func $~lib/util/runtime/allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - call $~lib/util/runtime/adjust - call $~lib/memory/memory.allocate - local.set $1 - local.get $1 - global.get $~lib/util/runtime/HEADER_MAGIC - i32.store - local.get $1 - local.get $0 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.store offset=8 - local.get $1 - i32.const 0 - i32.store offset=12 - local.get $1 - global.get $~lib/util/runtime/HEADER_SIZE - i32.add - ) - (func $~lib/memory/memory.fill (; 6 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i64) - block $~lib/util/memory/memset|inlined.0 - local.get $2 - i32.eqz - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $0 - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $0 - i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $5 - local.get $0 - local.get $5 - i32.add - local.set $0 - local.get $2 - local.get $5 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u - local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 24 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 28 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 24 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 20 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.get $4 - i32.store - i32.const 24 - local.get $0 - i32.const 4 - i32.and - i32.add - local.set $5 - local.get $0 - local.get $5 - i32.add - local.set $0 - local.get $2 - local.get $5 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $6 - block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - block - local.get $0 - local.get $6 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $6 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $6 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $6 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end - br $continue|0 - end - end - end - end - ) - (func $~lib/collector/dummy/__ref_register (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/util/runtime/register (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $0 - global.get $~lib/memory/HEAP_BASE - i32.gt_u - i32.eqz - if - i32.const 0 - i32.const 80 - i32.const 129 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.sub - local.set $2 - local.get $2 + local.get $1 i32.load - global.get $~lib/util/runtime/HEADER_MAGIC - i32.eq - i32.eqz - if - i32.const 0 - i32.const 80 - i32.const 131 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $2 - local.get $1 - i32.store - local.get $0 - call $~lib/collector/dummy/__ref_register - local.get $0 - ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $1 - global.get $~lib/util/runtime/MAX_BYTELENGTH - i32.gt_u - if - i32.const 0 - i32.const 24 - i32.const 54 - i32.const 43 - call $~lib/builtins/abort - unreachable - end - local.get $1 - call $~lib/util/runtime/allocate - local.set $2 - local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + local.set $3 local.get $2 i32.const 15 - call $~lib/util/runtime/register + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end ) - (func $~lib/collector/dummy/__ref_link (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - nop + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 ) - (func $~lib/collector/dummy/__ref_unlink (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - nop + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add ) - (func $~lib/arraybuffer/ArrayBufferView#constructor (; 12 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 15 ;) (type $FUNCSIG$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.get $1 - global.get $~lib/util/runtime/MAX_BYTELENGTH + i32.const 1073741808 local.get $2 i32.shr_u i32.gt_u if - i32.const 0 i32.const 24 - i32.const 12 - i32.const 57 + i32.const 72 + i32.const 14 + i32.const 56 call $~lib/builtins/abort unreachable end - i32.const 0 local.get $1 local.get $2 i32.shl local.tee $1 - call $~lib/arraybuffer/ArrayBuffer#constructor + i32.const 15 + call $~lib/rt/tlsf/__alloc local.set $3 block (result i32) local.get $0 i32.eqz if i32.const 12 - call $~lib/util/runtime/allocate i32.const 14 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -800,25 +1635,9 @@ end local.tee $4 local.get $3 - local.tee $5 local.get $4 i32.load - local.tee $6 - i32.ne - if (result i32) - local.get $6 - if - local.get $6 - local.get $4 - call $~lib/collector/dummy/__ref_unlink - end - local.get $5 - local.get $4 - call $~lib/collector/dummy/__ref_link - local.get $5 - else - local.get $5 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $3 @@ -828,19 +1647,21 @@ i32.store offset=8 local.get $0 ) - (func $~lib/array/Array#constructor (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#constructor (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 if (result i32) local.get $0 else i32.const 16 - call $~lib/util/runtime/allocate i32.const 17 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain end local.get $1 i32.const 2 call $~lib/arraybuffer/ArrayBufferView#constructor + local.tee $2 local.set $0 local.get $0 i32.const 0 @@ -850,7 +1671,12 @@ i32.store offset=12 local.get $0 ) - (func $~lib/array/Array.isArray<~lib/array/Array | null> (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array.isArray<~lib/array/Array | null> (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release i32.const 1 if (result i32) local.get $0 @@ -860,7 +1686,12 @@ i32.const 0 end ) - (func $~lib/array/Array.isArray<~lib/array/Array> (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array.isArray<~lib/array/Array> (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release i32.const 1 if (result i32) local.get $0 @@ -870,19 +1701,24 @@ i32.const 0 end ) - (func $std/array/P#constructor (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/P#constructor (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 0 - call $~lib/util/runtime/allocate i32.const 18 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 ) - (func $~lib/array/Array.isArray (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array.isArray (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release i32.const 0 if (result i32) local.get $0 @@ -892,23 +1728,30 @@ i32.const 0 end ) - (func $~lib/typedarray/Uint8Array#constructor (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#constructor (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 if (result i32) local.get $0 else i32.const 12 - call $~lib/util/runtime/allocate i32.const 19 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain end local.get $1 i32.const 0 call $~lib/arraybuffer/ArrayBufferView#constructor + local.tee $2 local.set $0 local.get $0 ) - (func $~lib/array/Array.isArray<~lib/typedarray/Uint8Array> (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array.isArray<~lib/typedarray/Uint8Array> (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release i32.const 0 if (result i32) local.get $0 @@ -918,7 +1761,7 @@ i32.const 0 end ) - (func $~lib/array/Array.isArray (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array.isArray (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 0 if (result i32) local.get $0 @@ -928,7 +1771,12 @@ i32.const 0 end ) - (func $~lib/array/Array.isArray<~lib/string/String> (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array.isArray<~lib/string/String> (; 24 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release i32.const 0 if (result i32) local.get $0 @@ -938,7 +1786,575 @@ i32.const 0 end ) - (func $~lib/array/Array#fill (; 22 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/rt/purerc/increment (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 320 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 320 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/memory/memory.copy (; 27 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/common/__allocArray (; 28 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 16 + local.get $2 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $0 + local.get $1 + i32.shl + local.set $5 + local.get $5 + i32.const 15 + call $~lib/rt/tlsf/__alloc + local.set $6 + local.get $4 + local.get $6 + call $~lib/rt/purerc/__retain + i32.store + local.get $4 + local.get $6 + i32.store offset=4 + local.get $4 + local.get $5 + i32.store offset=8 + local.get $4 + local.get $0 + i32.store offset=12 + local.get $3 + if + local.get $6 + local.get $3 + local.get $5 + call $~lib/memory/memory.copy + end + local.get $4 + ) + (func $~lib/memory/memory.fill (; 29 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $continue|0 + end + end + end + end + ) + (func $~lib/array/Array#fill (; 30 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -1013,283 +2429,13 @@ call $~lib/memory/memory.fill end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/memory/memory.copy (; 23 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - block $~lib/util/memory/memmove|inlined.0 - local.get $0 - local.get $1 - i32.eq - if - br $~lib/util/memory/memmove|inlined.0 - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - block $break|0 - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - block - local.get $2 - i32.eqz - if - br $~lib/util/memory/memmove|inlined.0 - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - end - br $continue|0 - end - end - end - block $break|1 - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - end - br $continue|1 - end - end - end - end - block $break|2 - loop $continue|2 - local.get $2 - if - block - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - end - br $continue|2 - end - end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - block $break|3 - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - block - local.get $2 - i32.eqz - if - br $~lib/util/memory/memmove|inlined.0 - end - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - end - br $continue|3 - end - end - end - block $break|4 - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - end - br $continue|4 - end - end - end - end - block $break|5 - loop $continue|5 - local.get $2 - if - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 - end - end - end - end - end - ) - (func $~lib/util/runtime/makeArray (; 24 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - i32.const 16 - call $~lib/util/runtime/allocate - local.get $2 - call $~lib/util/runtime/register - local.set $4 - local.get $0 - local.get $1 - i32.shl - local.set $5 - local.get $5 - call $~lib/util/runtime/allocate - i32.const 15 - call $~lib/util/runtime/register - local.set $6 - local.get $4 - local.tee $7 - local.get $6 - local.tee $8 - local.get $7 - i32.load - local.tee $9 - i32.ne - if (result i32) - local.get $9 - if - local.get $9 - local.get $7 - call $~lib/collector/dummy/__ref_unlink - end - local.get $8 - local.get $7 - call $~lib/collector/dummy/__ref_link - local.get $8 - else - local.get $8 - end - i32.store - local.get $4 - local.get $6 - i32.store offset=4 - local.get $4 - local.get $5 - i32.store offset=8 - local.get $4 - local.get $0 - i32.store offset=12 - local.get $3 - if - local.get $6 - local.get $3 - local.get $5 - call $~lib/memory/memory.copy - end - local.get $4 - ) - (func $~lib/array/Array#get:length (; 25 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#get:length (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array#__unchecked_get (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -1298,7 +2444,7 @@ i32.add i32.load8_u ) - (func $~lib/array/Array#__get (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -1306,9 +2452,9 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 99 + i32.const 400 + i32.const 456 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable @@ -1317,8 +2463,14 @@ local.get $1 call $~lib/array/Array#__unchecked_get ) - (func $std/array/isArraysEqual (; 28 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual (; 34 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.eqz if @@ -1330,6 +2482,10 @@ call $~lib/array/Array#get:length i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -1337,6 +2493,10 @@ local.get $1 i32.eq if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end @@ -1358,6 +2518,10 @@ call $~lib/array/Array#__get i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -1370,9 +2534,13 @@ end unreachable end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $~lib/array/Array#fill (; 29 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/array/Array#fill (; 35 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -1457,12 +2625,13 @@ unreachable end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array#get:length (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#get:length (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array#__unchecked_get (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -1471,7 +2640,7 @@ i32.add i32.load ) - (func $~lib/array/Array#__get (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -1479,9 +2648,9 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 99 + i32.const 400 + i32.const 456 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable @@ -1490,8 +2659,14 @@ local.get $1 call $~lib/array/Array#__unchecked_get ) - (func $std/array/isArraysEqual (; 33 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual (; 39 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.eqz if @@ -1503,6 +2678,10 @@ call $~lib/array/Array#get:length i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -1510,6 +2689,10 @@ local.get $1 i32.eq if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end @@ -1531,6 +2714,10 @@ call $~lib/array/Array#__get i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -1543,214 +2730,279 @@ end unreachable end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $~lib/array/Array#get:length (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#get:length (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 35 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 41 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE + i32.const 16 i32.sub - i32.load offset=4 + i32.load offset=12 ) - (func $std/array/internalCapacity (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/internalCapacity (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 i32.load + call $~lib/rt/purerc/__retain local.set $1 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release local.get $1 call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 2 i32.shr_s ) - (func $~lib/allocator/arena/__mem_free (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/memory/memory.free (; 38 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - call $~lib/allocator/arena/__mem_free - ) - (func $~lib/util/runtime/reallocate (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.sub - local.set $2 - local.get $2 - i32.load offset=4 - local.set $3 - local.get $3 - local.get $1 - i32.lt_u - if - local.get $1 - call $~lib/util/runtime/adjust - local.set $4 - local.get $3 - call $~lib/util/runtime/adjust - i32.const 0 - local.get $0 - global.get $~lib/memory/HEAP_BASE - i32.gt_u - select - local.get $4 - i32.lt_u - if - local.get $4 - call $~lib/memory/memory.allocate - local.set $5 - local.get $5 - local.get $2 - i32.load - i32.store - local.get $5 - i32.const 0 - i32.store offset=8 - local.get $5 - i32.const 0 - i32.store offset=12 - local.get $5 - global.get $~lib/util/runtime/HEADER_SIZE - i32.add - local.set $6 - local.get $6 - local.get $0 - local.get $3 - call $~lib/memory/memory.copy - local.get $6 - local.get $3 - i32.add - i32.const 0 - local.get $1 - local.get $3 - i32.sub - call $~lib/memory/memory.fill - local.get $2 - i32.load - global.get $~lib/util/runtime/HEADER_MAGIC - i32.eq - if - local.get $0 - global.get $~lib/memory/HEAP_BASE - i32.gt_u - i32.eqz - if - i32.const 0 - i32.const 80 - i32.const 89 - i32.const 8 - call $~lib/builtins/abort - unreachable - end - local.get $2 - call $~lib/memory/memory.free - else - local.get $0 - call $~lib/collector/dummy/__ref_register - end - local.get $5 - local.set $2 - local.get $6 - local.set $0 - else - local.get $0 - local.get $3 - i32.add - i32.const 0 - local.get $1 - local.get $3 - i32.sub - call $~lib/memory/memory.fill - end - else - nop - end - local.get $2 - local.get $1 - i32.store offset=4 - local.get $0 - ) - (func $~lib/array/ensureCapacity (; 40 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/reallocateBlock (; 43 ;) (type $FUNCSIG$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) (local $8 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 local.get $1 + i32.load + local.set $4 + local.get $4 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 491 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const -4 + i32.and + i32.le_u + if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + block $~lib/rt/tlsf/GETRIGHT|inlined.4 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $6 + local.get $6 + i32.load + local.set $7 + local.get $7 + i32.const 1 + i32.and + if + local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $7 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $5 + local.get $5 + local.get $3 + i32.ge_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return + end + end + local.get $0 + local.get $2 + call $~lib/rt/tlsf/allocateBlock + local.set $8 + local.get $8 + local.get $1 + i32.load offset=4 + i32.store offset=4 + local.get $8 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $8 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + local.get $8 + ) + (func $~lib/rt/tlsf/__realloc (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 552 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 553 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/array/ensureSize (; 45 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 i32.load offset=8 + local.set $3 + local.get $1 + local.get $3 local.get $2 i32.shr_u i32.gt_u if local.get $1 - global.get $~lib/util/runtime/MAX_BYTELENGTH + i32.const 1073741808 local.get $2 i32.shr_u i32.gt_u if - i32.const 0 - i32.const 280 + i32.const 24 + i32.const 456 i32.const 14 - i32.const 64 + i32.const 47 call $~lib/builtins/abort unreachable end local.get $0 i32.load - local.set $3 + local.set $4 local.get $1 local.get $2 i32.shl - local.set $4 - local.get $3 - local.get $4 - call $~lib/util/runtime/reallocate local.set $5 + local.get $4 + local.get $5 + call $~lib/rt/tlsf/__realloc + local.set $6 + local.get $6 + local.get $3 + i32.add + i32.const 0 local.get $5 local.get $3 + i32.sub + call $~lib/memory/memory.fill + local.get $6 + local.get $4 i32.ne if local.get $0 - local.tee $6 - local.get $5 - local.tee $7 local.get $6 - i32.load - local.tee $8 - i32.ne - if (result i32) - local.get $8 - if - local.get $8 - local.get $6 - call $~lib/collector/dummy/__ref_unlink - end - local.get $7 - local.get $6 - call $~lib/collector/dummy/__ref_link - local.get $7 - else - local.get $7 - end + call $~lib/rt/purerc/__retain i32.store local.get $0 - local.get $5 + local.get $6 i32.store offset=4 end local.get $0 - local.get $4 + local.get $5 i32.store offset=8 end ) - (func $~lib/array/Array#push (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#push (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -1763,7 +3015,7 @@ local.get $0 local.get $3 i32.const 2 - call $~lib/array/ensureCapacity + call $~lib/array/ensureSize local.get $0 i32.load offset=4 local.get $2 @@ -1777,7 +3029,7 @@ i32.store offset=12 local.get $3 ) - (func $~lib/array/Array#__unchecked_get (; 42 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -1786,7 +3038,7 @@ i32.add i32.load ) - (func $~lib/array/Array#__get (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -1794,9 +3046,9 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 99 + i32.const 400 + i32.const 456 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable @@ -1805,7 +3057,7 @@ local.get $1 call $~lib/array/Array#__unchecked_get ) - (func $~lib/array/Array#pop (; 44 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#pop (; 49 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -1815,9 +3067,9 @@ i32.const 1 i32.lt_s if - i32.const 0 - i32.const 280 - i32.const 311 + i32.const 840 + i32.const 456 + i32.const 250 i32.const 20 call $~lib/builtins/abort unreachable @@ -1838,7 +3090,7 @@ i32.store offset=12 local.get $2 ) - (func $~lib/array/Array#concat (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#concat (; 50 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1846,6 +3098,9 @@ (local $6 i32) (local $7 i32) (local $8 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 local.set $2 @@ -1862,42 +3117,43 @@ i32.add local.set $4 local.get $4 - global.get $~lib/util/runtime/MAX_BYTELENGTH - i32.const 2 - i32.shr_u + i32.const 268435452 i32.gt_u if - i32.const 0 - i32.const 280 - i32.const 236 - i32.const 60 - call $~lib/builtins/abort + local.get $1 + call $~lib/rt/purerc/__release + block + i32.const 24 + i32.const 456 + i32.const 197 + i32.const 59 + call $~lib/builtins/abort + unreachable + unreachable + end unreachable end - block $~lib/util/runtime/NEWARRAY|inlined.0 (result i32) - local.get $4 - local.set $5 - local.get $5 - i32.const 2 - i32.const 17 - i32.const 0 - call $~lib/util/runtime/makeArray - end - local.set $6 - local.get $6 + local.get $4 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $5 + local.get $5 i32.load offset=4 - local.set $7 + local.set $6 local.get $2 i32.const 2 i32.shl - local.set $8 - local.get $7 + local.set $7 + local.get $6 local.get $0 i32.load offset=4 - local.get $8 - call $~lib/memory/memory.copy local.get $7 - local.get $8 + call $~lib/memory/memory.copy + local.get $6 + local.get $7 i32.add local.get $1 i32.load offset=4 @@ -1905,9 +3161,13 @@ i32.const 2 i32.shl call $~lib/memory/memory.copy - local.get $6 + local.get $5 + local.set $8 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 ) - (func $~lib/array/Array#copyWithin (; 46 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/array/Array#copyWithin (; 51 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -2048,32 +3308,30 @@ loop $continue|0 local.get $11 if - block - local.get $4 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $4 - local.get $9 - i32.const 2 - i32.shl - i32.add - i32.load - i32.store - local.get $9 - i32.const 1 - i32.sub - local.set $9 - local.get $8 - i32.const 1 - i32.sub - local.set $8 - local.get $11 - i32.const 1 - i32.sub - local.set $11 - end + local.get $4 + local.get $8 + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $9 + i32.const 2 + i32.shl + i32.add + i32.load + i32.store + local.get $9 + i32.const 1 + i32.sub + local.set $9 + local.get $8 + i32.const 1 + i32.sub + local.set $8 + local.get $11 + i32.const 1 + i32.sub + local.set $11 br $continue|0 end end @@ -2095,9 +3353,16 @@ call $~lib/memory/memory.copy end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $std/array/isArraysEqual (; 47 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual (; 52 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.eqz if @@ -2109,6 +3374,10 @@ call $~lib/array/Array#get:length i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -2116,6 +3385,10 @@ local.get $1 i32.eq if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end @@ -2137,6 +3410,10 @@ call $~lib/array/Array#__get i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -2149,9 +3426,13 @@ end unreachable end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $~lib/array/Array#unshift (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#unshift (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -2162,7 +3443,7 @@ local.get $0 local.get $2 i32.const 2 - call $~lib/array/ensureCapacity + call $~lib/array/ensureSize local.get $0 i32.load offset=4 local.set $3 @@ -2184,7 +3465,7 @@ i32.store offset=12 local.get $2 ) - (func $~lib/array/Array#shift (; 49 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#shift (; 54 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -2196,9 +3477,9 @@ i32.const 1 i32.lt_s if - i32.const 0 - i32.const 280 - i32.const 383 + i32.const 840 + i32.const 456 + i32.const 311 i32.const 20 call $~lib/builtins/abort unreachable @@ -2233,7 +3514,7 @@ i32.store offset=12 local.get $3 ) - (func $~lib/array/Array#reverse (; 50 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#reverse (; 55 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -2261,34 +3542,33 @@ local.get $3 i32.lt_u if - block - local.get $2 - i32.load - local.set $4 - local.get $2 - local.get $3 - i32.load - i32.store - local.get $3 - local.get $4 - i32.store - local.get $2 - i32.const 4 - i32.add - local.set $2 - local.get $3 - i32.const 4 - i32.sub - local.set $3 - end + local.get $2 + i32.load + local.set $4 + local.get $2 + local.get $3 + i32.load + i32.store + local.get $3 + local.get $4 + i32.store + local.get $2 + i32.const 4 + i32.add + local.set $2 + local.get $3 + i32.const 4 + i32.sub + local.set $3 br $continue|0 end end end end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array#indexOf (; 51 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#indexOf (; 56 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2335,31 +3615,29 @@ local.get $3 i32.lt_s if - block - local.get $6 + local.get $6 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $1 + i32.eq + if local.get $2 - i32.const 2 - i32.shl - i32.add - i32.load - local.get $1 - i32.eq - if - local.get $2 - return - end - local.get $2 - i32.const 1 - i32.add - local.set $2 + return end + local.get $2 + i32.const 1 + i32.add + local.set $2 br $continue|0 end end end i32.const -1 ) - (func $~lib/array/Array#includes (; 52 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#includes (; 57 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 local.get $1 local.get $2 @@ -2367,7 +3645,7 @@ i32.const 0 i32.ge_s ) - (func $~lib/array/Array#splice (; 53 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#splice (; 58 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2422,15 +3700,12 @@ i32.gt_s select local.set $2 - block $~lib/util/runtime/NEWARRAY|inlined.1 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.const 2 - i32.const 17 - i32.const 0 - call $~lib/util/runtime/makeArray - end + local.get $2 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain local.set $6 local.get $6 i32.load offset=4 @@ -2444,8 +3719,7 @@ i32.shl i32.add local.set $9 - local.get $6 - i32.load offset=4 + local.get $7 local.get $9 local.get $2 i32.const 2 @@ -2479,7 +3753,7 @@ i32.store offset=12 local.get $6 ) - (func $~lib/array/Array#__unchecked_set (; 54 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__unchecked_set (; 59 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $0 i32.load offset=4 local.get $1 @@ -2489,7 +3763,7 @@ local.get $2 i32.store ) - (func $~lib/array/Array#__set (; 55 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__set (; 60 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) local.get $0 i32.load offset=12 @@ -2499,7 +3773,7 @@ i32.const 1 i32.add i32.const 2 - call $~lib/array/ensureCapacity + call $~lib/array/ensureSize local.get $0 local.get $1 local.get $2 @@ -2515,12 +3789,20 @@ i32.store offset=12 end ) - (func $start:std/array~anonymous|0 (; 56 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|0 (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 0 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#findIndex (; 57 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#findIndex (; 62 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2577,44 +3859,86 @@ end i32.const -1 ) - (func $start:std/array~anonymous|1 (; 58 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|1 (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 1 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $start:std/array~anonymous|2 (; 59 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|2 (; 64 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 100 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $start:std/array~anonymous|3 (; 60 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|3 (; 65 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push drop - local.get $0 - i32.const 100 - i32.eq - ) - (func $start:std/array~anonymous|4 (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const 100 - i32.eq - ) - (func $start:std/array~anonymous|5 (; 62 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 - call $~lib/array/Array#pop + call $~lib/rt/purerc/__release + local.get $0 + i32.const 100 + i32.eq + ) + (func $start:std/array~anonymous|4 (; 66 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain drop local.get $0 i32.const 100 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $start:std/array~anonymous|6 (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|5 (; 67 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop + local.get $2 + call $~lib/array/Array#pop + drop + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + i32.const 100 + i32.eq + ) + (func $start:std/array~anonymous|6 (; 68 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 0 i32.ge_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#every (; 64 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#every (; 69 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2674,39 +3998,73 @@ end i32.const 1 ) - (func $start:std/array~anonymous|7 (; 65 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|7 (; 70 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 0 i32.le_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $start:std/array~anonymous|8 (; 66 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|8 (; 71 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push drop + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 10 i32.lt_s ) - (func $start:std/array~anonymous|9 (; 67 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|9 (; 72 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 10 i32.lt_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $start:std/array~anonymous|10 (; 68 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|10 (; 73 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 call $~lib/array/Array#pop drop + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 3 i32.lt_s ) - (func $start:std/array~anonymous|11 (; 69 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|11 (; 74 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 3 i32.ge_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#some (; 70 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#some (; 75 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2763,40 +4121,71 @@ end i32.const 0 ) - (func $start:std/array~anonymous|12 (; 71 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|12 (; 76 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const -1 i32.le_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $start:std/array~anonymous|13 (; 72 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|13 (; 77 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push drop + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 10 i32.gt_s ) - (func $start:std/array~anonymous|14 (; 73 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|14 (; 78 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 10 i32.gt_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $start:std/array~anonymous|15 (; 74 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|15 (; 79 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 call $~lib/array/Array#pop drop + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 3 i32.gt_s ) - (func $start:std/array~anonymous|16 (; 75 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|16 (; 80 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop global.get $std/array/i local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release ) - (func $~lib/array/Array#forEach (; 76 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#forEach (; 81 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2823,21 +4212,19 @@ i32.lt_s i32.eqz br_if $break|0 - block - i32.const 3 - global.set $~lib/argc - local.get $0 - i32.load offset=4 - local.get $2 - i32.const 2 - i32.shl - i32.add - i32.load - local.get $2 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$viii) - end + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.load offset=4 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $2 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$viii) local.get $2 i32.const 1 i32.add @@ -2848,7 +4235,10 @@ unreachable end ) - (func $start:std/array~anonymous|17 (; 77 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|17 (; 82 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push @@ -2857,14 +4247,24 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release ) - (func $start:std/array~anonymous|18 (; 78 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|18 (; 83 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop global.get $std/array/i local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release ) - (func $start:std/array~anonymous|19 (; 79 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|19 (; 84 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 call $~lib/array/Array#pop drop @@ -2872,9 +4272,14 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release ) - (func $start:std/array~anonymous|20 (; 80 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|20 (; 85 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $1 i32.const 0 i32.eq @@ -2980,46 +4385,54 @@ i32.eqz if i32.const 0 - i32.const 160 - i32.const 561 - i32.const 4 + i32.const 232 + i32.const 570 + i32.const 6 call $~lib/builtins/abort unreachable end end + local.get $2 + call $~lib/rt/purerc/__release ) - (func $start:std/array~anonymous|21 (; 81 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (func $start:std/array~anonymous|21 (; 86 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (local $3 f32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 f32.convert_i32_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#map (; 82 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#map (; 87 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 f32) local.get $0 i32.load offset=12 local.set $2 - block $~lib/util/runtime/NEWARRAY|inlined.0 (result i32) - local.get $2 - local.set $3 - local.get $3 - i32.const 2 - i32.const 22 - i32.const 0 - call $~lib/util/runtime/makeArray - end - local.set $4 - local.get $4 + local.get $2 + i32.const 2 + i32.const 22 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $3 + local.get $3 i32.load offset=4 - local.set $5 + local.set $4 block $break|0 i32.const 0 - local.set $3 + local.set $5 loop $repeat|0 - local.get $3 + local.get $5 local.get $2 local.tee $6 local.get $0 @@ -3032,47 +4445,45 @@ i32.lt_s i32.eqz br_if $break|0 - block + block (result f32) + i32.const 3 + global.set $~lib/argc local.get $0 i32.load offset=4 - local.get $3 + local.get $5 i32.const 2 i32.shl i32.add i32.load - local.set $6 local.get $5 - local.get $3 - i32.const 2 - i32.shl - i32.add - block (result f32) - i32.const 3 - global.set $~lib/argc - local.get $6 - local.get $3 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$fiii) - end - f32.store + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$fiii) end - local.get $3 + local.set $8 + local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.get $8 + f32.store + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $4 + local.get $3 ) - (func $~lib/array/Array#get:length (; 83 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#get:length (; 88 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array#__unchecked_get (; 84 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) + (func $~lib/array/Array#__unchecked_get (; 89 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) local.get $0 i32.load offset=4 local.get $1 @@ -3081,7 +4492,7 @@ i32.add f32.load ) - (func $~lib/array/Array#__get (; 85 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) + (func $~lib/array/Array#__get (; 90 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) local.get $1 local.get $0 i32.load offset=8 @@ -3089,9 +4500,9 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 99 + i32.const 400 + i32.const 456 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable @@ -3100,7 +4511,10 @@ local.get $1 call $~lib/array/Array#__unchecked_get ) - (func $start:std/array~anonymous|22 (; 86 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|22 (; 91 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push @@ -3109,9 +4523,11 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release local.get $0 ) - (func $~lib/array/Array#map (; 87 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#map (; 92 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3121,24 +4537,21 @@ local.get $0 i32.load offset=12 local.set $2 - block $~lib/util/runtime/NEWARRAY|inlined.2 (result i32) - local.get $2 - local.set $3 - local.get $3 - i32.const 2 - i32.const 17 - i32.const 0 - call $~lib/util/runtime/makeArray - end - local.set $4 - local.get $4 + local.get $2 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $3 + local.get $3 i32.load offset=4 - local.set $5 + local.set $4 block $break|0 i32.const 0 - local.set $3 + local.set $5 loop $repeat|0 - local.get $3 + local.get $5 local.get $2 local.tee $6 local.get $0 @@ -3151,50 +4564,56 @@ i32.lt_s i32.eqz br_if $break|0 - block + block (result i32) + i32.const 3 + global.set $~lib/argc local.get $0 i32.load offset=4 - local.get $3 + local.get $5 i32.const 2 i32.shl i32.add i32.load - local.set $6 local.get $5 - local.get $3 - i32.const 2 - i32.shl - i32.add - block (result i32) - i32.const 3 - global.set $~lib/argc - local.get $6 - local.get $3 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiii) - end - i32.store + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiii) end - local.get $3 + local.set $6 + local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $4 + local.get $3 ) - (func $start:std/array~anonymous|23 (; 88 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|23 (; 93 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop global.get $std/array/i local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release local.get $0 ) - (func $start:std/array~anonymous|24 (; 89 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|24 (; 94 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 call $~lib/array/Array#pop drop @@ -3202,39 +4621,46 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release local.get $0 ) - (func $start:std/array~anonymous|25 (; 90 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|25 (; 95 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 2 i32.ge_s + local.set $3 + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#filter (; 91 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#filter (; 96 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/util/runtime/NEWARRAY|inlined.3 (result i32) - i32.const 0 - local.set $2 - local.get $2 - i32.const 2 - i32.const 17 - i32.const 0 - call $~lib/util/runtime/makeArray - end - local.set $3 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $2 block $break|0 block i32.const 0 - local.set $2 + local.set $3 local.get $0 i32.load offset=12 local.set $4 end loop $repeat|0 - local.get $2 + local.get $3 local.get $4 local.tee $5 local.get $0 @@ -3247,43 +4673,44 @@ i32.lt_s i32.eqz br_if $break|0 - block + local.get $0 + i32.load offset=4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $5 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $5 + local.get $3 local.get $0 - i32.load offset=4 - local.get $2 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $5 - block (result i32) - i32.const 3 - global.set $~lib/argc - local.get $5 - local.get $2 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiii) - end - if - local.get $3 - local.get $5 - call $~lib/array/Array#push - drop - end + local.get $1 + call_indirect (type $FUNCSIG$iiii) end - local.get $2 + if + local.get $2 + local.get $5 + call $~lib/array/Array#push + drop + end + local.get $3 i32.const 1 i32.add - local.set $2 + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $3 + local.get $2 ) - (func $start:std/array~anonymous|26 (; 92 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|26 (; 97 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push @@ -3292,20 +4719,30 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 2 i32.ge_s ) - (func $start:std/array~anonymous|27 (; 93 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|27 (; 98 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop global.get $std/array/i local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 2 i32.ge_s ) - (func $start:std/array~anonymous|28 (; 94 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|28 (; 99 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $2 call $~lib/array/Array#pop drop @@ -3313,16 +4750,26 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/purerc/__release local.get $0 i32.const 2 i32.ge_s ) - (func $start:std/array~anonymous|29 (; 95 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|29 (; 100 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 i32.add + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 ) - (func $~lib/array/Array#reduce (; 96 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduce (; 101 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3380,12 +4827,24 @@ end local.get $3 ) - (func $start:std/array~anonymous|30 (; 97 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|30 (; 102 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 i32.add + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 ) - (func $start:std/array~anonymous|31 (; 98 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|31 (; 103 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop local.get $0 if (result i32) i32.const 1 @@ -3394,8 +4853,12 @@ i32.const 2 i32.gt_s end + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 ) - (func $~lib/array/Array#reduce (; 99 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduce (; 104 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3453,7 +4916,11 @@ end local.get $3 ) - (func $start:std/array~anonymous|32 (; 100 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|32 (; 105 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop local.get $0 if (result i32) i32.const 1 @@ -3462,35 +4929,65 @@ i32.const 100 i32.gt_s end + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 ) - (func $start:std/array~anonymous|33 (; 101 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|33 (; 106 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop local.get $3 i32.const 1 call $~lib/array/Array#push drop - local.get $0 - local.get $1 - i32.add - ) - (func $start:std/array~anonymous|34 (; 102 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - local.get $1 - i32.add - ) - (func $start:std/array~anonymous|35 (; 103 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) local.get $3 - call $~lib/array/Array#pop + call $~lib/rt/purerc/__release + local.get $0 + local.get $1 + i32.add + ) + (func $start:std/array~anonymous|34 (; 107 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain drop local.get $0 local.get $1 i32.add + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 ) - (func $start:std/array~anonymous|36 (; 104 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|35 (; 108 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $3 + call $~lib/array/Array#pop + drop + local.get $3 + call $~lib/rt/purerc/__release local.get $0 local.get $1 i32.add ) - (func $~lib/array/Array#reduceRight (; 105 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|36 (; 109 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $0 + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + ) + (func $~lib/array/Array#reduceRight (; 110 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $2 @@ -3535,12 +5032,24 @@ end local.get $3 ) - (func $start:std/array~anonymous|37 (; 106 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|37 (; 111 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 i32.add + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 ) - (func $start:std/array~anonymous|38 (; 107 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|38 (; 112 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop local.get $0 if (result i32) i32.const 1 @@ -3549,8 +5058,12 @@ i32.const 2 i32.gt_s end + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 ) - (func $~lib/array/Array#reduceRight (; 108 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduceRight (; 113 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $2 @@ -3595,7 +5108,11 @@ end local.get $3 ) - (func $start:std/array~anonymous|39 (; 109 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|39 (; 114 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop local.get $0 if (result i32) i32.const 1 @@ -3604,30 +5121,52 @@ i32.const 100 i32.gt_s end + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 ) - (func $start:std/array~anonymous|40 (; 110 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|40 (; 115 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop local.get $3 i32.const 1 call $~lib/array/Array#push drop - local.get $0 - local.get $1 - i32.add - ) - (func $start:std/array~anonymous|41 (; 111 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - local.get $1 - i32.add - ) - (func $start:std/array~anonymous|42 (; 112 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) local.get $3 - call $~lib/array/Array#pop + call $~lib/rt/purerc/__release + local.get $0 + local.get $1 + i32.add + ) + (func $start:std/array~anonymous|41 (; 116 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/purerc/__retain drop local.get $0 local.get $1 i32.add + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 ) - (func $~lib/math/murmurHash3 (; 113 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) + (func $start:std/array~anonymous|42 (; 117 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/purerc/__retain + drop + local.get $3 + call $~lib/array/Array#pop + drop + local.get $3 + call $~lib/rt/purerc/__release + local.get $0 + local.get $1 + i32.add + ) + (func $~lib/math/murmurHash3 (; 118 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) local.get $0 local.get $0 i64.const 33 @@ -3656,7 +5195,7 @@ local.set $0 local.get $0 ) - (func $~lib/math/splitMix32 (; 114 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/math/splitMix32 (; 119 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 1831565813 i32.add @@ -3691,12 +5230,12 @@ i32.shr_u i32.xor ) - (func $~lib/math/NativeMath.seedRandom (; 115 ;) (type $FUNCSIG$vj) (param $0 i64) + (func $~lib/math/NativeMath.seedRandom (; 120 ;) (type $FUNCSIG$vj) (param $0 i64) local.get $0 i64.eqz if i32.const 0 - i32.const 3000 + i32.const 3128 i32.const 1021 i32.const 4 call $~lib/builtins/abort @@ -3720,7 +5259,7 @@ call $~lib/math/splitMix32 global.set $~lib/math/random_state1_32 ) - (func $~lib/util/sort/insertionSort (; 116 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 121 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 f32) (local $5 i32) @@ -3735,77 +5274,73 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $3 - i32.const 2 - i32.shl - i32.add - f32.load - local.set $4 - local.get $3 - i32.const 1 - i32.sub - local.set $5 - block $break|1 - loop $continue|1 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + f32.load + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 local.get $5 - i32.const 0 - i32.ge_s - if - block - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - f32.load - local.set $6 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $4 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$iff) - end - i32.const 0 - i32.lt_s - if - local.get $0 - block (result i32) - local.get $5 - local.tee $7 - i32.const 1 - i32.sub - local.set $5 - local.get $7 - end - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - f32.store - else - br $break|1 - end - end - br $continue|1 + i32.const 2 + i32.shl + i32.add + f32.load + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iff) end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + f32.store + else + br $break|1 + end + br $continue|1 end end - local.get $0 - local.get $5 - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $4 - f32.store end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + f32.store local.get $3 i32.const 1 i32.add @@ -3816,7 +5351,73 @@ unreachable end ) - (func $~lib/util/sort/weakHeapSort (; 117 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/freeBlock (; 122 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/tlsf/__free (; 123 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 560 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 561 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/util/sort/weakHeapSort (; 124 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3834,7 +5435,8 @@ i32.shl local.set $3 local.get $3 - call $~lib/memory/memory.allocate + i32.const 0 + call $~lib/rt/tlsf/__alloc local.set $4 local.get $4 i32.const 0 @@ -3851,107 +5453,105 @@ i32.gt_s i32.eqz br_if $break|0 - block - local.get $5 - local.set $6 - block $break|1 - loop $continue|1 - local.get $6 - i32.const 1 - i32.and - local.get $4 - local.get $6 - i32.const 6 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $6 - i32.const 1 - i32.shr_s - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.eq - if - local.get $6 - i32.const 1 - i32.shr_s - local.set $6 - br $continue|1 - end - end - end - local.get $6 - i32.const 1 - i32.shr_s - local.set $7 - local.get $0 - local.get $7 - i32.const 2 - i32.shl - i32.add - f32.load - local.set $8 - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - f32.load - local.set $9 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $8 - local.get $9 - local.get $2 - call_indirect (type $FUNCSIG$iff) - end - i32.const 0 - i32.lt_s - if + local.get $5 + local.set $6 + block $break|1 + loop $continue|1 + local.get $6 + i32.const 1 + i32.and local.get $4 - local.get $5 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $4 - local.get $5 - i32.const 5 + local.get $6 + i32.const 6 i32.shr_s i32.const 2 i32.shl i32.add i32.load + local.get $6 i32.const 1 - local.get $5 + i32.shr_s i32.const 31 i32.and - i32.shl - i32.xor - i32.store - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $8 - f32.store - local.get $0 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $9 - f32.store + i32.shr_u + i32.const 1 + i32.and + i32.eq + if + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|1 + end end end + local.get $6 + i32.const 1 + i32.shr_s + local.set $7 + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + f32.load + local.set $8 + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + f32.load + local.set $9 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $9 + local.get $2 + call_indirect (type $FUNCSIG$iff) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $5 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.get $8 + f32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $9 + f32.store + end local.get $5 i32.const 1 i32.sub @@ -3965,146 +5565,142 @@ local.get $1 i32.const 1 i32.sub - local.set $5 + local.set $7 loop $repeat|2 - local.get $5 + local.get $7 i32.const 2 i32.ge_s i32.eqz br_if $break|2 - block - local.get $0 - f32.load - local.set $9 - local.get $0 - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - f32.load - f32.store - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $9 - f32.store - i32.const 1 - local.set $7 - block $break|3 - loop $continue|3 - local.get $7 - i32.const 1 - i32.shl - local.get $4 - local.get $7 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $7 - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.add - local.tee $6 + local.get $0 + f32.load + local.set $9 + local.get $0 + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + f32.load + f32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $9 + f32.store + i32.const 1 + local.set $6 + block $break|3 + loop $continue|3 + local.get $6 + i32.const 1 + i32.shl + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.add + local.tee $5 + local.get $7 + i32.lt_s + if local.get $5 - i32.lt_s - if - local.get $6 - local.set $7 - br $continue|3 - end - end - end - block $break|4 - loop $continue|4 - local.get $7 - i32.const 0 - i32.gt_s - if - block - local.get $0 - f32.load - local.set $9 - local.get $0 - local.get $7 - i32.const 2 - i32.shl - i32.add - f32.load - local.set $8 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $9 - local.get $8 - local.get $2 - call_indirect (type $FUNCSIG$iff) - end - i32.const 0 - i32.lt_s - if - local.get $4 - local.get $7 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $4 - local.get $7 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - i32.const 1 - local.get $7 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - local.get $0 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $9 - f32.store - local.get $0 - local.get $8 - f32.store - end - local.get $7 - i32.const 1 - i32.shr_s - local.set $7 - end - br $continue|4 - end + local.set $6 + br $continue|3 end end end - local.get $5 + block $break|4 + loop $continue|4 + local.get $6 + i32.const 0 + i32.gt_s + if + local.get $0 + f32.load + local.set $9 + local.get $0 + local.get $6 + i32.const 2 + i32.shl + i32.add + f32.load + local.set $8 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $9 + local.get $8 + local.get $2 + call_indirect (type $FUNCSIG$iff) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $6 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $9 + f32.store + local.get $0 + local.get $8 + f32.store + end + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|4 + end + end + end + local.get $7 i32.const 1 i32.sub - local.set $5 + local.set $7 br $repeat|2 unreachable end unreachable end local.get $4 - call $~lib/memory/memory.free + call $~lib/rt/tlsf/__free local.get $0 f32.load offset=4 local.set $10 @@ -4116,7 +5712,7 @@ local.get $10 f32.store ) - (func $~lib/array/Array#sort (; 118 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 125 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 f32) @@ -4124,16 +5720,6 @@ (local $6 i32) (local $7 i32) (local $8 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 280 - i32.const 528 - i32.const 4 - call $~lib/builtins/abort - unreachable - end local.get $0 i32.load offset=12 local.set $2 @@ -4142,6 +5728,7 @@ i32.le_s if local.get $0 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -4176,6 +5763,7 @@ f32.store end local.get $0 + call $~lib/rt/purerc/__retain return end block $~lib/util/sort/SORT|inlined.0 @@ -4201,8 +5789,9 @@ end end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 119 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 126 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -4235,7 +5824,7 @@ i32.lt_s i32.sub ) - (func $~lib/array/Array#sort|trampoline (; 120 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline (; 127 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -4254,13 +5843,19 @@ local.get $1 call $~lib/array/Array#sort ) - (func $~lib/builtins/isNaN (; 121 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + (func $~lib/builtins/isNaN (; 128 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) local.get $0 local.get $0 f32.ne ) - (func $std/array/isArraysEqual (; 122 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual (; 129 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.eqz if @@ -4272,6 +5867,10 @@ call $~lib/array/Array#get:length i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -4279,6 +5878,10 @@ local.get $1 i32.eq if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end @@ -4293,30 +5896,32 @@ i32.lt_s i32.eqz br_if $break|0 - block + local.get $0 + local.get $3 + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + local.get $1 + local.get $3 + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + i32.eq + if + br $continue|0 + end + local.get $0 + local.get $3 + call $~lib/array/Array#__get + local.get $1 + local.get $3 + call $~lib/array/Array#__get + f32.ne + if local.get $0 - local.get $3 - call $~lib/array/Array#__get - call $~lib/builtins/isNaN + call $~lib/rt/purerc/__release local.get $1 - local.get $3 - call $~lib/array/Array#__get - call $~lib/builtins/isNaN - i32.eq - if - br $continue|0 - end - local.get $0 - local.get $3 - call $~lib/array/Array#__get - local.get $1 - local.get $3 - call $~lib/array/Array#__get - f32.ne - if - i32.const 0 - return - end + call $~lib/rt/purerc/__release + i32.const 0 + return end end local.get $3 @@ -4328,9 +5933,13 @@ end unreachable end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $~lib/util/sort/insertionSort (; 123 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 130 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 f64) (local $5 i32) @@ -4345,77 +5954,73 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $3 - i32.const 3 - i32.shl - i32.add - f64.load - local.set $4 - local.get $3 - i32.const 1 - i32.sub - local.set $5 - block $break|1 - loop $continue|1 + local.get $0 + local.get $3 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 local.get $5 - i32.const 0 - i32.ge_s - if - block - local.get $0 - local.get $5 - i32.const 3 - i32.shl - i32.add - f64.load - local.set $6 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $4 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$idd) - end - i32.const 0 - i32.lt_s - if - local.get $0 - block (result i32) - local.get $5 - local.tee $7 - i32.const 1 - i32.sub - local.set $5 - local.get $7 - end - i32.const 1 - i32.add - i32.const 3 - i32.shl - i32.add - local.get $6 - f64.store - else - br $break|1 - end - end - br $continue|1 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$idd) end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 3 + i32.shl + i32.add + local.get $6 + f64.store + else + br $break|1 + end + br $continue|1 end end - local.get $0 - local.get $5 - i32.const 1 - i32.add - i32.const 3 - i32.shl - i32.add - local.get $4 - f64.store end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 3 + i32.shl + i32.add + local.get $4 + f64.store local.get $3 i32.const 1 i32.add @@ -4426,7 +6031,7 @@ unreachable end ) - (func $~lib/util/sort/weakHeapSort (; 124 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 131 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4444,7 +6049,8 @@ i32.shl local.set $3 local.get $3 - call $~lib/memory/memory.allocate + i32.const 0 + call $~lib/rt/tlsf/__alloc local.set $4 local.get $4 i32.const 0 @@ -4461,107 +6067,105 @@ i32.gt_s i32.eqz br_if $break|0 - block - local.get $5 - local.set $6 - block $break|1 - loop $continue|1 - local.get $6 - i32.const 1 - i32.and - local.get $4 - local.get $6 - i32.const 6 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $6 - i32.const 1 - i32.shr_s - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.eq - if - local.get $6 - i32.const 1 - i32.shr_s - local.set $6 - br $continue|1 - end - end - end - local.get $6 - i32.const 1 - i32.shr_s - local.set $7 - local.get $0 - local.get $7 - i32.const 3 - i32.shl - i32.add - f64.load - local.set $8 - local.get $0 - local.get $5 - i32.const 3 - i32.shl - i32.add - f64.load - local.set $9 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $8 - local.get $9 - local.get $2 - call_indirect (type $FUNCSIG$idd) - end - i32.const 0 - i32.lt_s - if + local.get $5 + local.set $6 + block $break|1 + loop $continue|1 + local.get $6 + i32.const 1 + i32.and local.get $4 - local.get $5 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $4 - local.get $5 - i32.const 5 + local.get $6 + i32.const 6 i32.shr_s i32.const 2 i32.shl i32.add i32.load + local.get $6 i32.const 1 - local.get $5 + i32.shr_s i32.const 31 i32.and - i32.shl - i32.xor - i32.store - local.get $0 - local.get $5 - i32.const 3 - i32.shl - i32.add - local.get $8 - f64.store - local.get $0 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $9 - f64.store + i32.shr_u + i32.const 1 + i32.and + i32.eq + if + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|1 + end end end + local.get $6 + i32.const 1 + i32.shr_s + local.set $7 + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $8 + local.get $0 + local.get $5 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $9 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $9 + local.get $2 + call_indirect (type $FUNCSIG$idd) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $5 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $5 + i32.const 3 + i32.shl + i32.add + local.get $8 + f64.store + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $9 + f64.store + end local.get $5 i32.const 1 i32.sub @@ -4575,146 +6179,142 @@ local.get $1 i32.const 1 i32.sub - local.set $5 + local.set $7 loop $repeat|2 - local.get $5 + local.get $7 i32.const 2 i32.ge_s i32.eqz br_if $break|2 - block - local.get $0 - f64.load - local.set $9 - local.get $0 - local.get $0 - local.get $5 - i32.const 3 - i32.shl - i32.add - f64.load - f64.store - local.get $0 - local.get $5 - i32.const 3 - i32.shl - i32.add - local.get $9 - f64.store - i32.const 1 - local.set $7 - block $break|3 - loop $continue|3 - local.get $7 - i32.const 1 - i32.shl - local.get $4 - local.get $7 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $7 - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.add - local.tee $6 + local.get $0 + f64.load + local.set $9 + local.get $0 + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + f64.load + f64.store + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $9 + f64.store + i32.const 1 + local.set $6 + block $break|3 + loop $continue|3 + local.get $6 + i32.const 1 + i32.shl + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.add + local.tee $5 + local.get $7 + i32.lt_s + if local.get $5 - i32.lt_s - if - local.get $6 - local.set $7 - br $continue|3 - end - end - end - block $break|4 - loop $continue|4 - local.get $7 - i32.const 0 - i32.gt_s - if - block - local.get $0 - f64.load - local.set $9 - local.get $0 - local.get $7 - i32.const 3 - i32.shl - i32.add - f64.load - local.set $8 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $9 - local.get $8 - local.get $2 - call_indirect (type $FUNCSIG$idd) - end - i32.const 0 - i32.lt_s - if - local.get $4 - local.get $7 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $4 - local.get $7 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - i32.const 1 - local.get $7 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - local.get $0 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $9 - f64.store - local.get $0 - local.get $8 - f64.store - end - local.get $7 - i32.const 1 - i32.shr_s - local.set $7 - end - br $continue|4 - end + local.set $6 + br $continue|3 end end end - local.get $5 + block $break|4 + loop $continue|4 + local.get $6 + i32.const 0 + i32.gt_s + if + local.get $0 + f64.load + local.set $9 + local.get $0 + local.get $6 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $8 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $9 + local.get $8 + local.get $2 + call_indirect (type $FUNCSIG$idd) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $6 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $6 + i32.const 3 + i32.shl + i32.add + local.get $9 + f64.store + local.get $0 + local.get $8 + f64.store + end + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|4 + end + end + end + local.get $7 i32.const 1 i32.sub - local.set $5 + local.set $7 br $repeat|2 unreachable end unreachable end local.get $4 - call $~lib/memory/memory.free + call $~lib/rt/tlsf/__free local.get $0 f64.load offset=8 local.set $10 @@ -4726,7 +6326,7 @@ local.get $10 f64.store ) - (func $~lib/array/Array#sort (; 125 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 132 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 f64) @@ -4734,16 +6334,6 @@ (local $6 i32) (local $7 i32) (local $8 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 280 - i32.const 528 - i32.const 4 - call $~lib/builtins/abort - unreachable - end local.get $0 i32.load offset=12 local.set $2 @@ -4752,6 +6342,7 @@ i32.le_s if local.get $0 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -4786,6 +6377,7 @@ f64.store end local.get $0 + call $~lib/rt/purerc/__retain return end block $~lib/util/sort/SORT|inlined.0 @@ -4811,8 +6403,9 @@ end end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 126 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 133 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) local.get $0 @@ -4845,7 +6438,7 @@ i64.lt_s i32.sub ) - (func $~lib/array/Array#sort|trampoline (; 127 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline (; 134 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -4864,11 +6457,11 @@ local.get $1 call $~lib/array/Array#sort ) - (func $~lib/array/Array#get:length (; 128 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#get:length (; 135 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array#__unchecked_get (; 129 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/array/Array#__unchecked_get (; 136 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) local.get $0 i32.load offset=4 local.get $1 @@ -4877,7 +6470,7 @@ i32.add f64.load ) - (func $~lib/array/Array#__get (; 130 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/array/Array#__get (; 137 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) local.get $1 local.get $0 i32.load offset=8 @@ -4885,9 +6478,9 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 99 + i32.const 400 + i32.const 456 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable @@ -4896,13 +6489,19 @@ local.get $1 call $~lib/array/Array#__unchecked_get ) - (func $~lib/builtins/isNaN (; 131 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/builtins/isNaN (; 138 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 local.get $0 f64.ne ) - (func $std/array/isArraysEqual (; 132 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual (; 139 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.eqz if @@ -4914,6 +6513,10 @@ call $~lib/array/Array#get:length i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -4921,6 +6524,10 @@ local.get $1 i32.eq if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end @@ -4935,30 +6542,32 @@ i32.lt_s i32.eqz br_if $break|0 - block + local.get $0 + local.get $3 + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + local.get $1 + local.get $3 + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + i32.eq + if + br $continue|0 + end + local.get $0 + local.get $3 + call $~lib/array/Array#__get + local.get $1 + local.get $3 + call $~lib/array/Array#__get + f64.ne + if local.get $0 - local.get $3 - call $~lib/array/Array#__get - call $~lib/builtins/isNaN + call $~lib/rt/purerc/__release local.get $1 - local.get $3 - call $~lib/array/Array#__get - call $~lib/builtins/isNaN - i32.eq - if - br $continue|0 - end - local.get $0 - local.get $3 - call $~lib/array/Array#__get - local.get $1 - local.get $3 - call $~lib/array/Array#__get - f64.ne - if - i32.const 0 - return - end + call $~lib/rt/purerc/__release + i32.const 0 + return end end local.get $3 @@ -4970,9 +6579,13 @@ end unreachable end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $~lib/util/sort/insertionSort (; 133 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 140 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4987,77 +6600,73 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $3 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $4 - local.get $3 - i32.const 1 - i32.sub - local.set $5 - block $break|1 - loop $continue|1 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 local.get $5 - i32.const 0 - i32.ge_s - if - block - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $4 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $0 - block (result i32) - local.get $5 - local.tee $7 - i32.const 1 - i32.sub - local.set $5 - local.get $7 - end - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store - else - br $break|1 - end - end - br $continue|1 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + br $break|1 + end + br $continue|1 end end - local.get $0 - local.get $5 - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.store end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store local.get $3 i32.const 1 i32.add @@ -5068,7 +6677,7 @@ unreachable end ) - (func $~lib/util/sort/weakHeapSort (; 134 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 141 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5086,7 +6695,8 @@ i32.shl local.set $3 local.get $3 - call $~lib/memory/memory.allocate + i32.const 0 + call $~lib/rt/tlsf/__alloc local.set $4 local.get $4 i32.const 0 @@ -5103,107 +6713,105 @@ i32.gt_s i32.eqz br_if $break|0 - block - local.get $5 - local.set $6 - block $break|1 - loop $continue|1 - local.get $6 - i32.const 1 - i32.and - local.get $4 - local.get $6 - i32.const 6 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $6 - i32.const 1 - i32.shr_s - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.eq - if - local.get $6 - i32.const 1 - i32.shr_s - local.set $6 - br $continue|1 - end - end - end - local.get $6 - i32.const 1 - i32.shr_s - local.set $7 - local.get $0 - local.get $7 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $8 - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $9 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $8 - local.get $9 - local.get $2 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if + local.get $5 + local.set $6 + block $break|1 + loop $continue|1 + local.get $6 + i32.const 1 + i32.and local.get $4 - local.get $5 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $4 - local.get $5 - i32.const 5 + local.get $6 + i32.const 6 i32.shr_s i32.const 2 i32.shl i32.add i32.load + local.get $6 i32.const 1 - local.get $5 + i32.shr_s i32.const 31 i32.and - i32.shl - i32.xor - i32.store - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.store - local.get $0 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.store + i32.shr_u + i32.const 1 + i32.and + i32.eq + if + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|1 + end end end + local.get $6 + i32.const 1 + i32.shr_s + local.set $7 + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $8 + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $9 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $9 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $5 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store + end local.get $5 i32.const 1 i32.sub @@ -5217,146 +6825,142 @@ local.get $1 i32.const 1 i32.sub - local.set $5 + local.set $9 loop $repeat|2 - local.get $5 + local.get $9 i32.const 2 i32.ge_s i32.eqz br_if $break|2 - block - local.get $0 - i32.load - local.set $9 - local.get $0 - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - i32.load - i32.store - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.store - i32.const 1 - local.set $8 - block $break|3 - loop $continue|3 - local.get $8 - i32.const 1 - i32.shl - local.get $4 - local.get $8 - i32.const 5 - i32.shr_s + local.get $0 + i32.load + local.set $8 + local.get $0 + local.get $0 + local.get $9 + i32.const 2 + i32.shl + i32.add + i32.load + i32.store + local.get $0 + local.get $9 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + i32.const 1 + local.set $7 + block $break|3 + loop $continue|3 + local.get $7 + i32.const 1 + i32.shl + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.add + local.tee $6 + local.get $9 + i32.lt_s + if + local.get $6 + local.set $7 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $7 + i32.const 0 + i32.gt_s + if + local.get $0 + i32.load + local.set $8 + local.get $0 + local.get $7 i32.const 2 i32.shl i32.add i32.load - local.get $8 - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.add - local.tee $7 - local.get $5 + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $5 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 i32.lt_s if + local.get $4 local.get $7 - local.set $8 - br $continue|3 - end - end - end - block $break|4 - loop $continue|4 - local.get $8 - i32.const 0 - i32.gt_s - if - block - local.get $0 - i32.load - local.set $9 - local.get $0 - local.get $8 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $9 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $4 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $4 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - i32.const 1 - local.get $8 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - local.get $0 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.store - local.get $0 - local.get $6 - i32.store - end - local.get $8 - i32.const 1 - i32.shr_s - local.set $8 - end - br $continue|4 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $7 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $0 + local.get $5 + i32.store end + local.get $7 + i32.const 1 + i32.shr_s + local.set $7 + br $continue|4 end end end - local.get $5 + local.get $9 i32.const 1 i32.sub - local.set $5 + local.set $9 br $repeat|2 unreachable end unreachable end local.get $4 - call $~lib/memory/memory.free + call $~lib/rt/tlsf/__free local.get $0 i32.load offset=4 local.set $10 @@ -5368,22 +6972,12 @@ local.get $10 i32.store ) - (func $~lib/array/Array#sort (; 135 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 142 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 280 - i32.const 528 - i32.const 4 - call $~lib/builtins/abort - unreachable - end local.get $0 i32.load offset=12 local.set $2 @@ -5392,6 +6986,7 @@ i32.le_s if local.get $0 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -5426,6 +7021,7 @@ i32.store end local.get $0 + call $~lib/rt/purerc/__retain return end block $~lib/util/sort/SORT|inlined.0 @@ -5451,13 +7047,14 @@ end end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 136 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 143 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.sub ) - (func $~lib/array/Array#sort|trampoline (; 137 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline (; 144 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -5476,7 +7073,7 @@ local.get $1 call $~lib/array/Array#sort ) - (func $~lib/util/sort/insertionSort (; 138 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 145 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5491,77 +7088,73 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $3 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $4 - local.get $3 - i32.const 1 - i32.sub - local.set $5 - block $break|1 - loop $continue|1 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 local.get $5 - i32.const 0 - i32.ge_s - if - block - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $4 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $0 - block (result i32) - local.get $5 - local.tee $7 - i32.const 1 - i32.sub - local.set $5 - local.get $7 - end - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store - else - br $break|1 - end - end - br $continue|1 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + br $break|1 + end + br $continue|1 end end - local.get $0 - local.get $5 - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.store end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store local.get $3 i32.const 1 i32.add @@ -5572,7 +7165,7 @@ unreachable end ) - (func $~lib/util/sort/weakHeapSort (; 139 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 146 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5590,7 +7183,8 @@ i32.shl local.set $3 local.get $3 - call $~lib/memory/memory.allocate + i32.const 0 + call $~lib/rt/tlsf/__alloc local.set $4 local.get $4 i32.const 0 @@ -5607,107 +7201,105 @@ i32.gt_s i32.eqz br_if $break|0 - block - local.get $5 - local.set $6 - block $break|1 - loop $continue|1 - local.get $6 - i32.const 1 - i32.and - local.get $4 - local.get $6 - i32.const 6 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $6 - i32.const 1 - i32.shr_s - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.eq - if - local.get $6 - i32.const 1 - i32.shr_s - local.set $6 - br $continue|1 - end - end - end - local.get $6 - i32.const 1 - i32.shr_s - local.set $7 - local.get $0 - local.get $7 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $8 - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $9 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $8 - local.get $9 - local.get $2 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if + local.get $5 + local.set $6 + block $break|1 + loop $continue|1 + local.get $6 + i32.const 1 + i32.and local.get $4 - local.get $5 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $4 - local.get $5 - i32.const 5 + local.get $6 + i32.const 6 i32.shr_s i32.const 2 i32.shl i32.add i32.load + local.get $6 i32.const 1 - local.get $5 + i32.shr_s i32.const 31 i32.and - i32.shl - i32.xor - i32.store - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.store - local.get $0 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.store + i32.shr_u + i32.const 1 + i32.and + i32.eq + if + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|1 + end end end + local.get $6 + i32.const 1 + i32.shr_s + local.set $7 + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $8 + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $9 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $9 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $5 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store + end local.get $5 i32.const 1 i32.sub @@ -5721,146 +7313,142 @@ local.get $1 i32.const 1 i32.sub - local.set $5 + local.set $9 loop $repeat|2 - local.get $5 + local.get $9 i32.const 2 i32.ge_s i32.eqz br_if $break|2 - block - local.get $0 - i32.load - local.set $9 - local.get $0 - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - i32.load - i32.store - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.store - i32.const 1 - local.set $8 - block $break|3 - loop $continue|3 - local.get $8 - i32.const 1 - i32.shl - local.get $4 - local.get $8 - i32.const 5 - i32.shr_s + local.get $0 + i32.load + local.set $8 + local.get $0 + local.get $0 + local.get $9 + i32.const 2 + i32.shl + i32.add + i32.load + i32.store + local.get $0 + local.get $9 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + i32.const 1 + local.set $7 + block $break|3 + loop $continue|3 + local.get $7 + i32.const 1 + i32.shl + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.add + local.tee $6 + local.get $9 + i32.lt_s + if + local.get $6 + local.set $7 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $7 + i32.const 0 + i32.gt_s + if + local.get $0 + i32.load + local.set $8 + local.get $0 + local.get $7 i32.const 2 i32.shl i32.add i32.load - local.get $8 - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.add - local.tee $7 - local.get $5 + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $5 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 i32.lt_s if + local.get $4 local.get $7 - local.set $8 - br $continue|3 - end - end - end - block $break|4 - loop $continue|4 - local.get $8 - i32.const 0 - i32.gt_s - if - block - local.get $0 - i32.load - local.set $9 - local.get $0 - local.get $8 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $9 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $4 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $4 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - i32.const 1 - local.get $8 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - local.get $0 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.store - local.get $0 - local.get $6 - i32.store - end - local.get $8 - i32.const 1 - i32.shr_s - local.set $8 - end - br $continue|4 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $7 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $0 + local.get $5 + i32.store end + local.get $7 + i32.const 1 + i32.shr_s + local.set $7 + br $continue|4 end end end - local.get $5 + local.get $9 i32.const 1 i32.sub - local.set $5 + local.set $9 br $repeat|2 unreachable end unreachable end local.get $4 - call $~lib/memory/memory.free + call $~lib/rt/tlsf/__free local.get $0 i32.load offset=4 local.set $10 @@ -5872,22 +7460,12 @@ local.get $10 i32.store ) - (func $~lib/array/Array#sort (; 140 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 147 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 280 - i32.const 528 - i32.const 4 - call $~lib/builtins/abort - unreachable - end local.get $0 i32.load offset=12 local.set $2 @@ -5896,6 +7474,7 @@ i32.le_s if local.get $0 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -5930,6 +7509,7 @@ i32.store end local.get $0 + call $~lib/rt/purerc/__retain return end block $~lib/util/sort/SORT|inlined.0 @@ -5955,8 +7535,9 @@ end end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 141 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 148 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.gt_u @@ -5965,7 +7546,7 @@ i32.lt_u i32.sub ) - (func $~lib/array/Array#sort|trampoline (; 142 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline (; 149 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -5984,44 +7565,38 @@ local.get $1 call $~lib/array/Array#sort ) - (func $~lib/array/Array.create (; 143 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array.create (; 150 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) local.get $0 - global.get $~lib/util/runtime/MAX_BYTELENGTH - i32.const 2 - i32.shr_u + i32.const 268435452 i32.gt_u if - i32.const 0 - i32.const 280 - i32.const 44 - i32.const 62 + i32.const 24 + i32.const 456 + i32.const 45 + i32.const 61 call $~lib/builtins/abort unreachable end - block $~lib/util/runtime/NEWARRAY|inlined.4 (result i32) - local.get $0 - local.set $1 - local.get $1 - i32.const 2 - i32.const 17 - i32.const 0 - call $~lib/util/runtime/makeArray - end - local.set $2 - local.get $2 + local.get $0 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 i32.const 0 i32.store offset=12 - local.get $2 + local.get $1 i32.load offset=4 i32.const 0 - local.get $2 + local.get $1 i32.load offset=8 call $~lib/memory/memory.fill - local.get $2 + local.get $1 ) - (func $std/array/createReverseOrderedArray (; 144 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/createReverseOrderedArray (; 151 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -6055,15 +7630,15 @@ end local.get $1 ) - (func $~lib/math/NativeMath.random (; 145 ;) (type $FUNCSIG$d) (result f64) + (func $~lib/math/NativeMath.random (; 152 ;) (type $FUNCSIG$d) (result f64) (local $0 i64) (local $1 i64) (local $2 i64) global.get $~lib/math/random_seeded i32.eqz if - i32.const 0 - i32.const 3000 + i32.const 3904 + i32.const 3128 i32.const 1030 i32.const 24 call $~lib/builtins/abort @@ -6112,7 +7687,7 @@ f64.const 1 f64.sub ) - (func $std/array/createRandomOrderedArray (; 146 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/createRandomOrderedArray (; 153 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -6146,14 +7721,17 @@ end local.get $1 ) - (func $~lib/util/sort/COMPARATOR~anonymous|1 (; 147 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|1 (; 154 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.sub ) - (func $std/array/isSorted (; 148 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted (; 155 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop block $break|0 block i32.const 1 @@ -6185,6 +7763,8 @@ i32.const 0 i32.gt_s if + local.get $0 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -6197,92 +7777,331 @@ end unreachable end + local.get $0 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $std/array/assertSorted (; 149 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted (; 156 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#sort + local.tee $2 local.get $1 call $std/array/isSorted i32.eqz if i32.const 0 - i32.const 160 - i32.const 813 + i32.const 232 + i32.const 832 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release ) - (func $std/array/assertSortedDefault (; 150 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $std/array/assertSortedDefault (; 157 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop local.get $0 block $~lib/util/sort/COMPARATOR|inlined.1 (result i32) i32.const 48 br $~lib/util/sort/COMPARATOR|inlined.1 end call $std/array/assertSorted + local.get $0 + call $~lib/rt/purerc/__release ) - (func $start:std/array~anonymous|43 (; 151 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|43 (; 158 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.sub ) - (func $start:std/array~anonymous|44 (; 152 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|44 (; 159 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.sub ) - (func $start:std/array~anonymous|45 (; 153 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|45 (; 160 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.sub ) - (func $start:std/array~anonymous|46 (; 154 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|46 (; 161 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.sub ) - (func $~lib/array/Array.create<~lib/array/Array> (; 155 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array.create<~lib/array/Array> (; 162 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) local.get $0 - global.get $~lib/util/runtime/MAX_BYTELENGTH - i32.const 2 - i32.shr_u + i32.const 268435452 i32.gt_u if - i32.const 0 - i32.const 280 - i32.const 44 - i32.const 62 + i32.const 24 + i32.const 456 + i32.const 45 + i32.const 61 call $~lib/builtins/abort unreachable end - block $~lib/util/runtime/NEWARRAY<~lib/array/Array>|inlined.0 (result i32) - local.get $0 - local.set $1 - local.get $1 - i32.const 2 - i32.const 24 - i32.const 0 - call $~lib/util/runtime/makeArray - end - local.set $2 - local.get $2 + local.get $0 + i32.const 2 + i32.const 24 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 i32.const 0 i32.store offset=12 - local.get $2 + local.get $1 i32.load offset=4 i32.const 0 - local.get $2 + local.get $1 i32.load offset=8 call $~lib/memory/memory.fill - local.get $2 + local.get $1 ) - (func $~lib/array/Array<~lib/array/Array>#__unchecked_set (; 156 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/common/__typeinfo (; 163 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 400 + i32.const 4120 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/purerc/growRoots (; 164 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 165 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 166 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 320 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 320 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__retainRelease (; 167 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.ne + if + global.get $~lib/builtins/HEAP_BASE + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + local.get $2 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + end + local.get $0 + ) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_set (; 168 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=4 local.get $1 @@ -6291,30 +8110,19 @@ i32.add local.set $3 local.get $3 - i32.load - local.set $4 local.get $2 - local.get $4 - i32.ne - if - local.get $3 - local.get $2 - i32.store - local.get $4 - i32.const 0 - i32.ne - if - local.get $4 - local.get $0 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 - local.get $0 - call $~lib/collector/dummy/__ref_link - end + local.get $3 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $2 + call $~lib/rt/purerc/__release ) - (func $~lib/array/Array<~lib/array/Array>#__set (; 157 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array<~lib/array/Array>#__set (; 169 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 local.set $3 @@ -6322,11 +8130,17 @@ local.get $3 i32.gt_u if - i32.const 0 - i32.const 280 - i32.const 111 - i32.const 38 - call $~lib/builtins/abort + local.get $2 + call $~lib/rt/purerc/__release + block + i32.const 4008 + i32.const 456 + i32.const 112 + i32.const 38 + call $~lib/builtins/abort + unreachable + unreachable + end unreachable end local.get $0 @@ -6334,7 +8148,7 @@ i32.const 1 i32.add i32.const 2 - call $~lib/array/ensureCapacity + call $~lib/array/ensureSize local.get $0 local.get $1 local.get $2 @@ -6349,8 +8163,10 @@ i32.add i32.store offset=12 end + local.get $2 + call $~lib/rt/purerc/__release ) - (func $std/array/createReverseOrderedNestedArray (; 158 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/createReverseOrderedNestedArray (; 170 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -6366,23 +8182,23 @@ i32.lt_s i32.eqz br_if $break|0 - block - i32.const 1 - call $~lib/array/Array.create - local.set $3 - local.get $3 - i32.const 0 - local.get $0 - i32.const 1 - i32.sub - local.get $2 - i32.sub - call $~lib/array/Array#__set - local.get $1 - local.get $2 - local.get $3 - call $~lib/array/Array<~lib/array/Array>#__set - end + i32.const 1 + call $~lib/array/Array.create + local.set $3 + local.get $3 + i32.const 0 + local.get $0 + i32.const 1 + i32.sub + local.get $2 + i32.sub + call $~lib/array/Array#__set + local.get $1 + local.get $2 + local.get $3 + call $~lib/array/Array<~lib/array/Array>#__set + local.get $3 + call $~lib/rt/purerc/__release local.get $2 i32.const 1 i32.add @@ -6394,7 +8210,14 @@ end local.get $1 ) - (func $start:std/array~anonymous|47 (; 159 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|47 (; 171 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 0 call $~lib/array/Array#__get @@ -6402,8 +8225,14 @@ i32.const 0 call $~lib/array/Array#__get i32.sub + local.set $2 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 ) - (func $~lib/util/sort/insertionSort<~lib/array/Array> (; 160 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort<~lib/array/Array> (; 172 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -6418,77 +8247,81 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $3 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $4 - local.get $3 - i32.const 1 - i32.sub - local.set $5 - block $break|1 - loop $continue|1 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 local.get $5 - i32.const 0 - i32.ge_s - if - block - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $4 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $0 - block (result i32) - local.get $5 - local.tee $7 - i32.const 1 - i32.sub - local.set $5 - local.get $7 - end - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store - else - br $break|1 - end - end - br $continue|1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + local.get $6 + call $~lib/rt/purerc/__release + br $break|1 + end + local.get $6 + call $~lib/rt/purerc/__release + br $continue|1 end end - local.get $0 - local.get $5 - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.store end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store + local.get $4 + call $~lib/rt/purerc/__release local.get $3 i32.const 1 i32.add @@ -6499,22 +8332,12 @@ unreachable end ) - (func $~lib/array/Array<~lib/array/Array>#sort (; 161 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#sort (; 173 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 280 - i32.const 528 - i32.const 4 - call $~lib/builtins/abort - unreachable - end local.get $0 i32.load offset=12 local.set $2 @@ -6523,6 +8346,7 @@ i32.le_s if local.get $0 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -6534,9 +8358,11 @@ if local.get $3 i32.load offset=4 + call $~lib/rt/purerc/__retain local.set $4 local.get $3 i32.load + call $~lib/rt/purerc/__retain local.set $5 block (result i32) i32.const 2 @@ -6557,6 +8383,13 @@ i32.store end local.get $0 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $6 return end block $~lib/util/sort/SORT<~lib/array/Array>|inlined.0 @@ -6572,12 +8405,13 @@ call $~lib/util/sort/insertionSort<~lib/array/Array> end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array<~lib/array/Array>#get:length (; 162 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#get:length (; 174 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array<~lib/array/Array>#__unchecked_get (; 163 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_get (; 175 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -6585,16 +8419,17 @@ i32.shl i32.add i32.load + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array<~lib/array/Array>#__get (; 164 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#__get (; 176 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=12 i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 96 + i32.const 4008 + i32.const 456 + i32.const 97 i32.const 45 call $~lib/builtins/abort unreachable @@ -6606,9 +8441,9 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 99 + i32.const 400 + i32.const 456 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable @@ -6617,9 +8452,14 @@ local.get $1 call $~lib/array/Array<~lib/array/Array>#__unchecked_get ) - (func $std/array/isSorted<~lib/array/Array> (; 165 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted<~lib/array/Array> (; 177 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop block $break|0 block i32.const 1 @@ -6642,18 +8482,30 @@ i32.const 1 i32.sub call $~lib/array/Array<~lib/array/Array>#__get + local.tee $4 local.get $0 local.get $2 call $~lib/array/Array<~lib/array/Array>#__get + local.tee $5 local.get $1 call_indirect (type $FUNCSIG$iii) end i32.const 0 i32.gt_s if + local.get $0 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release i32.const 0 return end + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release local.get $2 i32.const 1 i32.add @@ -6663,69 +8515,74 @@ end unreachable end + local.get $0 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $std/array/assertSorted<~lib/array/Array> (; 166 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/array/Array> (; 178 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array<~lib/array/Array>#sort + local.tee $2 local.get $1 call $std/array/isSorted<~lib/array/Array> i32.eqz if i32.const 0 - i32.const 160 - i32.const 813 + i32.const 232 + i32.const 832 i32.const 2 call $~lib/builtins/abort unreachable end - ) - (func $~lib/array/Array.create> (; 167 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) + local.get $2 + call $~lib/rt/purerc/__release local.get $0 - global.get $~lib/util/runtime/MAX_BYTELENGTH - i32.const 2 - i32.shr_u + call $~lib/rt/purerc/__release + ) + (func $~lib/array/Array.create> (; 179 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 268435452 i32.gt_u if - i32.const 0 - i32.const 280 - i32.const 44 - i32.const 62 + i32.const 24 + i32.const 456 + i32.const 45 + i32.const 61 call $~lib/builtins/abort unreachable end - block $~lib/util/runtime/NEWARRAY>|inlined.0 (result i32) - local.get $0 - local.set $1 - local.get $1 - i32.const 2 - i32.const 26 - i32.const 0 - call $~lib/util/runtime/makeArray - end - local.set $2 - local.get $2 + local.get $0 + i32.const 2 + i32.const 26 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 i32.const 0 i32.store offset=12 - local.get $2 + local.get $1 i32.load offset=4 i32.const 0 - local.get $2 + local.get $1 i32.load offset=8 call $~lib/memory/memory.fill - local.get $2 + local.get $1 ) - (func $std/array/Proxy#constructor (; 168 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/Proxy#constructor (; 180 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/util/runtime/allocate i32.const 25 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -6733,9 +8590,11 @@ i32.store local.get $0 ) - (func $~lib/array/Array>#__unchecked_set (; 169 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array>#__unchecked_set (; 181 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - (local $4 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=4 local.get $1 @@ -6744,30 +8603,19 @@ i32.add local.set $3 local.get $3 - i32.load - local.set $4 local.get $2 - local.get $4 - i32.ne - if - local.get $3 - local.get $2 - i32.store - local.get $4 - i32.const 0 - i32.ne - if - local.get $4 - local.get $0 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 - local.get $0 - call $~lib/collector/dummy/__ref_link - end + local.get $3 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $2 + call $~lib/rt/purerc/__release ) - (func $~lib/array/Array>#__set (; 170 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array>#__set (; 182 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 local.set $3 @@ -6775,11 +8623,17 @@ local.get $3 i32.gt_u if - i32.const 0 - i32.const 280 - i32.const 111 - i32.const 38 - call $~lib/builtins/abort + local.get $2 + call $~lib/rt/purerc/__release + block + i32.const 4008 + i32.const 456 + i32.const 112 + i32.const 38 + call $~lib/builtins/abort + unreachable + unreachable + end unreachable end local.get $0 @@ -6787,7 +8641,7 @@ i32.const 1 i32.add i32.const 2 - call $~lib/array/ensureCapacity + call $~lib/array/ensureSize local.get $0 local.get $1 local.get $2 @@ -6802,10 +8656,13 @@ i32.add i32.store offset=12 end + local.get $2 + call $~lib/rt/purerc/__release ) - (func $std/array/createReverseOrderedElementsArray (; 171 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/createReverseOrderedElementsArray (; 183 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) + (local $3 i32) local.get $0 call $~lib/array/Array.create> local.set $1 @@ -6827,7 +8684,10 @@ local.get $2 i32.sub call $std/array/Proxy#constructor + local.tee $3 call $~lib/array/Array>#__set + local.get $3 + call $~lib/rt/purerc/__release local.get $2 i32.const 1 i32.add @@ -6839,14 +8699,27 @@ end local.get $1 ) - (func $start:std/array~anonymous|48 (; 172 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|48 (; 184 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load local.get $1 i32.load i32.sub + local.set $2 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 ) - (func $~lib/util/sort/insertionSort> (; 173 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort> (; 185 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -6861,77 +8734,81 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $3 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $4 - local.get $3 - i32.const 1 - i32.sub - local.set $5 - block $break|1 - loop $continue|1 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 local.get $5 - i32.const 0 - i32.ge_s - if - block - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $4 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $0 - block (result i32) - local.get $5 - local.tee $7 - i32.const 1 - i32.sub - local.set $5 - local.get $7 - end - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store - else - br $break|1 - end - end - br $continue|1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + local.get $6 + call $~lib/rt/purerc/__release + br $break|1 + end + local.get $6 + call $~lib/rt/purerc/__release + br $continue|1 end end - local.get $0 - local.get $5 - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.store end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store + local.get $4 + call $~lib/rt/purerc/__release local.get $3 i32.const 1 i32.add @@ -6942,22 +8819,12 @@ unreachable end ) - (func $~lib/array/Array>#sort (; 174 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#sort (; 186 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 280 - i32.const 528 - i32.const 4 - call $~lib/builtins/abort - unreachable - end local.get $0 i32.load offset=12 local.set $2 @@ -6966,6 +8833,7 @@ i32.le_s if local.get $0 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -6977,9 +8845,11 @@ if local.get $3 i32.load offset=4 + call $~lib/rt/purerc/__retain local.set $4 local.get $3 i32.load + call $~lib/rt/purerc/__retain local.set $5 block (result i32) i32.const 2 @@ -7000,6 +8870,13 @@ i32.store end local.get $0 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $6 return end block $~lib/util/sort/SORT>|inlined.0 @@ -7015,12 +8892,13 @@ call $~lib/util/sort/insertionSort> end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array>#get:length (; 175 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array>#get:length (; 187 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array>#__unchecked_get (; 176 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#__unchecked_get (; 188 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -7028,16 +8906,17 @@ i32.shl i32.add i32.load + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array>#__get (; 177 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#__get (; 189 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=12 i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 96 + i32.const 4008 + i32.const 456 + i32.const 97 i32.const 45 call $~lib/builtins/abort unreachable @@ -7049,9 +8928,9 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 99 + i32.const 400 + i32.const 456 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable @@ -7060,9 +8939,14 @@ local.get $1 call $~lib/array/Array>#__unchecked_get ) - (func $std/array/isSorted> (; 178 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted> (; 190 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop block $break|0 block i32.const 1 @@ -7085,18 +8969,30 @@ i32.const 1 i32.sub call $~lib/array/Array>#__get + local.tee $4 local.get $0 local.get $2 call $~lib/array/Array>#__get + local.tee $5 local.get $1 call_indirect (type $FUNCSIG$iii) end i32.const 0 i32.gt_s if + local.get $0 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release i32.const 0 return end + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release local.get $2 i32.const 1 i32.add @@ -7106,25 +9002,36 @@ end unreachable end + local.get $0 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $std/array/assertSorted> (; 179 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted> (; 191 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array>#sort + local.tee $2 local.get $1 call $std/array/isSorted> i32.eqz if i32.const 0 - i32.const 160 - i32.const 813 + i32.const 232 + i32.const 832 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/util/sort/insertionSort<~lib/string/String | null> (; 180 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort<~lib/string/String | null> (; 192 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -7139,77 +9046,81 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $3 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $4 - local.get $3 - i32.const 1 - i32.sub - local.set $5 - block $break|1 - loop $continue|1 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 local.get $5 - i32.const 0 - i32.ge_s - if - block - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $4 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $0 - block (result i32) - local.get $5 - local.tee $7 - i32.const 1 - i32.sub - local.set $5 - local.get $7 - end - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store - else - br $break|1 - end - end - br $continue|1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + local.get $6 + call $~lib/rt/purerc/__release + br $break|1 + end + local.get $6 + call $~lib/rt/purerc/__release + br $continue|1 end end - local.get $0 - local.get $5 - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.store end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store + local.get $4 + call $~lib/rt/purerc/__release local.get $3 i32.const 1 i32.add @@ -7220,22 +9131,12 @@ unreachable end ) - (func $~lib/array/Array<~lib/string/String | null>#sort (; 181 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#sort (; 193 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 280 - i32.const 528 - i32.const 4 - call $~lib/builtins/abort - unreachable - end local.get $0 i32.load offset=12 local.set $2 @@ -7244,6 +9145,7 @@ i32.le_s if local.get $0 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -7255,9 +9157,11 @@ if local.get $3 i32.load offset=4 + call $~lib/rt/purerc/__retain local.set $4 local.get $3 i32.load + call $~lib/rt/purerc/__retain local.set $5 block (result i32) i32.const 2 @@ -7278,6 +9182,13 @@ i32.store end local.get $0 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $6 return end block $~lib/util/sort/SORT<~lib/string/String | null>|inlined.0 @@ -7293,12 +9204,13 @@ call $~lib/util/sort/insertionSort<~lib/string/String | null> end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array<~lib/string/String | null>#get:length (; 182 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#get:length (; 194 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array<~lib/string/String | null>#__unchecked_get (; 183 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#__unchecked_get (; 195 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -7306,8 +9218,9 @@ i32.shl i32.add i32.load + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array<~lib/string/String | null>#__get (; 184 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#__get (; 196 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -7315,9 +9228,9 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 99 + i32.const 400 + i32.const 456 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable @@ -7326,9 +9239,14 @@ local.get $1 call $~lib/array/Array<~lib/string/String | null>#__unchecked_get ) - (func $std/array/isSorted<~lib/string/String | null> (; 185 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted<~lib/string/String | null> (; 197 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop block $break|0 block i32.const 1 @@ -7351,18 +9269,30 @@ i32.const 1 i32.sub call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $4 local.get $0 local.get $2 call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $5 local.get $1 call_indirect (type $FUNCSIG$iii) end i32.const 0 i32.gt_s if + local.get $0 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release i32.const 0 return end + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release local.get $2 i32.const 1 i32.add @@ -7372,36 +9302,53 @@ end unreachable end + local.get $0 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $std/array/assertSorted<~lib/string/String | null> (; 186 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/string/String | null> (; 198 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array<~lib/string/String | null>#sort + local.tee $2 local.get $1 call $std/array/isSorted<~lib/string/String | null> i32.eqz if i32.const 0 - i32.const 160 - i32.const 813 + i32.const 232 + i32.const 832 i32.const 2 call $~lib/builtins/abort unreachable end - ) - (func $~lib/string/String#get:length (; 187 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $2 + call $~lib/rt/purerc/__release local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE + call $~lib/rt/purerc/__release + ) + (func $~lib/string/String#get:length (; 199 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 i32.sub - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.shr_u ) - (func $~lib/util/string/compareImpl (; 188 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (func $~lib/util/string/compareImpl (; 200 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) (local $6 i32) (local $7 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $2 + call $~lib/rt/purerc/__retain + drop i32.const 0 local.set $5 local.get $0 @@ -7431,32 +9378,40 @@ i32.const 0 end if - block - local.get $4 - i32.const 1 - i32.sub - local.set $4 - local.get $6 - i32.const 2 - i32.add - local.set $6 - local.get $7 - i32.const 2 - i32.add - local.set $7 - end + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $6 + i32.const 2 + i32.add + local.set $6 + local.get $7 + i32.const 2 + i32.add + local.set $7 br $continue|0 end end end + local.get $0 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release local.get $5 ) - (func $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 (; 189 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 (; 201 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 local.get $1 i32.eq if (result i32) @@ -7474,6 +9429,10 @@ i32.eq end if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -7492,22 +9451,38 @@ i32.const 0 end if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end local.get $2 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const -1 return end local.get $3 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 i32.const 0 local.get $1 i32.const 0 @@ -7521,7 +9496,7 @@ select call $~lib/util/string/compareImpl ) - (func $std/array/assertSorted<~lib/string/String | null>|trampoline (; 190 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/string/String | null>|trampoline (; 202 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) block $1of1 block $0of1 block $outOfRange @@ -7542,12 +9517,22 @@ local.get $1 call $std/array/assertSorted<~lib/string/String | null> ) - (func $~lib/string/String.__eq (; 191 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 203 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 local.get $1 i32.eq if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end @@ -7562,6 +9547,10 @@ i32.eq end if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -7573,10 +9562,18 @@ call $~lib/string/String#get:length i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 i32.const 0 local.get $1 i32.const 0 @@ -7584,14 +9581,32 @@ call $~lib/util/string/compareImpl i32.eqz ) - (func $~lib/string/String.__ne (; 192 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__ne (; 204 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release local.get $0 local.get $1 call $~lib/string/String.__eq i32.eqz ) - (func $std/array/isArraysEqual<~lib/string/String | null> (; 193 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual<~lib/string/String | null> (; 205 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $2 i32.eqz if @@ -7603,6 +9618,10 @@ call $~lib/array/Array<~lib/string/String | null>#get:length i32.ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -7610,6 +9629,10 @@ local.get $1 i32.eq if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end @@ -7626,14 +9649,28 @@ local.get $0 local.get $3 call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $4 local.get $1 local.get $3 call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $5 call $~lib/string/String.__ne if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release i32.const 0 return end + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release local.get $3 i32.const 1 i32.add @@ -7643,46 +9680,44 @@ end unreachable end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $~lib/array/Array.create<~lib/string/String> (; 194 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array.create<~lib/string/String> (; 206 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) local.get $0 - global.get $~lib/util/runtime/MAX_BYTELENGTH - i32.const 2 - i32.shr_u + i32.const 268435452 i32.gt_u if - i32.const 0 - i32.const 280 - i32.const 44 - i32.const 62 + i32.const 24 + i32.const 456 + i32.const 45 + i32.const 61 call $~lib/builtins/abort unreachable end - block $~lib/util/runtime/NEWARRAY<~lib/string/String>|inlined.0 (result i32) - local.get $0 - local.set $1 - local.get $1 - i32.const 2 - i32.const 28 - i32.const 0 - call $~lib/util/runtime/makeArray - end - local.set $2 - local.get $2 + local.get $0 + i32.const 2 + i32.const 28 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 i32.const 0 i32.store offset=12 - local.get $2 + local.get $1 i32.load offset=4 i32.const 0 - local.get $2 + local.get $1 i32.load offset=8 call $~lib/memory/memory.fill - local.get $2 + local.get $1 ) - (func $~lib/string/String#charAt (; 195 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#charAt (; 207 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 0 @@ -7691,7 +9726,7 @@ if i32.const 0 i32.const 4384 - i32.const 47 + i32.const 40 i32.const 4 call $~lib/builtins/abort unreachable @@ -7701,11 +9736,13 @@ call $~lib/string/String#get:length i32.ge_u if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain return end i32.const 2 - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $2 local.get $2 local.get $0 @@ -7716,19 +9753,24 @@ i32.load16_u i32.store16 local.get $2 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/string/String#concat (; 196 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 208 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $1 i32.const 0 i32.eq if i32.const 4432 + local.get $1 + call $~lib/rt/purerc/__retainRelease local.set $1 end local.get $0 @@ -7749,27 +9791,43 @@ i32.const 0 i32.eq if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end local.get $4 - call $~lib/util/runtime/allocate - local.set $5 - local.get $5 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $6 + local.get $6 local.get $0 local.get $2 call $~lib/memory/memory.copy - local.get $5 + local.get $6 local.get $2 i32.add local.get $1 local.get $3 call $~lib/memory/memory.copy + local.get $6 + local.set $5 + local.get $1 + call $~lib/rt/purerc/__release local.get $5 - i32.const 16 - call $~lib/util/runtime/register ) - (func $~lib/string/String.__concat (; 197 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 209 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 4432 local.get $0 @@ -7778,12 +9836,21 @@ select local.get $1 call $~lib/string/String#concat + local.set $2 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 ) - (func $std/array/createRandomString (; 198 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/createRandomString (; 210 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 f64) - i32.const 4208 + (local $4 i32) + (local $5 i32) + i32.const 4272 + call $~lib/rt/purerc/__retain local.set $1 block $break|0 i32.const 0 @@ -7808,8 +9875,16 @@ end i32.trunc_f64_s call $~lib/string/String#charAt + local.tee $4 call $~lib/string/String.__concat + local.tee $5 + local.get $1 + call $~lib/rt/purerc/__retainRelease local.set $1 + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release local.get $2 i32.const 1 i32.add @@ -7821,9 +9896,11 @@ end local.get $1 ) - (func $~lib/array/Array<~lib/string/String>#__unchecked_set (; 199 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array<~lib/string/String>#__unchecked_set (; 211 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - (local $4 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=4 local.get $1 @@ -7832,30 +9909,19 @@ i32.add local.set $3 local.get $3 - i32.load - local.set $4 local.get $2 - local.get $4 - i32.ne - if - local.get $3 - local.get $2 - i32.store - local.get $4 - i32.const 0 - i32.ne - if - local.get $4 - local.get $0 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 - local.get $0 - call $~lib/collector/dummy/__ref_link - end + local.get $3 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $2 + call $~lib/rt/purerc/__release ) - (func $~lib/array/Array<~lib/string/String>#__set (; 200 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array<~lib/string/String>#__set (; 212 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 local.set $3 @@ -7863,11 +9929,17 @@ local.get $3 i32.gt_u if - i32.const 0 - i32.const 280 - i32.const 111 - i32.const 38 - call $~lib/builtins/abort + local.get $2 + call $~lib/rt/purerc/__release + block + i32.const 4008 + i32.const 456 + i32.const 112 + i32.const 38 + call $~lib/builtins/abort + unreachable + unreachable + end unreachable end local.get $0 @@ -7875,7 +9947,7 @@ i32.const 1 i32.add i32.const 2 - call $~lib/array/ensureCapacity + call $~lib/array/ensureSize local.get $0 local.get $1 local.get $2 @@ -7890,10 +9962,13 @@ i32.add i32.store offset=12 end + local.get $2 + call $~lib/rt/purerc/__release ) - (func $std/array/createRandomStringArray (; 201 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/createRandomStringArray (; 213 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) + (local $3 i32) local.get $0 call $~lib/array/Array.create<~lib/string/String> local.set $1 @@ -7913,7 +9988,10 @@ f64.mul i32.trunc_f64_s call $std/array/createRandomString + local.tee $3 call $~lib/array/Array<~lib/string/String>#__set + local.get $3 + call $~lib/rt/purerc/__release local.get $2 i32.const 1 i32.add @@ -7925,7 +10003,7 @@ end local.get $1 ) - (func $~lib/util/sort/insertionSort<~lib/string/String> (; 202 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort<~lib/string/String> (; 214 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -7940,77 +10018,81 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $3 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $4 - local.get $3 - i32.const 1 - i32.sub - local.set $5 - block $break|1 - loop $continue|1 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 local.get $5 - i32.const 0 - i32.ge_s - if - block - local.get $0 - local.get $5 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $4 - local.get $6 - local.get $2 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $0 - block (result i32) - local.get $5 - local.tee $7 - i32.const 1 - i32.sub - local.set $5 - local.get $7 - end - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store - else - br $break|1 - end - end - br $continue|1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + local.get $6 + call $~lib/rt/purerc/__release + br $break|1 + end + local.get $6 + call $~lib/rt/purerc/__release + br $continue|1 end end - local.get $0 - local.get $5 - i32.const 1 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.store end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store + local.get $4 + call $~lib/rt/purerc/__release local.get $3 i32.const 1 i32.add @@ -8021,22 +10103,12 @@ unreachable end ) - (func $~lib/array/Array<~lib/string/String>#sort (; 203 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#sort (; 215 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 280 - i32.const 528 - i32.const 4 - call $~lib/builtins/abort - unreachable - end local.get $0 i32.load offset=12 local.set $2 @@ -8045,6 +10117,7 @@ i32.le_s if local.get $0 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -8056,9 +10129,11 @@ if local.get $3 i32.load offset=4 + call $~lib/rt/purerc/__retain local.set $4 local.get $3 i32.load + call $~lib/rt/purerc/__retain local.set $5 block (result i32) i32.const 2 @@ -8079,6 +10154,13 @@ i32.store end local.get $0 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $6 return end block $~lib/util/sort/SORT<~lib/string/String>|inlined.0 @@ -8094,12 +10176,13 @@ call $~lib/util/sort/insertionSort<~lib/string/String> end local.get $0 + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array<~lib/string/String>#get:length (; 204 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#get:length (; 216 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 205 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 217 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -8107,16 +10190,17 @@ i32.shl i32.add i32.load + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array<~lib/string/String>#__get (; 206 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#__get (; 218 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=12 i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 96 + i32.const 4008 + i32.const 456 + i32.const 97 i32.const 45 call $~lib/builtins/abort unreachable @@ -8128,9 +10212,9 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 280 - i32.const 99 + i32.const 400 + i32.const 456 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable @@ -8139,9 +10223,14 @@ local.get $1 call $~lib/array/Array<~lib/string/String>#__unchecked_get ) - (func $std/array/isSorted<~lib/string/String> (; 207 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted<~lib/string/String> (; 219 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop block $break|0 block i32.const 1 @@ -8164,18 +10253,30 @@ i32.const 1 i32.sub call $~lib/array/Array<~lib/string/String>#__get + local.tee $4 local.get $0 local.get $2 call $~lib/array/Array<~lib/string/String>#__get + local.tee $5 local.get $1 call_indirect (type $FUNCSIG$iii) end i32.const 0 i32.gt_s if + local.get $0 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release i32.const 0 return end + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release local.get $2 i32.const 1 i32.add @@ -8185,30 +10286,47 @@ end unreachable end + local.get $0 + call $~lib/rt/purerc/__release i32.const 1 ) - (func $std/array/assertSorted<~lib/string/String> (; 208 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/string/String> (; 220 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array<~lib/string/String>#sort + local.tee $2 local.get $1 call $std/array/isSorted<~lib/string/String> i32.eqz if i32.const 0 - i32.const 160 - i32.const 813 + i32.const 232 + i32.const 832 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0 (; 209 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0 (; 221 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 local.get $1 i32.eq if (result i32) @@ -8226,6 +10344,10 @@ i32.eq end if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -8244,22 +10366,38 @@ i32.const 0 end if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end local.get $2 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const -1 return end local.get $3 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 i32.const 0 local.get $1 i32.const 0 @@ -8273,7 +10411,7 @@ select call $~lib/util/string/compareImpl ) - (func $std/array/assertSorted<~lib/string/String>|trampoline (; 210 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/string/String>|trampoline (; 222 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) block $1of1 block $0of1 block $outOfRange @@ -8294,7 +10432,7 @@ local.get $1 call $std/array/assertSorted<~lib/string/String> ) - (func $~lib/string/String#substring (; 211 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#substring (; 223 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -8310,7 +10448,7 @@ if i32.const 0 i32.const 4384 - i32.const 203 + i32.const 196 i32.const 4 call $~lib/builtins/abort unreachable @@ -8379,7 +10517,8 @@ local.get $3 i32.eqz if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain return end local.get $8 @@ -8396,10 +10535,12 @@ end if local.get $0 + call $~lib/rt/purerc/__retain return end local.get $3 - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $10 local.get $10 local.get $0 @@ -8408,44 +10549,9 @@ local.get $3 call $~lib/memory/memory.copy local.get $10 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/util/runtime/discard (; 212 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - local.get $0 - global.get $~lib/memory/HEAP_BASE - i32.gt_u - i32.eqz - if - i32.const 0 - i32.const 80 - i32.const 115 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.sub - local.set $1 - local.get $1 - i32.load - global.get $~lib/util/runtime/HEADER_MAGIC - i32.eq - i32.eqz - if - i32.const 0 - i32.const 80 - i32.const 117 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - call $~lib/memory/memory.free - ) - (func $~lib/array/Array#join_bool (; 213 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_bool (; 224 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8455,6 +10561,9 @@ (local $8 i32) (local $9 i32) (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -8464,162 +10573,184 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if i32.const 4480 i32.const 4504 - local.get $3 + local.get $4 i32.load8_u select + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $1 call $~lib/string/String#get:length - local.set $4 - i32.const 5 local.set $5 + i32.const 5 + local.set $6 + local.get $6 local.get $5 - local.get $4 i32.add local.get $2 i32.mul - local.get $5 - i32.add - local.set $6 local.get $6 + i32.add + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $7 - i32.const 0 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $8 + i32.const 0 + local.set $9 block $break|0 i32.const 0 - local.set $10 + local.set $3 loop $repeat|0 - local.get $10 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $3 - local.get $10 - i32.add - i32.load8_u - local.set $9 - i32.const 4 - local.get $9 - i32.const 0 - i32.ne - i32.eqz - i32.add - local.set $5 - local.get $7 + local.get $4 + local.get $3 + i32.add + i32.load8_u + local.set $10 + i32.const 4 + local.get $10 + i32.const 0 + i32.ne + i32.eqz + i32.add + local.set $6 + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + i32.const 4480 + i32.const 4504 + local.get $10 + select + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + local.get $5 + if local.get $8 + local.get $9 i32.const 1 i32.shl i32.add - i32.const 4480 - i32.const 4504 - local.get $9 - select + local.get $1 local.get $5 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $8 + local.get $9 local.get $5 i32.add - local.set $8 - local.get $4 - if - local.get $7 - local.get $8 - i32.const 1 - i32.shl - i32.add - local.get $1 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $8 - local.get $4 - i32.add - local.set $8 - end + local.set $9 end - local.get $10 + local.get $3 i32.const 1 i32.add - local.set $10 + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $3 + local.get $4 local.get $2 i32.add i32.load8_u - local.set $9 + local.set $10 i32.const 4 - local.get $9 + local.get $10 i32.const 0 i32.ne i32.eqz i32.add - local.set $5 - local.get $7 + local.set $6 local.get $8 + local.get $9 i32.const 1 i32.shl i32.add i32.const 4480 i32.const 4504 - local.get $9 + local.get $10 select - local.get $5 + local.get $6 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $8 - local.get $5 - i32.add - local.set $8 + local.get $9 local.get $6 - local.get $8 + i32.add + local.set $9 + local.get $7 + local.get $9 i32.gt_s if - local.get $7 - i32.const 0 local.get $8 + i32.const 0 + local.get $9 call $~lib/string/String#substring - local.set $10 - local.get $7 - call $~lib/util/runtime/discard - local.get $10 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end - local.get $7 - i32.const 16 - call $~lib/util/runtime/register + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#join (; 214 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 225 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#join_bool + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/util/number/decimalCount32 (; 215 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/decimalCount32 (; 226 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 100000 @@ -8688,7 +10819,7 @@ unreachable unreachable ) - (func $~lib/util/number/utoa32_lut (; 216 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/number/utoa32_lut (; 227 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -8696,7 +10827,7 @@ (local $7 i32) (local $8 i64) (local $9 i64) - i32.const 5096 + i32.const 5072 i32.load offset=4 local.set $3 block $break|0 @@ -8705,55 +10836,53 @@ i32.const 10000 i32.ge_u if - block - local.get $1 - i32.const 10000 - i32.div_u - local.set $4 - local.get $1 - i32.const 10000 - i32.rem_u - local.set $5 - local.get $4 - local.set $1 - local.get $5 - i32.const 100 - i32.div_u - local.set $6 - local.get $5 - i32.const 100 - i32.rem_u - local.set $7 - local.get $3 - local.get $6 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $8 - local.get $3 - local.get $7 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $9 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $8 - local.get $9 - i64.const 32 - i64.shl - i64.or - i64.store - end + local.get $1 + i32.const 10000 + i32.div_u + local.set $4 + local.get $1 + i32.const 10000 + i32.rem_u + local.set $5 + local.get $4 + local.set $1 + local.get $5 + i32.const 100 + i32.div_u + local.set $6 + local.get $5 + i32.const 100 + i32.rem_u + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $8 + local.get $3 + local.get $7 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $9 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $8 + local.get $9 + i64.const 32 + i64.shl + i64.or + i64.store br $continue|0 end end @@ -8831,7 +10960,7 @@ i32.store16 end ) - (func $~lib/util/number/itoa32 (; 217 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (; 228 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -8841,7 +10970,8 @@ local.get $0 i32.eqz if - i32.const 4656 + i32.const 4632 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -8863,7 +10993,8 @@ local.get $2 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $3 block $~lib/util/number/utoa32_core|inlined.0 local.get $3 @@ -8884,15 +11015,14 @@ i32.store16 end local.get $3 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/itoa (; 218 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa (; 229 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 call $~lib/util/number/itoa32 return ) - (func $~lib/util/number/itoa_stream (; 219 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 230 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -8951,7 +11081,7 @@ end local.get $3 ) - (func $~lib/array/Array#join_int (; 220 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 231 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8960,6 +11090,10 @@ (local $7 i32) (local $8 i32) (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -8969,128 +11103,153 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - local.get $3 + local.get $4 i32.load call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end local.get $1 call $~lib/string/String#get:length - local.set $4 + local.set $6 i32.const 11 - local.get $4 + local.get $6 i32.add local.get $2 i32.mul i32.const 11 i32.add - local.set $5 - local.get $5 + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $6 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $7 + local.set $9 block $break|0 i32.const 0 - local.set $9 + local.set $3 loop $repeat|0 - local.get $9 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $3 - local.get $9 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $8 - local.get $7 - local.get $6 - local.get $7 - local.get $8 - call $~lib/util/number/itoa_stream - i32.add - local.set $7 - local.get $4 - if - local.get $6 - local.get $7 - i32.const 1 - i32.shl - i32.add - local.get $1 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $7 - local.get $4 - i32.add - local.set $7 - end - end + local.get $4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $10 local.get $9 - i32.const 1 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream i32.add local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $3 + local.get $4 local.get $2 i32.const 2 i32.shl i32.add i32.load - local.set $8 - local.get $7 - local.get $6 - local.get $7 + local.set $10 + local.get $9 local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream i32.add - local.set $7 - local.get $5 + local.set $9 local.get $7 + local.get $9 i32.gt_s if - local.get $6 + local.get $8 i32.const 0 - local.get $7 - call $~lib/string/String#substring - local.set $9 - local.get $6 - call $~lib/util/runtime/discard local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end - local.get $6 - i32.const 16 - call $~lib/util/runtime/register + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#join (; 221 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 232 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/util/number/utoa32 (; 222 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/utoa32 (; 233 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -9099,7 +11258,8 @@ local.get $0 i32.eqz if - i32.const 4656 + i32.const 4632 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -9108,7 +11268,8 @@ local.get $1 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $2 block $~lib/util/number/utoa32_core|inlined.2 local.get $2 @@ -9123,15 +11284,14 @@ call $~lib/util/number/utoa32_lut end local.get $2 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/itoa (; 223 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa (; 234 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 call $~lib/util/number/utoa32 return ) - (func $~lib/util/number/itoa_stream (; 224 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 235 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -9170,7 +11330,7 @@ end local.get $3 ) - (func $~lib/array/Array#join_int (; 225 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 236 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9179,6 +11339,10 @@ (local $7 i32) (local $8 i32) (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -9188,135 +11352,160 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - local.get $3 + local.get $4 i32.load call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end local.get $1 call $~lib/string/String#get:length - local.set $4 + local.set $6 i32.const 10 - local.get $4 + local.get $6 i32.add local.get $2 i32.mul i32.const 10 i32.add - local.set $5 - local.get $5 + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $6 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $7 + local.set $9 block $break|0 i32.const 0 - local.set $9 + local.set $3 loop $repeat|0 - local.get $9 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $3 - local.get $9 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $8 - local.get $7 - local.get $6 - local.get $7 - local.get $8 - call $~lib/util/number/itoa_stream - i32.add - local.set $7 - local.get $4 - if - local.get $6 - local.get $7 - i32.const 1 - i32.shl - i32.add - local.get $1 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $7 - local.get $4 - i32.add - local.set $7 - end - end + local.get $4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $10 local.get $9 - i32.const 1 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream i32.add local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $3 + local.get $4 local.get $2 i32.const 2 i32.shl i32.add i32.load - local.set $8 - local.get $7 - local.get $6 - local.get $7 + local.set $10 + local.get $9 local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream i32.add - local.set $7 - local.get $5 + local.set $9 local.get $7 + local.get $9 i32.gt_s if - local.get $6 + local.get $8 i32.const 0 - local.get $7 - call $~lib/string/String#substring - local.set $9 - local.get $6 - call $~lib/util/runtime/discard local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end - local.get $6 - i32.const 16 - call $~lib/util/runtime/register + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#join (; 226 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 237 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/builtins/isFinite (; 227 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/builtins/isFinite (; 238 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 local.get $0 f64.sub f64.const 0 f64.eq ) - (func $~lib/array/Array#__unchecked_get (; 228 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (func $~lib/array/Array#__unchecked_get (; 239 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) local.get $0 i32.load offset=4 local.get $1 @@ -9325,7 +11514,7 @@ i32.add i64.load ) - (func $~lib/array/Array#__unchecked_get (; 229 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 240 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -9334,7 +11523,7 @@ i32.add i32.load16_s ) - (func $~lib/util/number/genDigits (; 230 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (func $~lib/util/number/genDigits (; 241 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) (local $7 i32) (local $8 i64) (local $9 i64) @@ -9389,7 +11578,7 @@ local.set $14 local.get $6 local.set $15 - i32.const 6648 + i32.const 6536 i32.load offset=4 local.set $16 block $break|0 @@ -9398,84 +11587,69 @@ i32.const 0 i32.gt_s if - block - block $break|1 - block $case10|1 - block $case9|1 - block $case8|1 - block $case7|1 - block $case6|1 - block $case5|1 - block $case4|1 - block $case3|1 - block $case2|1 - block $case1|1 - block $case0|1 - local.get $14 - local.set $18 - local.get $18 - i32.const 10 - i32.eq - br_if $case0|1 - local.get $18 - i32.const 9 - i32.eq - br_if $case1|1 - local.get $18 - i32.const 8 - i32.eq - br_if $case2|1 - local.get $18 - i32.const 7 - i32.eq - br_if $case3|1 - local.get $18 - i32.const 6 - i32.eq - br_if $case4|1 - local.get $18 - i32.const 5 - i32.eq - br_if $case5|1 - local.get $18 - i32.const 4 - i32.eq - br_if $case6|1 - local.get $18 - i32.const 3 - i32.eq - br_if $case7|1 - local.get $18 - i32.const 2 - i32.eq - br_if $case8|1 - local.get $18 - i32.const 1 - i32.eq - br_if $case9|1 - br $case10|1 - end - block - local.get $12 - i32.const 1000000000 - i32.div_u - local.set $17 - local.get $12 - i32.const 1000000000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable + block $break|1 + block $case10|1 + block $case9|1 + block $case8|1 + block $case7|1 + block $case6|1 + block $case5|1 + block $case4|1 + block $case3|1 + block $case2|1 + block $case1|1 + block $case0|1 + local.get $14 + local.set $18 + local.get $18 + i32.const 10 + i32.eq + br_if $case0|1 + local.get $18 + i32.const 9 + i32.eq + br_if $case1|1 + local.get $18 + i32.const 8 + i32.eq + br_if $case2|1 + local.get $18 + i32.const 7 + i32.eq + br_if $case3|1 + local.get $18 + i32.const 6 + i32.eq + br_if $case4|1 + local.get $18 + i32.const 5 + i32.eq + br_if $case5|1 + local.get $18 + i32.const 4 + i32.eq + br_if $case6|1 + local.get $18 + i32.const 3 + i32.eq + br_if $case7|1 + local.get $18 + i32.const 2 + i32.eq + br_if $case8|1 + local.get $18 + i32.const 1 + i32.eq + br_if $case9|1 + br $case10|1 end block local.get $12 - i32.const 100000000 + i32.const 1000000000 i32.div_u local.set $17 local.get $12 - i32.const 100000000 + i32.const 1000000000 i32.rem_u local.set $12 br $break|1 @@ -9485,11 +11659,11 @@ end block local.get $12 - i32.const 10000000 + i32.const 100000000 i32.div_u local.set $17 local.get $12 - i32.const 10000000 + i32.const 100000000 i32.rem_u local.set $12 br $break|1 @@ -9499,11 +11673,11 @@ end block local.get $12 - i32.const 1000000 + i32.const 10000000 i32.div_u local.set $17 local.get $12 - i32.const 1000000 + i32.const 10000000 i32.rem_u local.set $12 br $break|1 @@ -9513,11 +11687,11 @@ end block local.get $12 - i32.const 100000 + i32.const 1000000 i32.div_u local.set $17 local.get $12 - i32.const 100000 + i32.const 1000000 i32.rem_u local.set $12 br $break|1 @@ -9527,11 +11701,11 @@ end block local.get $12 - i32.const 10000 + i32.const 100000 i32.div_u local.set $17 local.get $12 - i32.const 10000 + i32.const 100000 i32.rem_u local.set $12 br $break|1 @@ -9541,11 +11715,11 @@ end block local.get $12 - i32.const 1000 + i32.const 10000 i32.div_u local.set $17 local.get $12 - i32.const 1000 + i32.const 10000 i32.rem_u local.set $12 br $break|1 @@ -9555,11 +11729,11 @@ end block local.get $12 - i32.const 100 + i32.const 1000 i32.div_u local.set $17 local.get $12 - i32.const 100 + i32.const 1000 i32.rem_u local.set $12 br $break|1 @@ -9569,11 +11743,11 @@ end block local.get $12 - i32.const 10 + i32.const 100 i32.div_u local.set $17 local.get $12 - i32.const 10 + i32.const 100 i32.rem_u local.set $12 br $break|1 @@ -9583,8 +11757,12 @@ end block local.get $12 + i32.const 10 + i32.div_u local.set $17 - i32.const 0 + local.get $12 + i32.const 10 + i32.rem_u local.set $12 br $break|1 unreachable @@ -9592,146 +11770,153 @@ unreachable end block - i32.const 0 + local.get $12 local.set $17 + i32.const 0 + local.set $12 br $break|1 unreachable end unreachable end + block + i32.const 0 + local.set $17 + br $break|1 + unreachable + end + unreachable + end + local.get $17 + local.get $15 + i32.or + if + local.get $0 + block (result i32) + local.get $15 + local.tee $18 + i32.const 1 + i32.add + local.set $15 + local.get $18 + end + i32.const 1 + i32.shl + i32.add + i32.const 48 local.get $17 - local.get $15 - i32.or - if + i32.const 65535 + i32.and + i32.add + i32.store16 + end + local.get $14 + i32.const 1 + i32.sub + local.set $14 + local.get $12 + i64.extend_i32_u + local.get $7 + i64.extend_i32_s + i64.shl + local.get $13 + i64.add + local.set $19 + local.get $19 + local.get $5 + i64.le_u + if + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + block $~lib/util/number/grisuRound|inlined.0 local.get $0 - block (result i32) - local.get $15 - local.tee $18 - i32.const 1 - i32.add - local.set $15 - local.get $18 - end + local.set $20 + local.get $15 + local.set $18 + local.get $5 + local.set $24 + local.get $19 + local.set $23 + local.get $16 + local.get $14 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.get $7 + i64.extend_i32_s + i64.shl + local.set $22 + local.get $10 + local.set $21 + local.get $20 + local.get $18 + i32.const 1 + i32.sub i32.const 1 i32.shl i32.add - i32.const 48 - local.get $17 - i32.const 65535 - i32.and - i32.add - i32.store16 - end - local.get $14 - i32.const 1 - i32.sub - local.set $14 - local.get $12 - i64.extend_i32_u - local.get $7 - i64.extend_i32_s - i64.shl - local.get $13 - i64.add - local.set $19 - local.get $19 - local.get $5 - i64.le_u - if - global.get $~lib/util/number/_K - local.get $14 - i32.add - global.set $~lib/util/number/_K - block $~lib/util/number/grisuRound|inlined.0 - local.get $0 - local.set $20 - local.get $15 - local.set $18 - local.get $5 - local.set $24 - local.get $19 - local.set $23 - local.get $16 - local.get $14 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.get $7 - i64.extend_i32_s - i64.shl - local.set $22 - local.get $10 - local.set $21 - local.get $20 - local.get $18 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - i32.add - local.set $25 - local.get $25 - i32.load16_u - local.set $26 - block $break|2 - loop $continue|2 + local.set $25 + local.get $25 + i32.load16_u + local.set $26 + block $break|2 + loop $continue|2 + local.get $23 + local.get $21 + i64.lt_u + if (result i32) + local.get $24 local.get $23 + i64.sub + local.get $22 + i64.ge_u + else + i32.const 0 + end + if (result i32) + local.get $23 + local.get $22 + i64.add local.get $21 i64.lt_u if (result i32) - local.get $24 + i32.const 1 + else + local.get $21 local.get $23 i64.sub - local.get $22 - i64.ge_u - else - i32.const 0 - end - if (result i32) local.get $23 local.get $22 i64.add local.get $21 - i64.lt_u - if (result i32) - i32.const 1 - else - local.get $21 - local.get $23 - i64.sub - local.get $23 - local.get $22 - i64.add - local.get $21 - i64.sub - i64.gt_u - end - else - i32.const 0 - end - if - block - local.get $26 - i32.const 1 - i32.sub - local.set $26 - local.get $23 - local.get $22 - i64.add - local.set $23 - end - br $continue|2 + i64.sub + i64.gt_u end + else + i32.const 0 + end + if + local.get $26 + i32.const 1 + i32.sub + local.set $26 + local.get $23 + local.get $22 + i64.add + local.set $23 + br $continue|2 end end - local.get $25 - local.get $26 - i32.store16 end - local.get $15 - return + local.get $25 + local.get $26 + i32.store16 end + local.get $15 + return end br $continue|0 end @@ -9741,156 +11926,152 @@ loop $continue|3 i32.const 1 if - block - local.get $13 - i64.const 10 - i64.mul - local.set $13 - local.get $5 - i64.const 10 - i64.mul - local.set $5 - local.get $13 - local.get $7 - i64.extend_i32_s - i64.shr_u - local.set $19 + local.get $13 + i64.const 10 + i64.mul + local.set $13 + local.get $5 + i64.const 10 + i64.mul + local.set $5 + local.get $13 + local.get $7 + i64.extend_i32_s + i64.shr_u + local.set $19 + local.get $19 + local.get $15 + i64.extend_i32_s + i64.or + i64.const 0 + i64.ne + if + local.get $0 + block (result i32) + local.get $15 + local.tee $17 + i32.const 1 + i32.add + local.set $15 + local.get $17 + end + i32.const 1 + i32.shl + i32.add + i32.const 48 local.get $19 - local.get $15 - i64.extend_i32_s - i64.or - i64.const 0 - i64.ne - if + i32.wrap_i64 + i32.const 65535 + i32.and + i32.add + i32.store16 + end + local.get $13 + local.get $9 + i64.and + local.set $13 + local.get $14 + i32.const 1 + i32.sub + local.set $14 + local.get $13 + local.get $5 + i64.lt_u + if + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + local.get $10 + local.get $16 + i32.const 0 + local.get $14 + i32.sub + i32.const 2 + i32.shl + i32.add + i64.load32_u + i64.mul + local.set $10 + block $~lib/util/number/grisuRound|inlined.1 local.get $0 - block (result i32) - local.get $15 - local.tee $17 - i32.const 1 - i32.add - local.set $15 - local.get $17 - end + local.set $26 + local.get $15 + local.set $17 + local.get $5 + local.set $24 + local.get $13 + local.set $23 + local.get $8 + local.set $22 + local.get $10 + local.set $21 + local.get $26 + local.get $17 + i32.const 1 + i32.sub i32.const 1 i32.shl i32.add - i32.const 48 - local.get $19 - i32.wrap_i64 - i32.const 65535 - i32.and - i32.add - i32.store16 - end - local.get $13 - local.get $9 - i64.and - local.set $13 - local.get $14 - i32.const 1 - i32.sub - local.set $14 - local.get $13 - local.get $5 - i64.lt_u - if - global.get $~lib/util/number/_K - local.get $14 - i32.add - global.set $~lib/util/number/_K - local.get $10 - local.get $16 - i32.const 0 - local.get $14 - i32.sub - i32.const 2 - i32.shl - i32.add - i64.load32_u - i64.mul - local.set $10 - block $~lib/util/number/grisuRound|inlined.1 - local.get $0 - local.set $26 - local.get $15 - local.set $17 - local.get $5 - local.set $24 - local.get $13 - local.set $23 - local.get $8 - local.set $22 - local.get $10 - local.set $21 - local.get $26 - local.get $17 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - i32.add - local.set $25 - local.get $25 - i32.load16_u - local.set $18 - block $break|4 - loop $continue|4 + local.set $25 + local.get $25 + i32.load16_u + local.set $18 + block $break|4 + loop $continue|4 + local.get $23 + local.get $21 + i64.lt_u + if (result i32) + local.get $24 local.get $23 + i64.sub + local.get $22 + i64.ge_u + else + i32.const 0 + end + if (result i32) + local.get $23 + local.get $22 + i64.add local.get $21 i64.lt_u if (result i32) - local.get $24 + i32.const 1 + else + local.get $21 local.get $23 i64.sub - local.get $22 - i64.ge_u - else - i32.const 0 - end - if (result i32) local.get $23 local.get $22 i64.add local.get $21 - i64.lt_u - if (result i32) - i32.const 1 - else - local.get $21 - local.get $23 - i64.sub - local.get $23 - local.get $22 - i64.add - local.get $21 - i64.sub - i64.gt_u - end - else - i32.const 0 - end - if - block - local.get $18 - i32.const 1 - i32.sub - local.set $18 - local.get $23 - local.get $22 - i64.add - local.set $23 - end - br $continue|4 + i64.sub + i64.gt_u end + else + i32.const 0 + end + if + local.get $18 + i32.const 1 + i32.sub + local.set $18 + local.get $23 + local.get $22 + i64.add + local.set $23 + br $continue|4 end end - local.get $25 - local.get $18 - i32.store16 end - local.get $15 - return + local.get $25 + local.get $18 + i32.store16 end + local.get $15 + return end br $continue|3 end @@ -9898,7 +12079,7 @@ end local.get $15 ) - (func $~lib/util/number/prettify (; 231 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 242 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -10228,7 +12409,7 @@ unreachable unreachable ) - (func $~lib/util/number/dtoa_core (; 232 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/util/number/dtoa_core (; 243 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 i32) (local $3 f64) (local $4 i32) @@ -10397,11 +12578,11 @@ i32.shl i32.sub global.set $~lib/util/number/_K - i32.const 6336 + i32.const 6224 local.get $13 call $~lib/array/Array#__unchecked_get global.set $~lib/util/number/_frc_pow - i32.const 6560 + i32.const 6448 local.get $13 call $~lib/array/Array#__unchecked_get global.set $~lib/util/number/_exp_pow @@ -10666,7 +12847,7 @@ local.get $2 i32.add ) - (func $~lib/util/number/dtoa (; 233 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/util/number/dtoa (; 244 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -10674,7 +12855,8 @@ f64.const 0 f64.eq if - i32.const 5504 + i32.const 5392 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -10684,39 +12866,49 @@ local.get $0 call $~lib/builtins/isNaN if - i32.const 5528 + i32.const 5416 + call $~lib/rt/purerc/__retain return end - i32.const 5552 - i32.const 5592 + i32.const 5440 + i32.const 5480 local.get $0 f64.const 0 f64.lt select + call $~lib/rt/purerc/__retain return end i32.const 28 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $1 local.get $1 local.get $0 call $~lib/util/number/dtoa_core local.set $2 + local.get $2 + i32.const 28 + i32.eq + if + local.get $1 + call $~lib/rt/purerc/__retain + return + end local.get $1 i32.const 0 local.get $2 call $~lib/string/String#substring local.set $3 local.get $1 - call $~lib/util/runtime/discard + call $~lib/rt/tlsf/__free local.get $3 ) - (func $~lib/util/number/dtoa_stream (; 234 ;) (type $FUNCSIG$iiid) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) + (func $~lib/util/number/dtoa_stream (; 245 ;) (type $FUNCSIG$iiid) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) (local $3 i32) (local $4 i32) - (local $5 i32) local.get $0 local.get $1 i32.const 1 @@ -10766,13 +12958,11 @@ local.get $3 i32.add local.set $4 - i32.const 5552 - i32.const 5592 + local.get $0 + i32.const 5440 + i32.const 5480 local.get $3 select - local.set $5 - local.get $0 - local.get $5 local.get $4 i32.const 1 i32.shl @@ -10787,15 +12977,19 @@ local.get $2 call $~lib/util/number/dtoa_core ) - (func $~lib/array/Array#join_flt (; 235 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_flt (; 246 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 f64) + (local $8 i32) (local $9 i32) + (local $10 f64) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -10805,128 +12999,153 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - local.get $3 + local.get $4 f64.load call $~lib/util/number/dtoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end local.get $1 call $~lib/string/String#get:length - local.set $4 + local.set $6 i32.const 28 - local.get $4 + local.get $6 i32.add local.get $2 i32.mul i32.const 28 i32.add - local.set $5 - local.get $5 + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $6 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $7 + local.set $9 block $break|0 i32.const 0 - local.set $9 + local.set $3 loop $repeat|0 - local.get $9 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $3 - local.get $9 - i32.const 3 - i32.shl - i32.add - f64.load - local.set $8 - local.get $7 - local.get $6 - local.get $7 - local.get $8 - call $~lib/util/number/dtoa_stream - i32.add - local.set $7 - local.get $4 - if - local.get $6 - local.get $7 - i32.const 1 - i32.shl - i32.add - local.get $1 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $7 - local.get $4 - i32.add - local.set $7 - end - end + local.get $4 + local.get $3 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $10 local.get $9 - i32.const 1 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/dtoa_stream i32.add local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $3 + local.get $4 local.get $2 i32.const 3 i32.shl i32.add f64.load - local.set $8 - local.get $7 - local.get $6 - local.get $7 + local.set $10 + local.get $9 local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/dtoa_stream i32.add - local.set $7 - local.get $5 + local.set $9 local.get $7 + local.get $9 i32.gt_s if - local.get $6 + local.get $8 i32.const 0 - local.get $7 - call $~lib/string/String#substring - local.set $9 - local.get $6 - call $~lib/util/runtime/discard local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end - local.get $6 - i32.const 16 - call $~lib/util/runtime/register + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#join (; 236 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 247 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#join_flt + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/array/Array<~lib/string/String>#join_str (; 237 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#join_str (; 248 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -10936,6 +13155,9 @@ (local $8 i32) (local $9 i32) (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -10945,62 +13167,74 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - local.get $3 + local.get $4 i32.load + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $1 call $~lib/string/String#get:length - local.set $4 - i32.const 0 local.set $5 + i32.const 0 + local.set $6 + i32.const 0 + local.set $7 block $break|0 block i32.const 0 - local.set $7 + local.set $3 local.get $2 i32.const 1 i32.add local.set $8 end loop $repeat|0 - local.get $7 + local.get $3 local.get $8 i32.lt_s i32.eqz br_if $break|0 - block - local.get $3 - local.get $7 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - if - local.get $5 - local.get $6 - call $~lib/string/String#get:length - i32.add - local.set $5 - end - end + local.get $4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $6 + local.get $7 + call $~lib/string/String#get:length + i32.add + local.set $6 + end + local.get $3 i32.const 1 i32.add - local.set $7 + local.set $3 br $repeat|0 unreachable end @@ -11008,14 +13242,16 @@ end i32.const 0 local.set $9 + local.get $6 local.get $5 - local.get $4 local.get $2 i32.mul i32.add i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $10 block $break|1 i32.const 0 @@ -11026,53 +13262,53 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $3 - local.get $8 - i32.const 2 + local.get $4 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $7 + call $~lib/string/String#get:length + local.set $3 + local.get $10 + local.get $9 + i32.const 1 i32.shl i32.add - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - if - local.get $6 - call $~lib/string/String#get:length - local.set $7 - local.get $10 - local.get $9 - i32.const 1 - i32.shl - i32.add - local.get $6 - local.get $7 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $9 - local.get $7 - i32.add - local.set $9 - end - local.get $4 - if - local.get $10 - local.get $9 - i32.const 1 - i32.shl - i32.add - local.get $1 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $9 - local.get $4 - i32.add - local.set $9 - end + local.get $7 + local.get $3 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $3 + i32.add + local.set $9 + end + local.get $5 + if + local.get $10 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $5 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $5 + i32.add + local.set $9 end local.get $8 i32.const 1 @@ -11083,14 +13319,16 @@ end unreachable end - local.get $3 + local.get $4 local.get $2 i32.const 2 i32.shl i32.add i32.load - local.set $6 - local.get $6 + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 i32.const 0 i32.ne if @@ -11099,36 +13337,48 @@ i32.const 1 i32.shl i32.add - local.get $6 - local.get $6 + local.get $7 + local.get $7 call $~lib/string/String#get:length i32.const 1 i32.shl call $~lib/memory/memory.copy end local.get $10 - i32.const 16 - call $~lib/util/runtime/register + local.set $8 + local.get $1 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $8 ) - (func $~lib/array/Array<~lib/string/String>#join (; 238 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#join (; 249 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array<~lib/string/String>#join_str + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $std/array/Ref#constructor (; 239 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/Ref#constructor (; 250 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 0 - call $~lib/util/runtime/allocate i32.const 32 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 ) - (func $~lib/array/Array#join_ref (; 240 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_ref (; 251 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -11137,6 +13387,9 @@ (local $7 i32) (local $8 i32) (local $9 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -11146,149 +13399,179 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - i32.const 6928 + i32.const 6720 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $1 call $~lib/string/String#get:length - local.set $4 + local.set $5 i32.const 15 - local.get $4 + local.get $5 i32.add local.get $2 i32.mul i32.const 15 i32.add - local.set $5 - local.get $5 + local.set $6 + local.get $6 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $6 - i32.const 0 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $7 + i32.const 0 + local.set $8 + i32.const 0 + local.set $9 block $break|0 i32.const 0 - local.set $9 + local.set $3 loop $repeat|0 - local.get $9 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $3 - local.get $9 - i32.const 2 + local.get $4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $9 + call $~lib/rt/purerc/__retainRelease + local.set $9 + local.get $9 + if + local.get $7 + local.get $8 + i32.const 1 i32.shl i32.add - i32.load - local.set $8 + i32.const 6720 + i32.const 15 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy local.get $8 - if - local.get $6 - local.get $7 - i32.const 1 - i32.shl - i32.add - i32.const 6928 - i32.const 15 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $7 - i32.const 15 - i32.add - local.set $7 - end - local.get $4 - if - local.get $6 - local.get $7 - i32.const 1 - i32.shl - i32.add - local.get $1 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $7 - local.get $4 - i32.add - local.set $7 - end + i32.const 15 + i32.add + local.set $8 end - local.get $9 + local.get $5 + if + local.get $7 + local.get $8 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $5 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $8 + local.get $5 + i32.add + local.set $8 + end + local.get $3 i32.const 1 i32.add - local.set $9 + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $3 + local.get $4 local.get $2 i32.const 2 i32.shl i32.add i32.load if - local.get $6 local.get $7 + local.get $8 i32.const 1 i32.shl i32.add - i32.const 6928 + i32.const 6720 i32.const 15 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $7 + local.get $8 i32.const 15 i32.add - local.set $7 - end - local.get $5 - local.get $7 - i32.gt_s - if - local.get $6 - i32.const 0 - local.get $7 - call $~lib/string/String#substring - local.set $9 - local.get $6 - call $~lib/util/runtime/discard - local.get $9 - return + local.set $8 end local.get $6 - i32.const 16 - call $~lib/util/runtime/register + local.get $8 + i32.gt_s + if + local.get $7 + i32.const 0 + local.get $8 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $7 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#join (; 241 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 252 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#join_ref + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/array/Array#toString (; 242 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 253 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4536 call $~lib/array/Array#join ) - (func $~lib/util/number/itoa (; 243 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa (; 254 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 24 i32.shl @@ -11297,7 +13580,7 @@ call $~lib/util/number/itoa32 return ) - (func $~lib/util/number/itoa_stream (; 244 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 255 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -11372,7 +13655,7 @@ end local.get $3 ) - (func $~lib/array/Array#join_int (; 245 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 256 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -11381,6 +13664,10 @@ (local $7 i32) (local $8 i32) (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -11390,140 +13677,165 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - local.get $3 + local.get $4 i32.load8_s call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end local.get $1 call $~lib/string/String#get:length - local.set $4 + local.set $6 i32.const 11 - local.get $4 + local.get $6 i32.add local.get $2 i32.mul i32.const 11 i32.add - local.set $5 - local.get $5 + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $6 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $7 + local.set $9 block $break|0 i32.const 0 - local.set $9 + local.set $3 loop $repeat|0 - local.get $9 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $3 - local.get $9 - i32.const 0 - i32.shl - i32.add - i32.load8_s - local.set $8 - local.get $7 - local.get $6 - local.get $7 - local.get $8 - call $~lib/util/number/itoa_stream - i32.add - local.set $7 - local.get $4 - if - local.get $6 - local.get $7 - i32.const 1 - i32.shl - i32.add - local.get $1 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $7 - local.get $4 - i32.add - local.set $7 - end - end + local.get $4 + local.get $3 + i32.const 0 + i32.shl + i32.add + i32.load8_s + local.set $10 local.get $9 - i32.const 1 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream i32.add local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $3 + local.get $4 local.get $2 i32.const 0 i32.shl i32.add i32.load8_s - local.set $8 - local.get $7 - local.get $6 - local.get $7 + local.set $10 + local.get $9 local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream i32.add - local.set $7 - local.get $5 + local.set $9 local.get $7 + local.get $9 i32.gt_s if - local.get $6 + local.get $8 i32.const 0 - local.get $7 - call $~lib/string/String#substring - local.set $9 - local.get $6 - call $~lib/util/runtime/discard local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end - local.get $6 - i32.const 16 - call $~lib/util/runtime/register + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#join (; 246 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 257 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/array/Array#toString (; 247 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 258 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4536 call $~lib/array/Array#join ) - (func $~lib/util/number/itoa (; 248 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa (; 259 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 65535 i32.and call $~lib/util/number/utoa32 return ) - (func $~lib/util/number/itoa_stream (; 249 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 260 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -11568,7 +13880,7 @@ end local.get $3 ) - (func $~lib/array/Array#join_int (; 250 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 261 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -11577,6 +13889,10 @@ (local $7 i32) (local $8 i32) (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -11586,133 +13902,158 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - local.get $3 + local.get $4 i32.load16_u call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end local.get $1 call $~lib/string/String#get:length - local.set $4 + local.set $6 i32.const 10 - local.get $4 + local.get $6 i32.add local.get $2 i32.mul i32.const 10 i32.add - local.set $5 - local.get $5 + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $6 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $7 + local.set $9 block $break|0 i32.const 0 - local.set $9 + local.set $3 loop $repeat|0 - local.get $9 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $3 + local.get $4 + local.get $3 + i32.const 1 + i32.shl + i32.add + i32.load16_u + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $6 + if + local.get $8 local.get $9 i32.const 1 i32.shl i32.add - i32.load16_u - local.set $8 - local.get $7 + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 local.get $6 - local.get $7 - local.get $8 - call $~lib/util/number/itoa_stream i32.add - local.set $7 - local.get $4 - if - local.get $6 - local.get $7 - i32.const 1 - i32.shl - i32.add - local.get $1 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $7 - local.get $4 - i32.add - local.set $7 - end + local.set $9 end - local.get $9 + local.get $3 i32.const 1 i32.add - local.set $9 + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $3 + local.get $4 local.get $2 i32.const 1 i32.shl i32.add i32.load16_u - local.set $8 - local.get $7 - local.get $6 - local.get $7 + local.set $10 + local.get $9 local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream i32.add - local.set $7 - local.get $5 + local.set $9 local.get $7 + local.get $9 i32.gt_s if - local.get $6 + local.get $8 i32.const 0 - local.get $7 - call $~lib/string/String#substring - local.set $9 - local.get $6 - call $~lib/util/runtime/discard local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end - local.get $6 - i32.const 16 - call $~lib/util/runtime/register + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#join (; 251 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 262 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/array/Array#toString (; 252 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 263 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4536 call $~lib/array/Array#join ) - (func $~lib/util/number/decimalCount64 (; 253 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/decimalCount64 (; 264 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) local.get $0 i64.const 1000000000000000 @@ -11781,7 +14122,7 @@ unreachable unreachable ) - (func $~lib/util/number/utoa64_lut (; 254 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/util/number/utoa64_lut (; 265 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i32) (local $4 i64) (local $5 i32) @@ -11793,7 +14134,7 @@ (local $11 i32) (local $12 i64) (local $13 i64) - i32.const 5096 + i32.const 5072 i32.load offset=4 local.set $3 block $break|0 @@ -11802,103 +14143,101 @@ i64.const 100000000 i64.ge_u if - block - local.get $1 - i64.const 100000000 - i64.div_u - local.set $4 - local.get $1 - local.get $4 - i64.const 100000000 - i64.mul - i64.sub - i32.wrap_i64 - local.set $5 - local.get $4 - local.set $1 - local.get $5 - i32.const 10000 - i32.div_u - local.set $6 - local.get $5 - i32.const 10000 - i32.rem_u - local.set $7 - local.get $6 - i32.const 100 - i32.div_u - local.set $8 - local.get $6 - i32.const 100 - i32.rem_u - local.set $9 - local.get $7 - i32.const 100 - i32.div_u - local.set $10 - local.get $7 - i32.const 100 - i32.rem_u - local.set $11 - local.get $3 - local.get $10 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $12 - local.get $3 - local.get $11 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $13 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $12 - local.get $13 - i64.const 32 - i64.shl - i64.or - i64.store - local.get $3 - local.get $8 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $12 - local.get $3 - local.get $9 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $13 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $12 - local.get $13 - i64.const 32 - i64.shl - i64.or - i64.store - end + local.get $1 + i64.const 100000000 + i64.div_u + local.set $4 + local.get $1 + local.get $4 + i64.const 100000000 + i64.mul + i64.sub + i32.wrap_i64 + local.set $5 + local.get $4 + local.set $1 + local.get $5 + i32.const 10000 + i32.div_u + local.set $6 + local.get $5 + i32.const 10000 + i32.rem_u + local.set $7 + local.get $6 + i32.const 100 + i32.div_u + local.set $8 + local.get $6 + i32.const 100 + i32.rem_u + local.set $9 + local.get $7 + i32.const 100 + i32.div_u + local.set $10 + local.get $7 + i32.const 100 + i32.rem_u + local.set $11 + local.get $3 + local.get $10 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $12 + local.get $3 + local.get $11 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $13 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $12 + local.get $13 + i64.const 32 + i64.shl + i64.or + i64.store + local.get $3 + local.get $8 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $12 + local.get $3 + local.get $9 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $13 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $12 + local.get $13 + i64.const 32 + i64.shl + i64.or + i64.store br $continue|0 end end @@ -11909,7 +14248,7 @@ local.get $2 call $~lib/util/number/utoa32_lut ) - (func $~lib/util/number/utoa64 (; 255 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/utoa64 (; 266 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -11920,12 +14259,12 @@ local.get $0 i64.eqz if - i32.const 4656 + i32.const 4632 + call $~lib/rt/purerc/__retain return end local.get $0 - global.get $~lib/builtins/u32.MAX_VALUE - i64.extend_i32_u + i64.const 4294967295 i64.le_u if local.get $0 @@ -11937,7 +14276,8 @@ local.get $3 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $1 block $~lib/util/number/utoa32_core|inlined.8 local.get $1 @@ -11958,7 +14298,8 @@ local.get $3 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $1 block $~lib/util/number/utoa64_core|inlined.0 local.get $1 @@ -11974,15 +14315,14 @@ end end local.get $1 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/itoa (; 256 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/itoa (; 267 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) local.get $0 call $~lib/util/number/utoa64 return ) - (func $~lib/util/number/itoa_stream (; 257 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (func $~lib/util/number/itoa_stream (; 268 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -12007,8 +14347,7 @@ i32.const 0 local.set $3 local.get $2 - global.get $~lib/builtins/u32.MAX_VALUE - i64.extend_i32_u + i64.const 4294967295 i64.le_u if local.get $2 @@ -12048,15 +14387,19 @@ end local.get $3 ) - (func $~lib/array/Array#join_int (; 258 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 269 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i64) + (local $8 i32) (local $9 i32) + (local $10 i64) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -12066,133 +14409,158 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - local.get $3 + local.get $4 i64.load call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end local.get $1 call $~lib/string/String#get:length - local.set $4 + local.set $6 i32.const 20 - local.get $4 + local.get $6 i32.add local.get $2 i32.mul i32.const 20 i32.add - local.set $5 - local.get $5 + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $6 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $7 + local.set $9 block $break|0 i32.const 0 - local.set $9 + local.set $3 loop $repeat|0 - local.get $9 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $3 - local.get $9 - i32.const 3 - i32.shl - i32.add - i64.load - local.set $8 - local.get $7 - local.get $6 - local.get $7 - local.get $8 - call $~lib/util/number/itoa_stream - i32.add - local.set $7 - local.get $4 - if - local.get $6 - local.get $7 - i32.const 1 - i32.shl - i32.add - local.get $1 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $7 - local.get $4 - i32.add - local.set $7 - end - end + local.get $4 + local.get $3 + i32.const 3 + i32.shl + i32.add + i64.load + local.set $10 local.get $9 - i32.const 1 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream i32.add local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $3 + local.get $4 local.get $2 i32.const 3 i32.shl i32.add i64.load - local.set $8 - local.get $7 - local.get $6 - local.get $7 + local.set $10 + local.get $9 local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream i32.add - local.set $7 - local.get $5 + local.set $9 local.get $7 + local.get $9 i32.gt_s if - local.get $6 + local.get $8 i32.const 0 - local.get $7 - call $~lib/string/String#substring - local.set $9 - local.get $6 - call $~lib/util/runtime/discard local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end - local.get $6 - i32.const 16 - call $~lib/util/runtime/register + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#join (; 259 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 270 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/array/Array#toString (; 260 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 271 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4536 call $~lib/array/Array#join ) - (func $~lib/util/number/itoa64 (; 261 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/itoa64 (; 272 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -12204,7 +14572,8 @@ local.get $0 i64.eqz if - i32.const 4656 + i32.const 4632 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -12219,8 +14588,7 @@ local.set $0 end local.get $0 - global.get $~lib/builtins/u32.MAX_VALUE - i64.extend_i32_u + i64.const 4294967295 i64.le_u if local.get $0 @@ -12234,7 +14602,8 @@ local.get $4 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $2 block $~lib/util/number/utoa32_core|inlined.10 local.get $2 @@ -12257,7 +14626,8 @@ local.get $4 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $2 block $~lib/util/number/utoa64_core|inlined.2 local.get $2 @@ -12279,15 +14649,14 @@ i32.store16 end local.get $2 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/itoa (; 262 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/itoa (; 273 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) local.get $0 call $~lib/util/number/itoa64 return ) - (func $~lib/util/number/itoa_stream (; 263 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (func $~lib/util/number/itoa_stream (; 274 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -12324,8 +14693,7 @@ local.set $2 end local.get $2 - global.get $~lib/builtins/u32.MAX_VALUE - i64.extend_i32_u + i64.const 4294967295 i64.le_u if local.get $2 @@ -12375,15 +14743,19 @@ end local.get $3 ) - (func $~lib/array/Array#join_int (; 264 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 275 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i64) + (local $8 i32) (local $9 i32) + (local $10 i64) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -12393,133 +14765,158 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - local.get $3 + local.get $4 i64.load call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end local.get $1 call $~lib/string/String#get:length - local.set $4 + local.set $6 i32.const 21 - local.get $4 + local.get $6 i32.add local.get $2 i32.mul i32.const 21 i32.add - local.set $5 - local.get $5 + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $6 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $7 + local.set $9 block $break|0 i32.const 0 - local.set $9 + local.set $3 loop $repeat|0 - local.get $9 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $3 - local.get $9 - i32.const 3 - i32.shl - i32.add - i64.load - local.set $8 - local.get $7 - local.get $6 - local.get $7 - local.get $8 - call $~lib/util/number/itoa_stream - i32.add - local.set $7 - local.get $4 - if - local.get $6 - local.get $7 - i32.const 1 - i32.shl - i32.add - local.get $1 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $7 - local.get $4 - i32.add - local.set $7 - end - end + local.get $4 + local.get $3 + i32.const 3 + i32.shl + i32.add + i64.load + local.set $10 local.get $9 - i32.const 1 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream i32.add local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $3 + local.get $4 local.get $2 i32.const 3 i32.shl i32.add i64.load - local.set $8 - local.get $7 - local.get $6 - local.get $7 + local.set $10 + local.get $9 local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream i32.add - local.set $7 - local.get $5 + local.set $9 local.get $7 + local.get $9 i32.gt_s if - local.get $6 + local.get $8 i32.const 0 - local.get $7 - call $~lib/string/String#substring - local.set $9 - local.get $6 - call $~lib/util/runtime/discard local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end - local.get $6 - i32.const 16 - call $~lib/util/runtime/register + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#join (; 265 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 276 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/array/Array#toString (; 266 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 277 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4536 call $~lib/array/Array#join ) - (func $~lib/array/Array<~lib/string/String | null>#join_str (; 267 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#join_str (; 278 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -12529,6 +14926,9 @@ (local $8 i32) (local $9 i32) (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -12538,62 +14938,74 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - local.get $3 + local.get $4 i32.load + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $1 call $~lib/string/String#get:length - local.set $4 - i32.const 0 local.set $5 + i32.const 0 + local.set $6 + i32.const 0 + local.set $7 block $break|0 block i32.const 0 - local.set $7 + local.set $3 local.get $2 i32.const 1 i32.add local.set $8 end loop $repeat|0 - local.get $7 + local.get $3 local.get $8 i32.lt_s i32.eqz br_if $break|0 - block - local.get $3 - local.get $7 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - if - local.get $5 - local.get $6 - call $~lib/string/String#get:length - i32.add - local.set $5 - end - end + local.get $4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $6 + local.get $7 + call $~lib/string/String#get:length + i32.add + local.set $6 + end + local.get $3 i32.const 1 i32.add - local.set $7 + local.set $3 br $repeat|0 unreachable end @@ -12601,14 +15013,16 @@ end i32.const 0 local.set $9 + local.get $6 local.get $5 - local.get $4 local.get $2 i32.mul i32.add i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $10 block $break|1 i32.const 0 @@ -12619,53 +15033,53 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $3 - local.get $8 - i32.const 2 + local.get $4 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $7 + call $~lib/string/String#get:length + local.set $3 + local.get $10 + local.get $9 + i32.const 1 i32.shl i32.add - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - if - local.get $6 - call $~lib/string/String#get:length - local.set $7 - local.get $10 - local.get $9 - i32.const 1 - i32.shl - i32.add - local.get $6 - local.get $7 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $9 - local.get $7 - i32.add - local.set $9 - end - local.get $4 - if - local.get $10 - local.get $9 - i32.const 1 - i32.shl - i32.add - local.get $1 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $9 - local.get $4 - i32.add - local.set $9 - end + local.get $7 + local.get $3 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $3 + i32.add + local.set $9 + end + local.get $5 + if + local.get $10 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $5 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $5 + i32.add + local.set $9 end local.get $8 i32.const 1 @@ -12676,14 +15090,16 @@ end unreachable end - local.get $3 + local.get $4 local.get $2 i32.const 2 i32.shl i32.add i32.load - local.set $6 - local.get $6 + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 i32.const 0 i32.ne if @@ -12692,40 +15108,57 @@ i32.const 1 i32.shl i32.add - local.get $6 - local.get $6 + local.get $7 + local.get $7 call $~lib/string/String#get:length i32.const 1 i32.shl call $~lib/memory/memory.copy end local.get $10 - i32.const 16 - call $~lib/util/runtime/register + local.set $8 + local.get $1 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $8 ) - (func $~lib/array/Array<~lib/string/String | null>#join (; 268 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#join (; 279 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array<~lib/string/String | null>#join_str + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/array/Array<~lib/string/String | null>#toString (; 269 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#toString (; 280 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4536 call $~lib/array/Array<~lib/string/String | null>#join ) - (func $~lib/array/Array<~lib/string/String>#toString (; 270 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#toString (; 281 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4536 call $~lib/array/Array<~lib/string/String>#join ) - (func $~lib/array/Array<~lib/array/Array>#join_arr (; 271 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 282 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -12735,113 +15168,169 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end - i32.const 4208 - local.set $3 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $4 local.get $1 call $~lib/string/String#get:length - local.set $4 + local.set $5 local.get $0 i32.load offset=4 - local.set $5 + local.set $6 + i32.const 0 + local.set $7 local.get $2 i32.eqz if - local.get $5 - i32.load - local.set $6 local.get $6 + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 if (result i32) - local.get $6 + local.get $7 local.get $1 call $~lib/array/Array#join else - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain end + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $3 return end block $break|0 i32.const 0 - local.set $7 + local.set $3 loop $repeat|0 - local.get $7 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $5 - local.get $7 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - local.get $6 - if - local.get $3 - local.get $6 - local.get $1 - call $~lib/array/Array#join - call $~lib/string/String.__concat - local.set $3 - end - local.get $4 - if - local.get $3 - local.get $1 - call $~lib/string/String.__concat - local.set $3 - end - end + local.get $6 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array#join + local.tee $8 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $8 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $5 + if + local.get $4 + local.get $1 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $3 i32.const 1 i32.add - local.set $7 + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $5 + local.get $6 local.get $2 i32.const 2 i32.shl i32.add i32.load - local.set $6 - local.get $6 + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 if - local.get $3 - local.get $6 + local.get $4 + local.get $7 local.get $1 call $~lib/array/Array#join + local.tee $3 call $~lib/string/String.__concat - local.set $3 + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release end - local.get $3 + local.get $4 + local.set $9 + local.get $1 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $9 ) - (func $~lib/array/Array<~lib/array/Array>#join (; 272 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join (; 283 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array<~lib/array/Array>#join_arr + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/array/Array<~lib/array/Array>#toString (; 273 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#toString (; 284 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4536 call $~lib/array/Array<~lib/array/Array>#join ) - (func $~lib/util/number/itoa (; 274 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa (; 285 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 255 i32.and call $~lib/util/number/utoa32 return ) - (func $~lib/util/number/itoa_stream (; 275 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 286 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -12886,7 +15375,7 @@ end local.get $3 ) - (func $~lib/array/Array#join_int (; 276 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 287 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -12895,6 +15384,10 @@ (local $7 i32) (local $8 i32) (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -12904,134 +15397,164 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $0 i32.load offset=4 - local.set $3 + local.set $4 local.get $2 i32.eqz if - local.get $3 + local.get $4 i32.load8_u call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end local.get $1 call $~lib/string/String#get:length - local.set $4 + local.set $6 i32.const 10 - local.get $4 + local.get $6 i32.add local.get $2 i32.mul i32.const 10 i32.add - local.set $5 - local.get $5 + local.set $7 + local.get $7 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.set $6 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $8 i32.const 0 - local.set $7 + local.set $9 block $break|0 i32.const 0 - local.set $9 + local.set $3 loop $repeat|0 - local.get $9 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $3 - local.get $9 - i32.const 0 - i32.shl - i32.add - i32.load8_u - local.set $8 - local.get $7 - local.get $6 - local.get $7 - local.get $8 - call $~lib/util/number/itoa_stream - i32.add - local.set $7 - local.get $4 - if - local.get $6 - local.get $7 - i32.const 1 - i32.shl - i32.add - local.get $1 - local.get $4 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $7 - local.get $4 - i32.add - local.set $7 - end - end + local.get $4 + local.get $3 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.set $10 local.get $9 - i32.const 1 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream i32.add local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $3 + local.get $4 local.get $2 i32.const 0 i32.shl i32.add i32.load8_u - local.set $8 - local.get $7 - local.get $6 - local.get $7 + local.set $10 + local.get $9 local.get $8 + local.get $9 + local.get $10 call $~lib/util/number/itoa_stream i32.add - local.set $7 - local.get $5 + local.set $9 local.get $7 + local.get $9 i32.gt_s if - local.get $6 + local.get $8 i32.const 0 - local.get $7 - call $~lib/string/String#substring - local.set $9 - local.get $6 - call $~lib/util/runtime/discard local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $3 return end - local.get $6 - i32.const 16 - call $~lib/util/runtime/register + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array#join (; 277 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 288 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/array/Array<~lib/array/Array>#join_arr (; 278 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 289 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -13041,112 +15564,173 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end - i32.const 4208 - local.set $3 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $4 local.get $1 call $~lib/string/String#get:length - local.set $4 + local.set $5 local.get $0 i32.load offset=4 - local.set $5 + local.set $6 + i32.const 0 + local.set $7 local.get $2 i32.eqz if - local.get $5 - i32.load - local.set $6 local.get $6 + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 if (result i32) - local.get $6 + local.get $7 local.get $1 call $~lib/array/Array#join else - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain end + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $3 return end block $break|0 i32.const 0 - local.set $7 + local.set $3 loop $repeat|0 - local.get $7 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $5 - local.get $7 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - local.get $6 - if - local.get $3 - local.get $6 - local.get $1 - call $~lib/array/Array#join - call $~lib/string/String.__concat - local.set $3 - end - local.get $4 - if - local.get $3 - local.get $1 - call $~lib/string/String.__concat - local.set $3 - end - end + local.get $6 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array#join + local.tee $8 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $8 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $5 + if + local.get $4 + local.get $1 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $3 i32.const 1 i32.add - local.set $7 + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $5 + local.get $6 local.get $2 i32.const 2 i32.shl i32.add i32.load - local.set $6 - local.get $6 + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 if - local.get $3 - local.get $6 + local.get $4 + local.get $7 local.get $1 call $~lib/array/Array#join + local.tee $3 call $~lib/string/String.__concat - local.set $3 + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release end - local.get $3 + local.get $4 + local.set $9 + local.get $1 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $9 ) - (func $~lib/array/Array<~lib/array/Array>#join (; 279 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join (; 290 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array<~lib/array/Array>#join_arr + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/array/Array<~lib/array/Array>#toString (; 280 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#toString (; 291 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4536 call $~lib/array/Array<~lib/array/Array>#join ) - (func $~lib/array/Array<~lib/array/Array>#join_arr (; 281 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 292 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -13156,107 +15740,168 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end - i32.const 4208 - local.set $3 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $4 local.get $1 call $~lib/string/String#get:length - local.set $4 + local.set $5 local.get $0 i32.load offset=4 - local.set $5 + local.set $6 + i32.const 0 + local.set $7 local.get $2 i32.eqz if - local.get $5 - i32.load - local.set $6 local.get $6 + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 if (result i32) - local.get $6 + local.get $7 local.get $1 call $~lib/array/Array#join else - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain end + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $3 return end block $break|0 i32.const 0 - local.set $7 + local.set $3 loop $repeat|0 - local.get $7 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $5 - local.get $7 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - local.get $6 - if - local.get $3 - local.get $6 - local.get $1 - call $~lib/array/Array#join - call $~lib/string/String.__concat - local.set $3 - end - local.get $4 - if - local.get $3 - local.get $1 - call $~lib/string/String.__concat - local.set $3 - end - end + local.get $6 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array#join + local.tee $8 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $8 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $5 + if + local.get $4 + local.get $1 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $3 i32.const 1 i32.add - local.set $7 + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $5 + local.get $6 local.get $2 i32.const 2 i32.shl i32.add i32.load - local.set $6 - local.get $6 + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 if - local.get $3 - local.get $6 + local.get $4 + local.get $7 local.get $1 call $~lib/array/Array#join + local.tee $3 call $~lib/string/String.__concat - local.set $3 + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release end - local.get $3 + local.get $4 + local.set $9 + local.get $1 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $9 ) - (func $~lib/array/Array<~lib/array/Array>#join (; 282 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join (; 293 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array<~lib/array/Array>#join_arr + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join_arr (; 283 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join_arr (; 294 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 i32.const 1 @@ -13266,4729 +15911,5701 @@ i32.const 0 i32.lt_s if - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end - i32.const 4208 - local.set $3 + i32.const 4272 + call $~lib/rt/purerc/__retain + local.set $4 local.get $1 call $~lib/string/String#get:length - local.set $4 + local.set $5 local.get $0 i32.load offset=4 - local.set $5 + local.set $6 + i32.const 0 + local.set $7 local.get $2 i32.eqz if - local.get $5 - i32.load - local.set $6 local.get $6 + i32.load + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 if (result i32) - local.get $6 + local.get $7 local.get $1 call $~lib/array/Array<~lib/array/Array>#join else - i32.const 4208 + i32.const 4272 + call $~lib/rt/purerc/__retain end + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $3 return end block $break|0 i32.const 0 - local.set $7 + local.set $3 loop $repeat|0 - local.get $7 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - local.get $5 - local.get $7 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $6 - local.get $6 - if - local.get $3 - local.get $6 - local.get $1 - call $~lib/array/Array<~lib/array/Array>#join - call $~lib/string/String.__concat - local.set $3 - end - local.get $4 - if - local.get $3 - local.get $1 - call $~lib/string/String.__concat - local.set $3 - end - end + local.get $6 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 + if + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#join + local.tee $8 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $8 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $5 + if + local.get $4 + local.get $1 + call $~lib/string/String.__concat + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $9 + call $~lib/rt/purerc/__release + end + local.get $3 i32.const 1 i32.add - local.set $7 + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $5 + local.get $6 local.get $2 i32.const 2 i32.shl i32.add i32.load - local.set $6 - local.get $6 + local.get $7 + call $~lib/rt/purerc/__retainRelease + local.set $7 + local.get $7 if - local.get $3 - local.get $6 + local.get $4 + local.get $7 local.get $1 call $~lib/array/Array<~lib/array/Array>#join + local.tee $3 call $~lib/string/String.__concat - local.set $3 + local.tee $9 + local.get $4 + call $~lib/rt/purerc/__retainRelease + local.set $4 + local.get $3 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release end - local.get $3 + local.get $4 + local.set $9 + local.get $1 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $9 ) - (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join (; 284 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join (; 295 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join_arr + local.set $2 + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 return ) - (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString (; 285 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString (; 296 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4536 call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join ) - (func $start:std/array (; 286 ;) (type $FUNCSIG$v) + (func $start:std/array (; 297 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i32) + (local $19 i32) + (local $20 i32) + (local $21 i32) + (local $22 i32) + (local $23 i32) + (local $24 i32) + (local $25 i32) + (local $26 i32) + (local $27 i32) + (local $28 i32) + (local $29 i32) + (local $30 i32) + (local $31 i32) + (local $32 i32) + (local $33 i32) + (local $34 i32) + (local $35 i32) + (local $36 i32) + (local $37 i32) + (local $38 i32) + (local $39 i32) + (local $40 i32) + (local $41 i32) + (local $42 i32) + (local $43 i32) + (local $44 i32) + (local $45 i32) + (local $46 i32) + (local $47 i32) + (local $48 i32) + (local $49 i32) + (local $50 i32) + (local $51 i32) + (local $52 i32) + (local $53 i32) + (local $54 i32) + (local $55 i32) + (local $56 i32) i32.const 0 i32.const 0 call $~lib/array/Array#constructor global.set $std/array/arr - global.get $std/array/Null - call $~lib/array/Array.isArray<~lib/array/Array | null> - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 39 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array.isArray<~lib/array/Array> - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 40 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - call $std/array/P#constructor - call $~lib/array/Array.isArray - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 41 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint8Array#constructor - call $~lib/array/Array.isArray<~lib/typedarray/Uint8Array> - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 42 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/num - call $~lib/array/Array.isArray - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 43 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/str - call $~lib/array/Array.isArray<~lib/string/String> - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 44 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr8 - i32.const 1 - i32.const 1 - i32.const 3 - call $~lib/array/Array#fill - drop - global.get $std/array/arr8 - i32.const 5 - i32.const 0 - i32.const 20 - i32.const 256 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 51 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr8 - i32.const 0 - i32.const 0 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#fill - drop - global.get $std/array/arr8 - i32.const 5 - i32.const 0 - i32.const 20 - i32.const 328 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 54 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr8 - i32.const 1 - i32.const 0 - i32.const -3 - call $~lib/array/Array#fill - drop - global.get $std/array/arr8 - i32.const 5 - i32.const 0 - i32.const 20 - i32.const 352 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 57 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr8 - i32.const 2 - i32.const -2 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#fill - drop - global.get $std/array/arr8 - i32.const 5 - i32.const 0 - i32.const 20 - i32.const 376 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 60 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr8 - i32.const 0 - i32.const 1 - i32.const 0 - call $~lib/array/Array#fill - drop - global.get $std/array/arr8 - i32.const 5 - i32.const 0 - i32.const 20 - i32.const 400 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 63 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr32 - i32.const 1 - i32.const 1 - i32.const 3 - call $~lib/array/Array#fill - drop - global.get $std/array/arr32 - i32.const 5 - i32.const 2 - i32.const 21 - i32.const 496 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 68 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr32 - i32.const 0 - i32.const 0 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#fill - drop - global.get $std/array/arr32 - i32.const 5 - i32.const 2 - i32.const 21 - i32.const 536 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 71 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr32 - i32.const 1 - i32.const 0 - i32.const -3 - call $~lib/array/Array#fill - drop - global.get $std/array/arr32 - i32.const 5 - i32.const 2 - i32.const 21 - i32.const 576 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 74 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr32 - i32.const 2 - i32.const -2 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#fill - drop - global.get $std/array/arr32 - i32.const 5 - i32.const 2 - i32.const 21 - i32.const 616 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 77 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr32 - i32.const 0 - i32.const 1 - i32.const 0 - call $~lib/array/Array#fill - drop - global.get $std/array/arr32 - i32.const 5 - i32.const 2 - i32.const 21 - i32.const 656 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 80 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 84 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 85 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 42 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 42 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 89 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 90 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 91 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - global.set $std/array/i - global.get $std/array/i - i32.const 42 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 95 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 96 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 97 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - call $~lib/array/Array#push - drop - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 101 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 102 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 103 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 44 - call $~lib/array/Array#push - drop - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 107 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 108 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 109 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 110 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 45 - call $~lib/array/Array#push - drop - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 114 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 115 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 116 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 117 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 45 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 118 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - i32.const 0 - call $~lib/array/Array#constructor - global.set $std/array/other - global.get $std/array/arr - global.get $std/array/other - call $~lib/array/Array#concat - global.set $std/array/out - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 125 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 126 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - call $~lib/array/Array#get:length - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 127 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 696 - call $~lib/util/runtime/makeArray - call $~lib/array/Array#concat - drop - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 130 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 132 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 1 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 133 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 2 - call $~lib/array/Array#__get - i32.const 45 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 134 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/other - i32.const 46 - call $~lib/array/Array#push - drop - global.get $std/array/other - i32.const 47 - call $~lib/array/Array#push - drop - global.get $std/array/arr - global.get $std/array/other - call $~lib/array/Array#concat - global.set $std/array/out - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 141 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/other - call $~lib/array/Array#get:length - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 142 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - call $~lib/array/Array#get:length - i32.const 5 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 143 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 144 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 1 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 145 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 2 - call $~lib/array/Array#__get - i32.const 45 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 146 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 3 - call $~lib/array/Array#__get - i32.const 46 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 147 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 4 - call $~lib/array/Array#__get - i32.const 47 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 148 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - call $~lib/array/Array#pop - drop - global.get $std/array/out - call $~lib/array/Array#get:length - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 151 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#concat - global.set $std/array/out - global.get $std/array/out - call $~lib/array/Array#get:length - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 154 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/out - i32.const 2 - call $~lib/array/Array#__get - i32.const 45 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 155 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/source - call $~lib/array/Array#get:length - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 158 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/source - global.get $std/array/arr - call $~lib/array/Array#concat - global.set $std/array/out - global.get $std/array/out - call $~lib/array/Array#get:length - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 160 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/source - call $~lib/array/Array#get:length - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 161 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 760 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 0 - i32.const 3 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 800 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 167 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 840 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 1 - i32.const 3 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 880 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 169 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 920 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 1 - i32.const 2 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 960 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 171 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1000 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 2 - i32.const 2 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1040 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 173 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1080 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 0 - i32.const 3 - i32.const 4 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1120 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 175 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1160 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 1 - i32.const 3 - i32.const 4 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1200 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 177 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1240 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 1 - i32.const 2 - i32.const 4 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1280 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 179 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1320 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 0 - i32.const -2 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1360 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 181 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1400 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 0 - i32.const -2 - i32.const -1 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1440 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 183 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1480 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const -4 - i32.const -3 - i32.const -2 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1520 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 185 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1560 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const -4 - i32.const -3 - i32.const -1 - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1600 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 187 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1640 - call $~lib/util/runtime/makeArray - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const -4 - i32.const -3 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#copyWithin - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1680 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 189 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 42 - call $~lib/array/Array#unshift - drop - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 195 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 196 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 42 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 197 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 198 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 199 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#__get - i32.const 45 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 200 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 41 - call $~lib/array/Array#unshift - drop - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 5 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 204 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 5 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 205 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 41 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 206 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 42 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 207 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 208 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 209 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 4 - call $~lib/array/Array#__get - i32.const 45 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 210 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#shift - global.set $std/array/i - global.get $std/array/i - i32.const 41 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 216 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 217 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 5 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 218 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 42 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 219 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 220 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 221 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#__get - i32.const 45 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 222 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - global.set $std/array/i - global.get $std/array/i - i32.const 45 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 226 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 227 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 5 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 228 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 42 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 229 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 230 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 231 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#reverse - drop - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 237 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 5 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 238 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 239 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 240 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 42 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 241 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 44 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 44 - i32.const 0 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 250 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 42 - i32.const 0 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 254 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 45 - i32.const 0 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 258 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 100 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 262 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const -100 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 266 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const -2 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 270 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const -4 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 274 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 0 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 278 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 1 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 282 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 2 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 286 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 44 - i32.const 0 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 292 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 42 - i32.const 0 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 296 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 45 - i32.const 0 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 300 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 100 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 304 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const -100 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 308 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const -2 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 312 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const -4 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 316 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 0 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 320 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 1 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 324 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - i32.const 2 - call $~lib/array/Array#includes - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 328 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - i32.const 1 - call $~lib/array/Array#splice - drop - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 332 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 5 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 333 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 334 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 42 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 335 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 0 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#splice - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1792 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 340 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 1832 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 341 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1848 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 2 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#splice - i32.const 3 - i32.const 2 - i32.const 17 - i32.const 1888 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 344 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 1920 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 345 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 1944 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 2 - i32.const 2 - call $~lib/array/Array#splice - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 1984 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 348 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 3 - i32.const 2 - i32.const 17 - i32.const 2008 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 349 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2040 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 0 - i32.const 1 - call $~lib/array/Array#splice - i32.const 1 - i32.const 2 - i32.const 17 - i32.const 2080 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 352 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 4 - i32.const 2 - i32.const 17 - i32.const 2104 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 353 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2136 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const -1 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#splice - i32.const 1 - i32.const 2 - i32.const 17 - i32.const 2176 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 356 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 4 - i32.const 2 - i32.const 17 - i32.const 2200 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 357 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2232 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const -2 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/array/Array#splice - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 2272 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 360 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 3 - i32.const 2 - i32.const 17 - i32.const 2296 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 361 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2328 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const -2 - i32.const 1 - call $~lib/array/Array#splice - i32.const 1 - i32.const 2 - i32.const 17 - i32.const 2368 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 364 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 4 - i32.const 2 - i32.const 17 - i32.const 2392 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 365 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2424 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const -7 - i32.const 1 - call $~lib/array/Array#splice - i32.const 1 - i32.const 2 - i32.const 17 - i32.const 2464 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 368 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 4 - i32.const 2 - i32.const 17 - i32.const 2488 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 369 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2520 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const -2 - i32.const -1 - call $~lib/array/Array#splice - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 2560 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 372 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2576 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 373 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2616 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 1 - i32.const -2 - call $~lib/array/Array#splice - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 2656 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 376 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2672 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 377 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2712 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 4 - i32.const 0 - call $~lib/array/Array#splice - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 2752 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 380 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2768 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 381 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2808 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 7 - i32.const 0 - call $~lib/array/Array#splice - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 2848 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 384 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2864 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 385 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2904 - call $~lib/util/runtime/makeArray - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 7 - i32.const 5 - call $~lib/array/Array#splice - i32.const 0 - i32.const 2 - i32.const 17 - i32.const 2944 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 388 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/sarr - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 2960 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 389 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - i32.const 0 - call $~lib/array/Array#__set - global.get $std/array/arr - i32.const 1 - i32.const 1 - call $~lib/array/Array#__set - global.get $std/array/arr - i32.const 2 - i32.const 2 - call $~lib/array/Array#__set - global.get $std/array/arr - i32.const 3 - i32.const 3 - call $~lib/array/Array#__set - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 399 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 402 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 405 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 4 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 413 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 8 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 414 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 5 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 416 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 6 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 429 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 430 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 7 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 438 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 8 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 441 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 9 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 449 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 8 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 450 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 10 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 452 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 11 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 465 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 466 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 12 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 474 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 13 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 477 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 14 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 485 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 8 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 486 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 15 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 488 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 16 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 501 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 502 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 17 - call $~lib/array/Array#forEach - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 511 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 18 - call $~lib/array/Array#forEach - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 520 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 8 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 521 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 19 - call $~lib/array/Array#forEach - global.get $std/array/i - i32.const 406 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 524 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 20 - call $~lib/array/Array#forEach - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 538 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 539 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 21 - call $~lib/array/Array#forEach - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 100 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 564 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - block $break|0 - i32.const 0 - local.set $0 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_s - i32.eqz - br_if $break|0 - global.get $std/array/arr - call $~lib/array/Array#pop - drop - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 + block + i32.const 0 + call $~lib/array/Array.isArray<~lib/array/Array | null> + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 37 + i32.const 2 + call $~lib/builtins/abort unreachable end - unreachable + global.get $std/array/arr + call $~lib/array/Array.isArray<~lib/array/Array> + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $std/array/P#constructor + local.tee $0 + call $~lib/array/Array.isArray + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 39 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/array/Array.isArray<~lib/typedarray/Uint8Array> + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $~lib/array/Array.isArray + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 41 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 272 + call $~lib/array/Array.isArray<~lib/string/String> + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 42 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 22 - call $~lib/array/Array#map - global.set $std/array/newArr - global.get $std/array/newArr - call $~lib/array/Array#get:length - i32.const 4 - i32.eq - i32.eqz - if + block + i32.const 5 i32.const 0 - i32.const 160 - i32.const 575 + i32.const 20 + i32.const 296 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $0 + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 + i32.const 1 + i32.const 1 + i32.const 3 + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $1 + i32.const 5 i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/newArr - i32.const 0 - call $~lib/array/Array#__get - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - f32.convert_i32_s - f32.eq - i32.eqz - if + i32.const 20 + i32.const 376 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $3 i32.const 0 - i32.const 160 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 50 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 0 + i32.const 0 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $1 + i32.const 5 + i32.const 0 + i32.const 20 + i32.const 504 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $4 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 53 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.const 0 + i32.const -3 + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $1 + i32.const 5 + i32.const 0 + i32.const 20 + i32.const 528 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $5 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 56 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 2 + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $1 + i32.const 5 + i32.const 0 + i32.const 20 + i32.const 552 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $6 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 59 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 0 + i32.const 1 + i32.const 0 + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $1 + i32.const 5 + i32.const 0 + i32.const 20 i32.const 576 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $7 i32.const 0 - call $~lib/builtins/abort - unreachable + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 62 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 23 - call $~lib/array/Array#map - drop - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if + block + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 600 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $6 + call $~lib/rt/purerc/__retain + local.set $7 + local.get $7 + i32.const 1 + i32.const 1 + i32.const 3 + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 640 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $4 i32.const 0 - i32.const 160 - i32.const 585 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 69 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 8 - i32.eq - i32.eqz - if i32.const 0 - i32.const 160 - i32.const 586 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 680 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $3 i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 24 - call $~lib/array/Array#map - drop - global.get $std/array/i - i32.const 406 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 72 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 + i32.const 1 i32.const 0 - i32.const 160 - i32.const 593 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 25 - call $~lib/array/Array#map - drop - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 608 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 609 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 26 - call $~lib/array/Array#filter - global.set $std/array/filteredArr - global.get $std/array/filteredArr - call $~lib/array/Array#get:length - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 617 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 27 - call $~lib/array/Array#filter - drop - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 626 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 8 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 627 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 28 - call $~lib/array/Array#filter - drop - global.get $std/array/i - i32.const 406 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 634 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 29 - call $~lib/array/Array#filter - drop - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 649 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 650 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 30 - i32.const 0 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 658 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 31 - i32.const 4 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 10 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 662 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 32 - i32.const 0 - call $~lib/array/Array#reduce - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 665 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 33 - i32.const 0 - call $~lib/array/Array#reduce - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 668 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 34 - i32.const 0 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 676 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 8 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 677 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 35 - i32.const 0 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 10 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 679 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 36 - i32.const 0 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 692 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 693 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 37 - i32.const 0 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 701 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 38 - i32.const 4 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 10 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 705 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 39 - i32.const 0 - call $~lib/array/Array#reduceRight - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 708 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 40 - i32.const 0 - call $~lib/array/Array#reduceRight - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 711 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - i32.const 41 - i32.const 0 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 719 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 8 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 160 + i32.const -3 + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 21 i32.const 720 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $1 i32.const 0 - call $~lib/builtins/abort - unreachable + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 75 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 + i32.const 2 + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 760 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $0 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 78 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 + i32.const 0 + i32.const 1 + i32.const 0 + call $~lib/array/Array#fill + call $~lib/rt/purerc/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 800 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $2 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 81 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $6 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release end - global.get $std/array/arr - i32.const 42 - i32.const 0 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 10 - i32.eq - i32.eqz - if + block + global.get $std/array/arr + call $~lib/array/Array#get:length i32.const 0 - i32.const 160 - i32.const 722 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 87 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity i32.const 0 - call $~lib/builtins/abort - unreachable + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 88 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 42 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 92 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 93 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 94 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + local.set $2 + local.get $2 + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 98 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 99 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 100 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + call $~lib/array/Array#push + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 105 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 106 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 44 + call $~lib/array/Array#push + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 110 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 111 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 112 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 113 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 45 + call $~lib/array/Array#push + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 117 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 118 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 119 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 120 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 121 + i32.const 2 + call $~lib/builtins/abort + unreachable + end end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 43 - i32.const 0 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if + block i32.const 0 - i32.const 160 - i32.const 735 i32.const 0 - call $~lib/builtins/abort - unreachable + call $~lib/array/Array#constructor + local.set $2 + global.get $std/array/arr + local.get $2 + call $~lib/array/Array#concat + local.set $0 + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 130 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 131 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 132 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 888 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $3 + call $~lib/array/Array#concat + call $~lib/rt/purerc/__release + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 135 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 137 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 138 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 139 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 46 + call $~lib/array/Array#push + drop + local.get $2 + i32.const 47 + call $~lib/array/Array#push + drop + block (result i32) + local.get $0 + call $~lib/rt/purerc/__release + global.get $std/array/arr + local.get $2 + call $~lib/array/Array#concat + end + local.set $0 + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 146 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 147 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/array/Array#get:length + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 148 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 149 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 150 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 151 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + call $~lib/array/Array#__get + i32.const 46 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 152 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 4 + call $~lib/array/Array#__get + i32.const 47 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 153 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/array/Array#pop + drop + local.get $0 + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 156 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $0 + call $~lib/rt/purerc/__release + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#concat + end + local.set $0 + local.get $0 + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 159 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 160 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 904 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $4 + call $~lib/rt/purerc/__retain + local.set $1 + local.get $1 + call $~lib/array/Array#get:length + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 163 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + global.get $std/array/arr + call $~lib/array/Array#concat + end + local.set $0 + local.get $0 + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 165 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/array/Array#get:length + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 166 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release end - global.get $std/array/arr - call $~lib/array/Array#get:length - i32.const 0 - i32.eq - i32.eqz - if + block i32.const 0 - i32.const 160 - i32.const 736 + local.set $1 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 920 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $3 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 i32.const 0 - call $~lib/builtins/abort - unreachable + i32.const 3 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $4 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 960 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $2 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 174 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1000 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $7 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 1 + i32.const 3 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $0 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1040 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $5 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 176 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1080 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $8 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 1 + i32.const 2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $6 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1120 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $10 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 178 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1160 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $11 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 2 + i32.const 2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $9 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1200 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $13 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 180 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1240 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $14 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 0 + i32.const 3 + i32.const 4 + call $~lib/array/Array#copyWithin + local.tee $12 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1280 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $16 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 182 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1320 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $17 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 1 + i32.const 3 + i32.const 4 + call $~lib/array/Array#copyWithin + local.tee $15 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1360 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $19 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 184 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1400 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $20 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 1 + i32.const 2 + i32.const 4 + call $~lib/array/Array#copyWithin + local.tee $18 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1440 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $22 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 186 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1480 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $23 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 0 + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $21 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1520 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $25 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 188 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1560 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $26 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const 0 + i32.const -2 + i32.const -1 + call $~lib/array/Array#copyWithin + local.tee $24 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1600 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $28 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 190 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1640 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $29 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const -4 + i32.const -3 + i32.const -2 + call $~lib/array/Array#copyWithin + local.tee $27 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1680 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $31 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 192 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1720 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $32 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const -4 + i32.const -3 + i32.const -1 + call $~lib/array/Array#copyWithin + local.tee $30 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1760 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $34 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 194 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1800 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $35 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + local.get $1 + i32.const -4 + i32.const -3 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $33 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1840 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $37 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 196 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $10 + call $~lib/rt/purerc/__release + local.get $11 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $13 + call $~lib/rt/purerc/__release + local.get $14 + call $~lib/rt/purerc/__release + local.get $12 + call $~lib/rt/purerc/__release + local.get $16 + call $~lib/rt/purerc/__release + local.get $17 + call $~lib/rt/purerc/__release + local.get $15 + call $~lib/rt/purerc/__release + local.get $19 + call $~lib/rt/purerc/__release + local.get $20 + call $~lib/rt/purerc/__release + local.get $18 + call $~lib/rt/purerc/__release + local.get $22 + call $~lib/rt/purerc/__release + local.get $23 + call $~lib/rt/purerc/__release + local.get $21 + call $~lib/rt/purerc/__release + local.get $25 + call $~lib/rt/purerc/__release + local.get $26 + call $~lib/rt/purerc/__release + local.get $24 + call $~lib/rt/purerc/__release + local.get $28 + call $~lib/rt/purerc/__release + local.get $29 + call $~lib/rt/purerc/__release + local.get $27 + call $~lib/rt/purerc/__release + local.get $31 + call $~lib/rt/purerc/__release + local.get $32 + call $~lib/rt/purerc/__release + local.get $30 + call $~lib/rt/purerc/__release + local.get $34 + call $~lib/rt/purerc/__release + local.get $35 + call $~lib/rt/purerc/__release + local.get $33 + call $~lib/rt/purerc/__release + local.get $37 + call $~lib/rt/purerc/__release + end + block + global.get $std/array/arr + i32.const 42 + call $~lib/array/Array#unshift + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 204 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 205 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 206 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 207 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 208 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 209 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 41 + call $~lib/array/Array#unshift + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 213 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 214 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 41 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 215 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 216 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 217 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 218 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 4 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 219 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + end + block + global.get $std/array/arr + call $~lib/array/Array#shift + global.set $std/array/i + global.get $std/array/i + i32.const 41 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 228 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 229 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 230 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 231 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 232 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 233 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 234 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + global.set $std/array/i + global.get $std/array/i + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 238 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 239 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 240 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 241 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 242 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 243 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + end + block + global.get $std/array/arr + call $~lib/array/Array#reverse + call $~lib/rt/purerc/__release + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 251 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 252 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 253 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 254 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 255 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 44 + call $~lib/array/Array#push + drop + end + block + global.get $std/array/arr + i32.const 44 + i32.const 0 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 265 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 42 + i32.const 0 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 268 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 45 + i32.const 0 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 271 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 100 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 274 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -100 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 277 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -2 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 280 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -4 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 283 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 0 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 286 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 1 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 289 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 2 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 292 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + end + block + global.get $std/array/arr + i32.const 44 + i32.const 0 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 299 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 42 + i32.const 0 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 302 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 45 + i32.const 0 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 305 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 100 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 308 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -100 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 311 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -2 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 314 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -4 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 317 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 0 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 320 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 1 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 323 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 2 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 326 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + i32.const 1 + call $~lib/array/Array#splice + call $~lib/rt/purerc/__release + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 330 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 331 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 332 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 333 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + end + block + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1880 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $33 + call $~lib/rt/purerc/__retain + local.set $37 + local.get $37 + i32.const 0 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#splice + local.tee $35 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1920 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $30 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 340 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 1960 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $32 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 341 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 1976 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $31 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#splice + local.tee $34 + i32.const 3 + i32.const 2 + i32.const 17 + i32.const 2016 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $29 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 344 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 2048 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $28 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 345 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2072 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $24 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 2 + i32.const 2 + call $~lib/array/Array#splice + local.tee $27 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 2112 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $25 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 348 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 3 + i32.const 2 + i32.const 17 + i32.const 2136 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $21 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 349 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2168 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $23 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 0 + i32.const 1 + call $~lib/array/Array#splice + local.tee $26 + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 2208 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $18 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 352 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 2232 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $20 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 353 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2264 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $19 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const -1 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#splice + local.tee $22 + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 2304 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $17 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 356 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 2328 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $16 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 357 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2360 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $12 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#splice + local.tee $15 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 2400 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $13 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 360 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 3 + i32.const 2 + i32.const 17 + i32.const 2424 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $9 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 361 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2456 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $11 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const -2 + i32.const 1 + call $~lib/array/Array#splice + local.tee $14 + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 2496 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $6 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 364 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 2520 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $8 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 365 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2552 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $5 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const -7 + i32.const 1 + call $~lib/array/Array#splice + local.tee $10 + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 2592 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $7 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 368 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 2616 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $2 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 369 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2648 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $4 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const -2 + i32.const -1 + call $~lib/array/Array#splice + local.tee $0 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 2688 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $1 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 372 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2704 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $36 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 373 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2744 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $38 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 1 + i32.const -2 + call $~lib/array/Array#splice + local.tee $3 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 2784 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $40 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 376 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2800 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $41 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 377 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2840 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $42 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 4 + i32.const 0 + call $~lib/array/Array#splice + local.tee $39 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 2880 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $44 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 380 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2896 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $45 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 381 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2936 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $46 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 7 + i32.const 0 + call $~lib/array/Array#splice + local.tee $43 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 2976 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $48 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 384 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 2992 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $49 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 385 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 3032 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $50 + local.get $37 + call $~lib/rt/purerc/__retainRelease + local.set $37 + local.get $37 + i32.const 7 + i32.const 5 + call $~lib/array/Array#splice + local.tee $47 + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 3072 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $52 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 388 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 3088 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $53 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 389 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $33 + call $~lib/rt/purerc/__release + local.get $37 + call $~lib/rt/purerc/__release + local.get $35 + call $~lib/rt/purerc/__release + local.get $30 + call $~lib/rt/purerc/__release + local.get $32 + call $~lib/rt/purerc/__release + local.get $31 + call $~lib/rt/purerc/__release + local.get $34 + call $~lib/rt/purerc/__release + local.get $29 + call $~lib/rt/purerc/__release + local.get $28 + call $~lib/rt/purerc/__release + local.get $24 + call $~lib/rt/purerc/__release + local.get $27 + call $~lib/rt/purerc/__release + local.get $25 + call $~lib/rt/purerc/__release + local.get $21 + call $~lib/rt/purerc/__release + local.get $23 + call $~lib/rt/purerc/__release + local.get $26 + call $~lib/rt/purerc/__release + local.get $18 + call $~lib/rt/purerc/__release + local.get $20 + call $~lib/rt/purerc/__release + local.get $19 + call $~lib/rt/purerc/__release + local.get $22 + call $~lib/rt/purerc/__release + local.get $17 + call $~lib/rt/purerc/__release + local.get $16 + call $~lib/rt/purerc/__release + local.get $12 + call $~lib/rt/purerc/__release + local.get $15 + call $~lib/rt/purerc/__release + local.get $13 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $11 + call $~lib/rt/purerc/__release + local.get $14 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $10 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $36 + call $~lib/rt/purerc/__release + local.get $38 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $40 + call $~lib/rt/purerc/__release + local.get $41 + call $~lib/rt/purerc/__release + local.get $42 + call $~lib/rt/purerc/__release + local.get $39 + call $~lib/rt/purerc/__release + local.get $44 + call $~lib/rt/purerc/__release + local.get $45 + call $~lib/rt/purerc/__release + local.get $46 + call $~lib/rt/purerc/__release + local.get $43 + call $~lib/rt/purerc/__release + local.get $48 + call $~lib/rt/purerc/__release + local.get $49 + call $~lib/rt/purerc/__release + local.get $50 + call $~lib/rt/purerc/__release + local.get $47 + call $~lib/rt/purerc/__release + local.get $52 + call $~lib/rt/purerc/__release + local.get $53 + call $~lib/rt/purerc/__release + end + block + global.get $std/array/arr + i32.const 0 + i32.const 0 + call $~lib/array/Array#__set + global.get $std/array/arr + i32.const 1 + i32.const 1 + call $~lib/array/Array#__set + global.get $std/array/arr + i32.const 2 + i32.const 2 + call $~lib/array/Array#__set + global.get $std/array/arr + i32.const 3 + i32.const 3 + call $~lib/array/Array#__set + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 402 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 405 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 408 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 4 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 416 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 417 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 5 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 419 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 6 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 432 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 433 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + end + block + global.get $std/array/arr + i32.const 7 + call $~lib/array/Array#every + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 443 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 8 + call $~lib/array/Array#every + local.set $53 + local.get $53 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 446 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 9 + call $~lib/array/Array#every + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 454 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 455 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 10 + call $~lib/array/Array#every + local.set $53 + local.get $53 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 457 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 11 + call $~lib/array/Array#every + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 470 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 471 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + end + block + global.get $std/array/arr + i32.const 12 + call $~lib/array/Array#some + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 481 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 13 + call $~lib/array/Array#some + local.set $53 + local.get $53 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 484 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 14 + call $~lib/array/Array#some + local.set $53 + local.get $53 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 492 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 493 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 15 + call $~lib/array/Array#some + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 495 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 16 + call $~lib/array/Array#some + local.set $53 + local.get $53 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 508 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 509 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + end + block + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 17 + call $~lib/array/Array#forEach + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 520 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 18 + call $~lib/array/Array#forEach + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 529 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 19 + call $~lib/array/Array#forEach + global.get $std/array/i + i32.const 406 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 533 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 20 + call $~lib/array/Array#forEach + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 547 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 548 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 21 + call $~lib/array/Array#forEach + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 573 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|0 + i32.const 0 + local.set $53 + loop $repeat|0 + local.get $53 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|0 + global.get $std/array/arr + call $~lib/array/Array#pop + drop + local.get $53 + i32.const 1 + i32.add + local.set $53 + br $repeat|0 + unreachable + end + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + end + block + global.get $std/array/arr + i32.const 22 + call $~lib/array/Array#map + local.set $53 + local.get $53 + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 587 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $53 + i32.const 0 + call $~lib/array/Array#__get + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + f32.convert_i32_s + f32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 588 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 23 + call $~lib/array/Array#map + call $~lib/rt/purerc/__release + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 597 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 598 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 24 + call $~lib/array/Array#map + call $~lib/rt/purerc/__release + global.get $std/array/i + i32.const 406 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 605 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 25 + call $~lib/array/Array#map + call $~lib/rt/purerc/__release + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 620 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 621 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + local.get $53 + call $~lib/rt/purerc/__release + end + block + global.get $std/array/arr + i32.const 26 + call $~lib/array/Array#filter + local.set $53 + local.get $53 + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 631 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 27 + call $~lib/array/Array#filter + call $~lib/rt/purerc/__release + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 640 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 641 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 28 + call $~lib/array/Array#filter + call $~lib/rt/purerc/__release + global.get $std/array/i + i32.const 406 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 648 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + i32.const 0 + global.set $std/array/i + global.get $std/array/arr + i32.const 29 + call $~lib/array/Array#filter + call $~lib/rt/purerc/__release + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 663 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 664 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + local.get $53 + call $~lib/rt/purerc/__release + end + block + global.get $std/array/arr + i32.const 30 + i32.const 0 + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 674 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 31 + i32.const 4 + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 678 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 32 + i32.const 0 + call $~lib/array/Array#reduce + local.set $53 + local.get $53 + i32.const 0 + i32.ne + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 681 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 33 + i32.const 0 + call $~lib/array/Array#reduce + local.set $53 + local.get $53 + i32.const 0 + i32.ne + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 684 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 34 + i32.const 0 + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 692 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 693 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 35 + i32.const 0 + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 695 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 36 + i32.const 0 + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 708 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 709 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + end + block + global.get $std/array/arr + i32.const 37 + i32.const 0 + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 719 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 38 + i32.const 4 + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 723 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 39 + i32.const 0 + call $~lib/array/Array#reduceRight + local.set $53 + local.get $53 + i32.const 0 + i32.ne + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 726 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 40 + i32.const 0 + call $~lib/array/Array#reduceRight + local.set $53 + local.get $53 + i32.const 0 + i32.ne + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 729 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 41 + i32.const 0 + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 737 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 738 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 42 + i32.const 0 + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 740 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 43 + i32.const 0 + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 753 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 754 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop call $~lib/bindings/Math/random i64.reinterpret_f64 call $~lib/math/NativeMath.seedRandom - block (result i32) + block + i32.const 8 + i32.const 2 + i32.const 22 + i32.const 3360 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $52 + call $~lib/rt/purerc/__retain + local.set $53 i32.const 0 global.set $~lib/argc - global.get $std/array/f32ArrayTyped + local.get $53 i32.const 0 call $~lib/array/Array#sort|trampoline - end - drop - global.get $std/array/f32ArrayTyped - i32.const 8 - i32.const 2 - i32.const 22 - i32.const 3312 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $~lib/rt/purerc/__release + local.get $53 + i32.const 8 + i32.const 2 + i32.const 22 + i32.const 3408 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $50 i32.const 0 - i32.const 160 - i32.const 824 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - block (result i32) + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 843 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 8 + i32.const 3 + i32.const 23 + i32.const 3456 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $49 + call $~lib/rt/purerc/__retain + local.set $47 i32.const 0 global.set $~lib/argc - global.get $std/array/f64ArrayTyped + local.get $47 i32.const 0 call $~lib/array/Array#sort|trampoline - end - drop - global.get $std/array/f64ArrayTyped - i32.const 8 - i32.const 3 - i32.const 23 - i32.const 3472 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $~lib/rt/purerc/__release + local.get $47 + i32.const 8 + i32.const 3 + i32.const 23 + i32.const 3536 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $43 i32.const 0 - i32.const 160 - i32.const 828 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - block (result i32) + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 847 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 3616 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $46 + call $~lib/rt/purerc/__retain + local.set $48 i32.const 0 global.set $~lib/argc - global.get $std/array/i32ArrayTyped + local.get $48 i32.const 0 call $~lib/array/Array#sort|trampoline - end - drop - global.get $std/array/i32ArrayTyped - i32.const 5 - i32.const 2 - i32.const 17 - i32.const 3624 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $~lib/rt/purerc/__release + local.get $48 + i32.const 5 + i32.const 2 + i32.const 17 + i32.const 3656 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $44 i32.const 0 - i32.const 160 - i32.const 832 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - block (result i32) + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 851 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 3696 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $39 + call $~lib/rt/purerc/__retain + local.set $45 i32.const 0 global.set $~lib/argc - global.get $std/array/u32ArrayTyped + local.get $45 i32.const 0 call $~lib/array/Array#sort|trampoline + call $~lib/rt/purerc/__release + local.get $45 + i32.const 5 + i32.const 2 + i32.const 21 + i32.const 3736 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $41 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 855 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 3776 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $40 + call $~lib/rt/purerc/__retain + local.set $42 + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 3792 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $38 + call $~lib/rt/purerc/__retain + local.set $3 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 3816 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $1 + call $~lib/rt/purerc/__retain + local.set $36 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 3840 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $4 + call $~lib/rt/purerc/__retain + local.set $0 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 3872 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $7 + call $~lib/rt/purerc/__retain + local.set $2 + i32.const 64 + call $std/array/createReverseOrderedArray + local.set $10 + i32.const 128 + call $std/array/createReverseOrderedArray + local.set $5 + i32.const 1024 + call $std/array/createReverseOrderedArray + local.set $8 + i32.const 10000 + call $std/array/createReverseOrderedArray + local.set $6 + i32.const 512 + call $std/array/createRandomOrderedArray + local.set $14 + local.get $42 + call $std/array/assertSortedDefault + local.get $3 + call $std/array/assertSortedDefault + local.get $3 + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 3960 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $9 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 875 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $36 + call $std/array/assertSortedDefault + local.get $36 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 3984 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $13 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 878 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $std/array/assertSortedDefault + local.get $0 + local.get $2 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 881 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $10 + call $std/array/assertSortedDefault + local.get $10 + local.get $2 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 884 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $5 + call $std/array/assertSortedDefault + local.get $5 + local.get $2 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 887 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $8 + call $std/array/assertSortedDefault + local.get $8 + local.get $2 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 890 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $6 + call $std/array/assertSortedDefault + local.get $6 + local.get $2 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 893 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $14 + call $std/array/assertSortedDefault + local.get $52 + call $~lib/rt/purerc/__release + local.get $53 + call $~lib/rt/purerc/__release + local.get $50 + call $~lib/rt/purerc/__release + local.get $49 + call $~lib/rt/purerc/__release + local.get $47 + call $~lib/rt/purerc/__release + local.get $43 + call $~lib/rt/purerc/__release + local.get $46 + call $~lib/rt/purerc/__release + local.get $48 + call $~lib/rt/purerc/__release + local.get $44 + call $~lib/rt/purerc/__release + local.get $39 + call $~lib/rt/purerc/__release + local.get $45 + call $~lib/rt/purerc/__release + local.get $41 + call $~lib/rt/purerc/__release + local.get $40 + call $~lib/rt/purerc/__release + local.get $42 + call $~lib/rt/purerc/__release + local.get $38 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $36 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $0 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $10 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $14 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $13 + call $~lib/rt/purerc/__release end - drop - global.get $std/array/u32ArrayTyped - i32.const 5 - i32.const 2 - i32.const 21 - i32.const 3736 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 836 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 64 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed64 - i32.const 128 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed128 - i32.const 1024 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed1024 - i32.const 10000 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed10000 - i32.const 512 - call $std/array/createRandomOrderedArray - global.set $std/array/randomized512 - global.get $std/array/reversed0 - call $std/array/assertSortedDefault - global.get $std/array/reversed1 - call $std/array/assertSortedDefault - global.get $std/array/reversed1 - i32.const 1 - i32.const 2 - i32.const 17 - i32.const 4064 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 856 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed2 - call $std/array/assertSortedDefault - global.get $std/array/reversed2 - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 4088 - call $~lib/util/runtime/makeArray - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 859 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed4 - call $std/array/assertSortedDefault - global.get $std/array/reversed4 - global.get $std/array/expected4 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 862 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed64 - call $std/array/assertSortedDefault - global.get $std/array/reversed64 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 865 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed128 - call $std/array/assertSortedDefault - global.get $std/array/reversed128 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 868 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed1024 - call $std/array/assertSortedDefault - global.get $std/array/reversed1024 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 871 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed10000 - call $std/array/assertSortedDefault - global.get $std/array/reversed10000 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 874 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/randomized512 - call $std/array/assertSortedDefault - i32.const 64 - call $std/array/createRandomOrderedArray - global.set $std/array/randomized64 - i32.const 257 - call $std/array/createRandomOrderedArray - global.set $std/array/randomized257 - global.get $std/array/randomized64 - i32.const 49 - call $std/array/assertSorted - global.get $std/array/randomized64 - i32.const 50 - call $std/array/assertSorted - global.get $std/array/randomized257 - i32.const 51 - call $std/array/assertSorted - global.get $std/array/randomized257 - i32.const 52 - call $std/array/assertSorted - i32.const 512 - call $std/array/createReverseOrderedNestedArray - global.set $std/array/reversedNested512 - global.get $std/array/reversedNested512 - i32.const 53 - call $std/array/assertSorted<~lib/array/Array> - i32.const 512 - call $std/array/createReverseOrderedElementsArray - global.set $std/array/reversedElements512 - global.get $std/array/reversedElements512 - i32.const 54 - call $std/array/assertSorted> block + i32.const 64 + call $std/array/createRandomOrderedArray + local.set $13 + i32.const 257 + call $std/array/createRandomOrderedArray + local.set $9 + local.get $13 + i32.const 49 + call $std/array/assertSorted + local.get $13 + i32.const 50 + call $std/array/assertSorted + local.get $9 + i32.const 51 + call $std/array/assertSorted + local.get $9 + i32.const 52 + call $std/array/assertSorted + local.get $13 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + end + block + i32.const 2 + call $std/array/createReverseOrderedNestedArray + local.set $9 + local.get $9 + i32.const 53 + call $std/array/assertSorted<~lib/array/Array> + local.get $9 + call $~lib/rt/purerc/__release + end + block + i32.const 512 + call $std/array/createReverseOrderedElementsArray + local.set $9 + local.get $9 + i32.const 54 + call $std/array/assertSorted> + local.get $9 + call $~lib/rt/purerc/__release + end + block + i32.const 7 + i32.const 2 + i32.const 27 + i32.const 4288 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $13 + call $~lib/rt/purerc/__retain + local.set $9 + i32.const 7 + i32.const 2 + i32.const 27 + i32.const 4336 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $6 + call $~lib/rt/purerc/__retain + local.set $14 i32.const 1 global.set $~lib/argc - global.get $std/array/randomStringsActual + local.get $9 i32.const 0 call $std/array/assertSorted<~lib/string/String | null>|trampoline - end - global.get $std/array/randomStringsActual - global.get $std/array/randomStringsExpected - i32.const 0 - call $std/array/isArraysEqual<~lib/string/String | null> - i32.eqz - if + local.get $9 + local.get $14 i32.const 0 - i32.const 160 - i32.const 904 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 400 - call $std/array/createRandomStringArray - global.set $std/array/randomStrings400 - block + call $std/array/isArraysEqual<~lib/string/String | null> + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 930 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 400 + call $std/array/createRandomStringArray + local.set $8 i32.const 1 global.set $~lib/argc - global.get $std/array/randomStrings400 + local.get $8 i32.const 0 call $std/array/assertSorted<~lib/string/String>|trampoline + local.get $13 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $14 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release end - i32.const 2 - i32.const 0 - i32.const 29 - i32.const 4560 - call $~lib/util/runtime/makeArray - i32.const 4536 - call $~lib/array/Array#join - i32.const 4584 - call $~lib/string/String.__eq - i32.eqz - if + block + i32.const 2 i32.const 0 - i32.const 160 - i32.const 913 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 3 - i32.const 2 - i32.const 17 - i32.const 5128 - call $~lib/util/runtime/makeArray - i32.const 4208 - call $~lib/array/Array#join - i32.const 5160 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 914 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 3 - i32.const 2 - i32.const 21 - i32.const 5248 - call $~lib/util/runtime/makeArray - i32.const 5224 - call $~lib/array/Array#join - i32.const 5160 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 915 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 5328 - call $~lib/util/runtime/makeArray - i32.const 5304 - call $~lib/array/Array#join - i32.const 5352 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 916 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 6 - i32.const 3 - i32.const 23 - i32.const 6680 - call $~lib/util/runtime/makeArray - i32.const 5480 - call $~lib/array/Array#join - i32.const 6744 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 917 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 3 - i32.const 2 - i32.const 28 - i32.const 6896 - call $~lib/util/runtime/makeArray - i32.const 4208 - call $~lib/array/Array<~lib/string/String>#join - i32.const 6840 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 918 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - block (result i32) + i32.const 29 + i32.const 4456 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $14 + i32.const 4536 + call $~lib/array/Array#join + local.tee $8 + i32.const 4560 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 941 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 3 i32.const 2 - i32.const 33 - i32.const 0 - call $~lib/util/runtime/makeArray - local.set $0 - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 + i32.const 17 + i32.const 4600 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $9 + i32.const 4272 + call $~lib/array/Array#join + local.tee $6 + i32.const 5104 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 942 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 2 + i32.const 21 + i32.const 5136 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $5 + i32.const 5168 + call $~lib/array/Array#join + local.tee $13 + i32.const 5104 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 943 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 5192 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $2 + i32.const 5216 + call $~lib/array/Array#join + local.tee $10 + i32.const 5240 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 944 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 6 + i32.const 3 + i32.const 23 + i32.const 5304 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $0 + i32.const 5368 + call $~lib/array/Array#join + local.tee $7 + i32.const 6568 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 945 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 2 + i32.const 28 + i32.const 6688 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $36 + i32.const 4272 + call $~lib/array/Array<~lib/string/String>#join + local.tee $4 + i32.const 6664 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 946 + i32.const 2 + call $~lib/builtins/abort + unreachable + end block (result i32) + i32.const 3 + i32.const 2 + i32.const 33 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $1 + local.get $1 + i32.load offset=4 + local.set $3 + local.get $3 i32.const 0 call $std/array/Ref#constructor - local.set $2 - local.get $2 - if - local.get $2 - local.get $0 - call $~lib/collector/dummy/__ref_link - end - local.get $2 - end - i32.store - local.get $1 - block (result i32) + local.tee $38 + call $~lib/rt/purerc/__retain + i32.store + local.get $3 i32.const 0 - local.set $2 - local.get $2 - if - local.get $2 - local.get $0 - call $~lib/collector/dummy/__ref_link - end - local.get $2 - end - i32.store offset=4 - local.get $1 - block (result i32) + call $~lib/rt/purerc/__retain + i32.store offset=4 + local.get $3 i32.const 0 call $std/array/Ref#constructor - local.set $2 - local.get $2 - if - local.get $2 - local.get $0 - call $~lib/collector/dummy/__ref_link - end - local.get $2 - end - i32.store offset=8 - local.get $0 - end - global.set $std/array/refArr - global.get $std/array/refArr - i32.const 4536 - call $~lib/array/Array#join - i32.const 6976 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 920 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed0 - call $~lib/array/Array#toString - i32.const 4208 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 924 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed1 - call $~lib/array/Array#toString - i32.const 6840 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 925 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed2 - call $~lib/array/Array#toString - i32.const 7056 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 926 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/reversed4 - call $~lib/array/Array#toString - i32.const 7080 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 927 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 3 - i32.const 0 - i32.const 34 - i32.const 7136 - call $~lib/util/runtime/makeArray - call $~lib/array/Array#toString - i32.const 7160 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 929 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 3 - i32.const 1 - i32.const 35 - i32.const 7216 - call $~lib/util/runtime/makeArray - call $~lib/array/Array#toString - i32.const 7240 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 930 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 3 - i32.const 3 - i32.const 30 - i32.const 7320 - call $~lib/util/runtime/makeArray - call $~lib/array/Array#toString - i32.const 7360 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 931 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 4 - i32.const 3 - i32.const 36 - i32.const 7472 - call $~lib/util/runtime/makeArray - call $~lib/array/Array#toString - i32.const 7520 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 932 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/array/randomStringsExpected - call $~lib/array/Array<~lib/string/String | null>#toString - i32.const 7624 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 933 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 4 - i32.const 2 - i32.const 28 - i32.const 7752 - call $~lib/util/runtime/makeArray - call $~lib/array/Array<~lib/string/String>#toString - i32.const 7784 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 934 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - block (result i32) - i32.const 2 - i32.const 2 - i32.const 24 - i32.const 0 - call $~lib/util/runtime/makeArray - local.set $1 - local.get $1 - i32.load offset=4 - local.set $0 - local.get $0 - block (result i32) - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 7840 - call $~lib/util/runtime/makeArray - local.set $2 - local.get $2 + local.tee $42 + call $~lib/rt/purerc/__retain + i32.store offset=8 local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 end - i32.store + call $~lib/rt/purerc/__retain + local.set $3 + local.get $3 + i32.const 4536 + call $~lib/array/Array#join + local.tee $1 + i32.const 6768 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 948 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $14 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $13 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $10 + call $~lib/rt/purerc/__release local.get $0 - block (result i32) - i32.const 2 - i32.const 2 - i32.const 17 - i32.const 7864 - call $~lib/util/runtime/makeArray - local.set $2 - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - end - i32.store offset=4 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $36 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $38 + call $~lib/rt/purerc/__release + local.get $42 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release local.get $1 + call $~lib/rt/purerc/__release end - global.set $std/array/subarr32 - global.get $std/array/subarr32 - call $~lib/array/Array<~lib/array/Array>#toString - i32.const 7888 - call $~lib/string/String.__eq - i32.eqz - if + block i32.const 0 - i32.const 160 - i32.const 937 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - block (result i32) i32.const 2 - i32.const 2 - i32.const 37 - i32.const 0 - call $~lib/util/runtime/makeArray - local.set $0 - local.get $0 - i32.load offset=4 + i32.const 17 + i32.const 6848 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $3 + call $~lib/rt/purerc/__retain local.set $1 - local.get $1 - block (result i32) - i32.const 2 - i32.const 0 - i32.const 20 - i32.const 7944 - call $~lib/util/runtime/makeArray - local.set $2 - local.get $2 - local.get $0 - call $~lib/collector/dummy/__ref_link - local.get $2 - end - i32.store - local.get $1 - block (result i32) - i32.const 2 - i32.const 0 - i32.const 20 - i32.const 7968 - call $~lib/util/runtime/makeArray - local.set $2 - local.get $2 - local.get $0 - call $~lib/collector/dummy/__ref_link - local.get $2 - end - i32.store offset=4 - local.get $0 - end - global.set $std/array/subarr8 - global.get $std/array/subarr8 - call $~lib/array/Array<~lib/array/Array>#toString - i32.const 7888 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 940 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - block (result i32) i32.const 1 i32.const 2 - i32.const 39 - i32.const 0 - call $~lib/util/runtime/makeArray - local.set $0 - local.get $0 - i32.load offset=4 - local.set $1 + i32.const 17 + i32.const 6864 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $38 + call $~lib/rt/purerc/__retain + local.set $42 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 6888 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $36 + call $~lib/rt/purerc/__retain + local.set $4 + i32.const 4 + i32.const 2 + i32.const 17 + i32.const 6912 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $0 + call $~lib/rt/purerc/__retain + local.set $7 local.get $1 + call $~lib/array/Array#toString + local.tee $10 + i32.const 4272 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 958 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $42 + call $~lib/array/Array#toString + local.tee $2 + i32.const 6664 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 959 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $4 + call $~lib/array/Array#toString + local.tee $13 + i32.const 6944 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 960 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 + call $~lib/array/Array#toString + local.tee $5 + i32.const 6968 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 961 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 0 + i32.const 34 + i32.const 7000 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $9 + call $~lib/array/Array#toString + local.tee $6 + i32.const 7024 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 963 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 1 + i32.const 35 + i32.const 7056 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $14 + call $~lib/array/Array#toString + local.tee $8 + i32.const 7080 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 964 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 3 + i32.const 30 + i32.const 7120 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $41 + call $~lib/array/Array#toString + local.tee $40 + i32.const 7160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 965 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 3 + i32.const 36 + i32.const 7224 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $39 + call $~lib/array/Array#toString + local.tee $45 + i32.const 7272 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 966 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 7 + i32.const 2 + i32.const 27 + i32.const 7376 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $48 + call $~lib/rt/purerc/__retain + local.set $44 + local.get $44 + call $~lib/array/Array<~lib/string/String | null>#toString + local.tee $46 + i32.const 7424 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 970 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 2 + i32.const 28 + i32.const 7520 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $47 + call $~lib/array/Array<~lib/string/String>#toString + local.tee $43 + i32.const 7552 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 971 + i32.const 2 + call $~lib/builtins/abort + unreachable + end block (result i32) + i32.const 2 + i32.const 2 + i32.const 24 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $49 + local.get $49 + i32.load offset=4 + local.set $50 + local.get $50 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 7584 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $52 + call $~lib/rt/purerc/__retain + i32.store + local.get $50 + i32.const 2 + i32.const 2 + i32.const 17 + i32.const 7608 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $11 + call $~lib/rt/purerc/__retain + i32.store offset=4 + local.get $49 + end + call $~lib/rt/purerc/__retain + local.set $54 + local.get $54 + call $~lib/array/Array<~lib/array/Array>#toString + local.tee $50 + i32.const 7632 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 974 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 2 + i32.const 2 + i32.const 37 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $49 + local.get $49 + i32.load offset=4 + local.set $53 + local.get $53 + i32.const 2 + i32.const 0 + i32.const 20 + i32.const 7664 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $12 + call $~lib/rt/purerc/__retain + i32.store + local.get $53 + i32.const 2 + i32.const 0 + i32.const 20 + i32.const 7688 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $16 + call $~lib/rt/purerc/__retain + i32.store offset=4 + local.get $49 + end + call $~lib/rt/purerc/__retain + local.set $55 + local.get $55 + call $~lib/array/Array<~lib/array/Array>#toString + local.tee $53 + i32.const 7632 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 977 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 1 + i32.const 2 + i32.const 39 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $49 + local.get $49 + i32.load offset=4 + local.set $15 + local.get $15 block (result i32) i32.const 1 i32.const 2 i32.const 38 i32.const 0 - call $~lib/util/runtime/makeArray - local.set $2 - local.get $2 + call $~lib/rt/common/__allocArray + local.set $17 + local.get $17 i32.load offset=4 - local.set $3 - local.get $3 - block (result i32) - i32.const 1 - i32.const 2 - i32.const 21 - i32.const 8064 - call $~lib/util/runtime/makeArray - local.set $4 - local.get $4 - local.get $2 - call $~lib/collector/dummy/__ref_link - local.get $4 - end + local.set $22 + local.get $22 + i32.const 1 + i32.const 2 + i32.const 21 + i32.const 7712 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.tee $20 + call $~lib/rt/purerc/__retain i32.store - local.get $2 + local.get $17 end - local.set $3 - local.get $3 - local.get $0 - call $~lib/collector/dummy/__ref_link - local.get $3 + call $~lib/rt/purerc/__retain + i32.store + local.get $49 end - i32.store + call $~lib/rt/purerc/__retain + local.set $56 + local.get $56 + call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString + local.tee $15 + i32.const 6664 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 980 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $3 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $38 + call $~lib/rt/purerc/__release + local.get $42 + call $~lib/rt/purerc/__release + local.get $36 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release local.get $0 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $10 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $13 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $14 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $41 + call $~lib/rt/purerc/__release + local.get $40 + call $~lib/rt/purerc/__release + local.get $39 + call $~lib/rt/purerc/__release + local.get $45 + call $~lib/rt/purerc/__release + local.get $48 + call $~lib/rt/purerc/__release + local.get $44 + call $~lib/rt/purerc/__release + local.get $46 + call $~lib/rt/purerc/__release + local.get $47 + call $~lib/rt/purerc/__release + local.get $43 + call $~lib/rt/purerc/__release + local.get $52 + call $~lib/rt/purerc/__release + local.get $11 + call $~lib/rt/purerc/__release + local.get $50 + call $~lib/rt/purerc/__release + local.get $12 + call $~lib/rt/purerc/__release + local.get $16 + call $~lib/rt/purerc/__release + local.get $53 + call $~lib/rt/purerc/__release + local.get $20 + call $~lib/rt/purerc/__release + local.get $15 + call $~lib/rt/purerc/__release end - global.set $std/array/subarrU32 - global.get $std/array/subarrU32 - call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString - i32.const 6840 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 160 - i32.const 943 - i32.const 0 - call $~lib/builtins/abort - unreachable - end + i32.const 0 + global.get $std/array/arr + call $~lib/rt/purerc/__retainRelease + global.set $std/array/arr + local.get $54 + call $~lib/rt/purerc/__release + local.get $55 + call $~lib/rt/purerc/__release + local.get $56 + call $~lib/rt/purerc/__release ) - (func $std/array/main (; 287 ;) (type $FUNCSIG$v) + (func $std/array/main (; 298 ;) (type $FUNCSIG$v) global.get $~lib/started i32.eqz if @@ -17997,15 +21614,284 @@ global.set $~lib/started end ) - (func $~lib/runtime/runtime.instanceof (; 288 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/purerc/__release (; 299 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/purerc/markGray (; 300 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 301 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 302 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 303 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__collect (; 304 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + local.get $0 + local.set $1 + block $break|0 + block + local.get $1 + local.set $2 + global.get $~lib/rt/purerc/CUR + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $2 + i32.load + local.set $4 + local.get $4 + i32.load offset=4 + local.set $5 + local.get $5 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/purerc/markGray + local.get $1 + local.get $4 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else + local.get $5 + i32.const 1879048192 + i32.and + i32.const 0 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $5 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + end + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + global.set $~lib/rt/purerc/CUR + block $break|1 + local.get $0 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $5 + i32.load + call $~lib/rt/purerc/scan + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + block $break|2 + local.get $0 + local.set $5 + loop $repeat|2 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $5 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + local.get $4 + call $~lib/rt/purerc/collectWhite + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/common/__instanceof (; 305 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE + i32.const 16 i32.sub - i32.load + i32.load offset=8 local.set $2 - global.get $~lib/runtime/RTTI_BASE + global.get $~lib/builtins/RTTI_BASE local.set $3 local.get $2 if (result i32) @@ -18037,191 +21923,886 @@ end i32.const 0 ) - (func $~lib/runtime/runtime.flags (; 289 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - global.get $~lib/runtime/RTTI_BASE - local.set $1 - local.get $0 - i32.eqz - if (result i32) - i32.const 1 - else - local.get $0 - local.get $1 - i32.load - i32.gt_u - end - if (result i32) - unreachable - else - local.get $1 - local.get $0 - i32.const 8 - i32.mul - i32.add - i32.load - end + (func $start (; 306 ;) (type $FUNCSIG$v) + call $start:std/array ) - (func $~lib/runtime/runtime.newObject (; 290 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - call $~lib/util/runtime/allocate - local.get $1 - call $~lib/util/runtime/register + (func $~lib/array/Array#__visit_impl (; 307 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop ) - (func $~lib/runtime/runtime.newString (; 291 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#__visit_impl (; 308 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 309 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 310 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 311 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/rt/purerc/__visit (; 312 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end local.get $0 - i32.const 1 - i32.shl i32.const 16 - call $~lib/runtime/runtime.newObject + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 320 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 320 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 320 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end ) - (func $~lib/runtime/runtime.newArrayBuffer (; 292 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 15 - call $~lib/runtime/runtime.newObject - ) - (func $~lib/runtime/runtime.newArray (; 293 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 313 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) local.get $0 - call $~lib/runtime/runtime.flags + i32.load offset=4 local.set $2 local.get $2 - i32.const 16 - i32.div_u - i32.const 31 - i32.and - local.set $3 - local.get $1 - i32.eqz - if - i32.const 0 - local.tee $4 - call $~lib/runtime/runtime.newArrayBuffer - local.set $1 - else - local.get $1 - call $~lib/arraybuffer/ArrayBuffer#get:byteLength - local.set $4 - end local.get $0 - i32.const 16 - call $~lib/runtime/runtime.newObject - local.set $5 - local.get $5 - local.tee $6 - local.get $1 - local.tee $7 - local.get $6 - i32.load - local.tee $8 - i32.ne - if (result i32) - local.get $8 - if - local.get $8 - local.get $6 - call $~lib/collector/dummy/__ref_unlink - end - local.get $7 - local.get $6 - call $~lib/collector/dummy/__ref_link - local.get $7 - else - local.get $7 - end - i32.store - local.get $5 - local.get $1 - i32.store offset=4 - local.get $5 - local.get $4 - i32.store offset=8 - local.get $5 - local.get $4 - local.get $3 - i32.shr_u - i32.store offset=12 - local.get $2 - i32.const 1024 - i32.and - if - local.get $1 - local.set $6 - local.get $6 - local.get $4 - i32.add - local.set $8 - block $break|0 - loop $continue|0 - local.get $6 - local.get $8 - i32.lt_u + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 if - block - local.get $6 - i32.load - local.set $7 - local.get $7 - if - local.get $7 - local.get $5 - call $~lib/collector/dummy/__ref_link - end - local.get $6 - i32.const 4 - i32.add - local.set $6 - end - br $continue|0 + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 end end end - local.get $5 ) - (func $~lib/runtime/Root#constructor (; 294 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array>#__visit_impl (; 314 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) local.get $0 - i32.eqz - if - i32.const 0 - call $~lib/util/runtime/allocate - i32.const 40 - call $~lib/util/runtime/register - local.set $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end end - local.get $0 ) - (func $~lib/runtime/runtime.retain (; 295 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/array/Array<~lib/string/String | null>#__visit_impl (; 315 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) local.get $0 - global.get $~lib/runtime/ROOT - call $~lib/collector/dummy/__ref_link - ) - (func $~lib/runtime/runtime.release (; 296 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.load offset=4 + local.set $2 + local.get $2 local.get $0 - global.get $~lib/runtime/ROOT - call $~lib/collector/dummy/__ref_unlink + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end ) - (func $~lib/collector/dummy/__ref_collect (; 297 ;) (type $FUNCSIG$v) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 316 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/array/Array#__visit_impl (; 317 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/runtime/runtime.collect (; 298 ;) (type $FUNCSIG$v) - call $~lib/collector/dummy/__ref_collect + (func $~lib/array/Array#__visit_impl (; 318 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop ) - (func $~lib/runtime/runtime#constructor (; 299 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#__visit_impl (; 319 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 320 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/array/Array#__visit_impl (; 321 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 322 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 323 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 324 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 325 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#__visit_impl (; 326 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/builtins/__visit_members (; 327 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $block$16$break + block + end + block $switch$1$leave + block $switch$1$case$41 + block $switch$1$case$40 + block $switch$1$case$39 + block $switch$1$case$38 + block $switch$1$case$37 + block $switch$1$case$36 + block $switch$1$case$35 + block $switch$1$case$33 + block $switch$1$case$32 + block $switch$1$case$31 + block $switch$1$case$30 + block $switch$1$case$29 + block $switch$1$case$28 + block $switch$1$case$26 + block $switch$1$case$25 + block $switch$1$case$24 + block $switch$1$case$23 + block $switch$1$case$22 + block $switch$1$case$19 + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$19 $switch$1$case$3 $switch$1$case$16 $switch$1$case$22 $switch$1$case$23 $switch$1$case$24 $switch$1$case$25 $switch$1$case$26 $switch$1$case$3 $switch$1$case$28 $switch$1$case$29 $switch$1$case$30 $switch$1$case$31 $switch$1$case$32 $switch$1$case$33 $switch$1$case$3 $switch$1$case$35 $switch$1$case$36 $switch$1$case$37 $switch$1$case$38 $switch$1$case$39 $switch$1$case$40 $switch$1$case$41 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + br $block$16$break + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String | null>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + end + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end unreachable ) - (func $start (; 300 ;) (type $FUNCSIG$v) - call $start:std/array - i32.const 0 - call $~lib/runtime/Root#constructor - global.set $~lib/runtime/ROOT - ) - (func $null (; 301 ;) (type $FUNCSIG$v) + (func $null (; 328 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/map.json b/tests/compiler/std/map.json index b1da366f..9f7878d4 100644 --- a/tests/compiler/std/map.json +++ b/tests/compiler/std/map.json @@ -1,5 +1,6 @@ { "asc_flags": [ - "--runtime none" + "--runtime half", + "--use ASC_RTRACE=1" ] } \ No newline at end of file diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 66a50a9c..e372c05a 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -1,12 +1,12 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$iij (func (param i32 i64) (result i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$iiji (func (param i32 i64 i32) (result i32))) @@ -17,412 +17,1688 @@ (type $FUNCSIG$iid (func (param i32 f64) (result i32))) (type $FUNCSIG$iidi (func (param i32 f64 i32) (result i32))) (type $FUNCSIG$vidi (func (param i32 f64 i32))) - (type $FUNCSIG$i (func (result i32))) - (type $FUNCSIG$vij (func (param i32 i64))) - (type $FUNCSIG$vif (func (param i32 f32))) - (type $FUNCSIG$vid (func (param i32 f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00(") - (data (i32.const 24) "~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s") - (data (i32.const 64) "\10\00\00\00&") - (data (i32.const 80) "~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 120) "\10\00\00\00\14") - (data (i32.const 136) "s\00t\00d\00/\00m\00a\00p\00.\00t\00s") - (data (i32.const 160) "\1c\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00L\08\00\00\00\00\00\00L\08\00\00\00\00\00\00L\10\00\00\00\00\00\00L\10\00\00\00\00\00\00L \00\00\00\00\00\00L \00\00\00\00\00\00L@\00\00\00\00\00\00L@\00\00\00\00\00\00L \00\00\00\00\00\00L@\00\00\00\00\00\00I\00\00\00\0e\00\00\00\08") - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/runtime/ROOT (mut i32) (i32.const 0)) + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\10\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 56) "&\00\00\00\01\00\00\00\10\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 160) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\10\00\00\00\14\00\00\00s\00t\00d\00/\00m\00a\00p\00.\00t\00s\00") + (data (i32.const 256) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 312) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 368) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 424) "\1a\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00L\08\00\00\00\00\00\00L\08\00\00\00\00\00\00L\10\00\00\00\00\00\00L\10\00\00\00\00\00\00L \00\00\00\00\00\00L \00\00\00\00\00\00L@\00\00\00\00\00\00L@\00\00\00\00\00\00L \00\00\00\00\00\00L@\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 424)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 640)) (export "memory" (memory $0)) - (export "$.instanceof" (func $~lib/runtime/runtime.instanceof)) - (export "$.flags" (func $~lib/runtime/runtime.flags)) - (export "$.newObject" (func $~lib/runtime/runtime.newObject)) - (export "$.newString" (func $~lib/runtime/runtime.newString)) - (export "$.newArrayBuffer" (func $~lib/runtime/runtime.newArrayBuffer)) - (export "$.newArray" (func $~lib/runtime/runtime.newArray)) - (export "$.retain" (func $~lib/runtime/runtime.retain)) - (export "$.release" (func $~lib/runtime/runtime.retain)) - (export "$.collect" (func $~lib/runtime/runtime.collect)) (start $start) - (func $~lib/allocator/arena/__mem_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 - local.get $0 - i32.const 1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 - i32.and - local.tee $0 - current_memory - local.tee $2 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.tee $3 - local.get $2 - local.get $3 - i32.gt_s - select - grow_memory - i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $0 - global.set $~lib/allocator/arena/offset + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) local.get $1 - ) - (func $~lib/util/runtime/allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 15 - i32.add - i32.clz - i32.sub - i32.shl - call $~lib/allocator/arena/__mem_allocate - local.tee $1 - i32.const -1520547049 - i32.store - local.get $1 - local.get $0 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.store offset=8 - local.get $1 - i32.const 0 - i32.store offset=12 - local.get $1 - i32.const 16 - i32.add - ) - (func $~lib/util/runtime/register (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $0 - i32.const 392 - i32.le_u - if - i32.const 0 - i32.const 24 - i32.const 129 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.const 16 - i32.sub - local.tee $2 i32.load - i32.const -1520547049 - i32.ne + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz if i32.const 0 - i32.const 24 - i32.const 131 - i32.const 4 + i32.const 128 + i32.const 275 + i32.const 13 call $~lib/builtins/abort unreachable end local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end local.get $1 - i32.store - local.get $0 - ) - (func $~lib/memory/memory.fill (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - block $~lib/util/memory/memset|inlined.0 - local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 i32.eqz - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 1 - i32.add - i32.const 0 - i32.store8 - local.get $0 - i32.const 2 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $1 - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.tee $1 - i32.sub - local.set $2 - local.get $0 - local.get $1 - i32.add - local.tee $0 - i32.const 0 - i32.store - local.get $2 - i32.const -4 - i32.and - local.tee $1 - local.get $0 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 4 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 8 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 12 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 16 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 20 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 24 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - local.get $0 - i32.add - local.set $0 - local.get $1 - local.get $2 - i32.sub - local.set $1 - loop $continue|0 - local.get $1 - i32.const 32 - i32.ge_u + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz if local.get $0 - i64.const 0 - i64.store local.get $0 - i32.const 8 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 16 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 24 - i32.add - i64.const 0 - i64.store - local.get $1 - i32.const 32 - i32.sub - local.set $1 - local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store end end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 1073741808 - i32.gt_u + (func $~lib/rt/tlsf/insertBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz if i32.const 0 - i32.const 80 - i32.const 54 - i32.const 43 + i32.const 128 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 6 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 7 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 446 + i32.const 29 call $~lib/builtins/abort unreachable end local.get $0 - call $~lib/util/runtime/allocate + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 local.get $0 - call $~lib/memory/memory.fill + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $continue|0 + end + end + end + end + ) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 1073741808 + i32.gt_u + if + i32.const 24 + i32.const 72 + i32.const 56 + i32.const 42 + call $~lib/builtins/abort + unreachable + end local.get $1 i32.const 15 - call $~lib/util/runtime/register - ) - (func $~lib/map/Map#clear (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $1 - local.get $0 - i32.load - i32.ne - drop - local.get $0 + call $~lib/rt/tlsf/__alloc + local.set $2 + local.get $2 + i32.const 0 local.get $1 + call $~lib/memory/memory.fill + local.get $2 + call $~lib/rt/purerc/__retain + ) + (func $~lib/map/Map#clear (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 3 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 - i32.const 48 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.get $0 local.tee $1 - local.get $0 - i32.load offset=8 - i32.ne - drop - local.get $0 - local.get $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 i32.const 4 @@ -434,94 +1710,118 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 7 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 17 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 + (func $~lib/map/Map#constructor (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/hash8 (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const -2128831035 + local.get $0 + i32.xor + i32.const 16777619 + i32.mul + ) + (func $~lib/map/Map#find (; 19 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $0 i32.load + local.get $2 local.get $0 i32.load offset=4 - local.get $2 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add i32.load - local.set $0 - loop $continue|0 - local.get $0 - if - local.get $0 - i32.load offset=8 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $0 - i32.load8_u - local.get $1 - i32.const 255 - i32.and - i32.eq - end + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 if - local.get $0 - return + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load8_s + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 end - local.get $0 - i32.load offset=8 - i32.const -2 - i32.and - local.set $0 - br $continue|0 end end i32.const 0 ) - (func $~lib/map/Map#has (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 21 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -529,130 +1829,167 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $6 - i32.const 12 + local.set $4 + i32.const 0 + local.get $4 + block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) + i32.const 12 + end i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 12 + block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) + i32.const 12 + end i32.mul i32.add local.set $7 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $7 - i32.ne - if - local.get $2 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - i32.load8_s - i32.store8 - local.get $3 - local.get $2 - i32.load offset=4 - i32.store offset=4 - local.get $3 - local.get $2 - i32.load8_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 i32.and - i32.const 2 - i32.shl - local.get $5 + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i32.load8_s + i32.store8 + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i32.load8_s + local.set $11 + local.get $11 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) + i32.const 12 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end i32.add - local.tee $8 - i32.load - i32.store offset=8 - local.get $8 - local.get $3 - i32.store - local.get $3 - i32.const 12 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 12 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $5 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $6 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 + (local $6 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.1 + end local.set $4 local.get $0 local.get $1 - local.get $3 + local.get $4 call $~lib/map/Map#find - local.tee $3 + local.set $5 + local.get $5 if - local.get $3 + local.get $5 local.get $2 i32.store offset=4 else @@ -687,23 +2024,29 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $3 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $5 - i32.const 1 - i32.add - i32.store offset=16 - local.get $5 - i32.const 12 - i32.mul local.get $3 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $6 + i32.const 1 + i32.add + i32.store offset=16 + local.get $6 + end + block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) + i32.const 12 + end + i32.mul i32.add - local.tee $3 + local.set $5 + local.get $5 local.get $1 i32.store8 - local.get $3 + local.get $5 local.get $2 i32.store offset=4 local.get $0 @@ -712,66 +2055,85 @@ i32.const 1 i32.add i32.store offset=20 - local.get $3 local.get $0 i32.load + local.get $4 local.get $0 i32.load offset=4 - local.get $4 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $6 + local.get $5 + local.get $6 i32.load i32.store offset=8 - local.get $0 - local.get $3 + local.get $6 + local.get $5 i32.store + local.get $3 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) local.get $0 local.get $1 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.3 + end call $~lib/map/Map#find - local.tee $0 + local.set $3 + local.get $3 if (result i32) - local.get $0 + local.get $3 i32.load offset=4 else unreachable end ) - (func $~lib/map/Map#delete (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#get:size (; 24 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/map/Map#delete (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 local.get $1 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + block $~lib/util/hash/HASH|inlined.4 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.4 + end call $~lib/map/Map#find - local.tee $1 + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $1 - local.get $1 + local.get $3 + local.get $3 i32.load offset=8 i32.const 1 i32.or @@ -786,15 +2148,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $2 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $2 local.get $0 i32.load offset=20 - local.tee $1 - i32.const 4 - local.get $1 + local.tee $5 + local.get $2 + local.get $5 i32.gt_u select i32.ge_u @@ -813,371 +2177,420 @@ end if local.get $0 - local.get $2 + local.get $4 call $~lib/map/Map#rehash end + i32.const 1 ) - (func $std/map/testNumeric (; 14 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 26 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + i32.const 0 call $~lib/map/Map#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_s - if + local.set $0 + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 local.get $1 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + i32.const 10 local.get $1 - local.get $0 - local.get $0 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const 10 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 10 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 10 + local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const 10 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 11 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|1 - local.get $0 - i32.const 100 - i32.lt_s - if + block $break|1 + i32.const 0 + local.set $1 + loop $repeat|1 local.get $1 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 17 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 10 + local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const 10 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 18 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + i32.const 20 local.get $1 - local.get $0 - local.get $0 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const 20 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 20 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 20 + local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const 20 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 21 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|1 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i32.const 50 - i32.lt_s - if + block $break|2 + i32.const 0 + local.set $1 + loop $repeat|2 local.get $1 + i32.const 50 + i32.lt_s + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 27 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 20 + local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const 20 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 28 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 30 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|2 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i32.const 50 - i32.lt_s - if + block $break|3 + i32.const 0 + local.set $1 + loop $repeat|3 local.get $1 + i32.const 50 + i32.lt_s + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 36 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + i32.const 10 local.get $1 - local.get $0 - local.get $0 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const 10 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 38 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 40 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|3 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 call $~lib/map/Map#clear - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size + i32.const 0 + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#constructor (; 15 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 18 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 + (func $~lib/map/Map#clear (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 - i32.const 0 + i32.const 4 i32.store offset=12 local.get $0 i32.const 0 @@ -1185,25 +2598,108 @@ local.get $0 i32.const 0 i32.store offset=20 - local.get $0 - call $~lib/map/Map#clear + ) + (func $~lib/map/Map#constructor (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 18 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#has (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#find (; 29 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 + if + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load8_u + local.get $1 + i32.const 255 + i32.and + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 + end + end + end + i32.const 0 + ) + (func $~lib/map/Map#has (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - call $~lib/map/Map#find + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 255 + i32.and + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.0 + end + call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1211,128 +2707,165 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $6 - i32.const 12 + local.set $4 + i32.const 0 + local.get $4 + block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) + i32.const 12 + end i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 12 + block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) + i32.const 12 + end i32.mul i32.add local.set $7 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $7 - i32.ne - if - local.get $2 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - i32.load8_u - i32.store8 - local.get $3 - local.get $2 - i32.load offset=4 - i32.store offset=4 - local.get $3 - local.get $2 - i32.load8_u - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 i32.and - i32.const 2 - i32.shl - local.get $5 + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i32.load8_u + i32.store8 + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i32.load8_u + local.set $11 + local.get $11 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) + i32.const 12 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end i32.add - local.tee $8 - i32.load - i32.store offset=8 - local.get $8 - local.get $3 - i32.store - local.get $3 - i32.const 12 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 12 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $5 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $6 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 32 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - local.get $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 + (local $6 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 255 + i32.and + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.1 + end local.set $4 local.get $0 local.get $1 - local.get $3 - call $~lib/map/Map#find - local.tee $3 + local.get $4 + call $~lib/map/Map#find + local.set $5 + local.get $5 if - local.get $3 + local.get $5 local.get $2 i32.store offset=4 else @@ -1367,23 +2900,29 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $3 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $5 - i32.const 1 - i32.add - i32.store offset=16 - local.get $5 - i32.const 12 - i32.mul local.get $3 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $6 + i32.const 1 + i32.add + i32.store offset=16 + local.get $6 + end + block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) + i32.const 12 + end + i32.mul i32.add - local.tee $3 + local.set $5 + local.get $5 local.get $1 i32.store8 - local.get $3 + local.get $5 local.get $2 i32.store offset=4 local.get $0 @@ -1392,62 +2931,81 @@ i32.const 1 i32.add i32.store offset=20 - local.get $3 local.get $0 i32.load + local.get $4 local.get $0 i32.load offset=4 - local.get $4 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $6 + local.get $5 + local.get $6 i32.load i32.store offset=8 - local.get $0 - local.get $3 + local.get $6 + local.get $5 i32.store + local.get $3 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) local.get $0 local.get $1 - local.get $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - call $~lib/map/Map#find - local.tee $0 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 255 + i32.and + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.3 + end + call $~lib/map/Map#find + local.set $3 + local.get $3 if (result i32) - local.get $0 + local.get $3 i32.load offset=4 else unreachable end ) - (func $~lib/map/Map#delete (; 20 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#get:size (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/map/Map#delete (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 local.get $1 - local.get $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - call $~lib/map/Map#find - local.tee $1 + block $~lib/util/hash/HASH|inlined.4 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 255 + i32.and + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.4 + end + call $~lib/map/Map#find + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $1 - local.get $1 + local.get $3 + local.get $3 i32.load offset=8 i32.const 1 i32.or @@ -1462,15 +3020,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $2 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $2 local.get $0 i32.load offset=20 - local.tee $1 - i32.const 4 - local.get $1 + local.tee $5 + local.get $2 + local.get $5 i32.gt_u select i32.ge_u @@ -1489,357 +3049,406 @@ end if local.get $0 - local.get $2 + local.get $4 call $~lib/map/Map#rehash end + i32.const 1 ) - (func $std/map/testNumeric (; 21 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 36 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + i32.const 0 call $~lib/map/Map#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_u - if + local.set $0 + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + i32.const 10 local.get $1 - local.get $0 - local.get $0 i32.const 255 i32.and - i32.const 10 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 10 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 10 + local.get $1 i32.const 255 i32.and - i32.const 10 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 11 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|1 - local.get $0 - i32.const 100 - i32.lt_u - if + block $break|1 + i32.const 0 + local.set $1 + loop $repeat|1 local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 17 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 10 + local.get $1 i32.const 255 i32.and - i32.const 10 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 18 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + i32.const 20 local.get $1 - local.get $0 - local.get $0 i32.const 255 i32.and - i32.const 20 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 20 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 20 + local.get $1 i32.const 255 i32.and - i32.const 20 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 21 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|1 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i32.const 50 - i32.lt_u - if + block $break|2 + i32.const 0 + local.set $1 + loop $repeat|2 local.get $1 + i32.const 50 + i32.lt_u + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 27 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 20 + local.get $1 i32.const 255 i32.and - i32.const 20 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 28 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 30 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|2 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i32.const 50 - i32.lt_u - if + block $break|3 + i32.const 0 + local.set $1 + loop $repeat|3 local.get $1 + i32.const 50 + i32.lt_u + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 36 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + i32.const 10 local.get $1 - local.get $0 - local.get $0 i32.const 255 i32.and - i32.const 10 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 38 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 40 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|3 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/map/Map#clear - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#clear + local.get $0 + call $~lib/map/Map#get:size + i32.const 0 + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#constructor (; 22 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 19 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 + (func $~lib/map/Map#clear (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 - i32.const 0 + i32.const 4 i32.store offset=12 local.get $0 i32.const 0 @@ -1847,79 +3456,134 @@ local.get $0 i32.const 0 i32.store offset=20 - local.get $0 - call $~lib/map/Map#clear - local.get $0 ) - (func $~lib/map/Map#find (; 23 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.load - local.get $0 - i32.load offset=4 - local.get $2 - i32.and - i32.const 2 - i32.shl - i32.add - i32.load - local.set $0 - loop $continue|0 + (func $~lib/map/Map#constructor (; 38 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) local.get $0 + i32.eqz if - local.get $0 - i32.load offset=8 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $0 - i32.load16_u - local.get $1 - i32.const 65535 - i32.and - i32.eq - end - if - local.get $0 - return - end - local.get $0 - i32.load offset=8 - i32.const -2 - i32.and + i32.const 24 + i32.const 19 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 - br $continue|0 end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 end - i32.const 0 - ) - (func $~lib/map/Map#has (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + call $~lib/map/Map#clear local.get $0 + ) + (func $~lib/util/hash/hash16 (; 39 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + i32.const -2128831035 + local.set $1 local.get $1 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - local.tee $0 + local.get $0 i32.const 255 i32.and - i32.const -2128831035 i32.xor i32.const 16777619 i32.mul + local.set $1 + local.get $1 local.get $0 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul + local.set $1 + local.get $1 + ) + (func $~lib/map/Map#find (; 40 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 + if + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load16_s + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 + end + end + end + i32.const 0 + ) + (func $~lib/map/Map#has (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 42 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1927,148 +3591,167 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $7 - i32.const 12 + local.set $4 + i32.const 0 + local.get $4 + block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) + i32.const 12 + end i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 12 + block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) + i32.const 12 + end i32.mul i32.add + local.set $7 + local.get $5 local.set $8 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $8 - i32.ne - if - local.get $2 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - i32.load16_s - i32.store16 - local.get $3 - local.get $2 - i32.load offset=4 - i32.store offset=4 - local.get $3 - local.get $2 - i32.load16_s - local.tee $5 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $5 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.and - i32.const 2 - i32.shl local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i32.load16_s + i32.store16 + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i32.load16_s + local.set $11 + local.get $11 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) + i32.const 12 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end i32.add - local.tee $5 - i32.load - i32.store offset=8 - local.get $5 - local.get $3 - i32.store - local.get $3 - i32.const 12 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 12 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $6 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $7 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 26 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 43 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - local.tee $3 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $3 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 + (local $6 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.1 + end local.set $4 local.get $0 local.get $1 - local.get $3 + local.get $4 call $~lib/map/Map#find - local.tee $3 + local.set $5 + local.get $5 if - local.get $3 + local.get $5 local.get $2 i32.store offset=4 else @@ -2103,23 +3786,29 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $3 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $5 - i32.const 1 - i32.add - i32.store offset=16 - local.get $5 - i32.const 12 - i32.mul local.get $3 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $6 + i32.const 1 + i32.add + i32.store offset=16 + local.get $6 + end + block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) + i32.const 12 + end + i32.mul i32.add - local.tee $3 + local.set $5 + local.get $5 local.get $1 i32.store16 - local.get $3 + local.get $5 local.get $2 i32.store offset=4 local.get $0 @@ -2128,84 +3817,85 @@ i32.const 1 i32.add i32.store offset=20 - local.get $3 local.get $0 i32.load + local.get $4 local.get $0 i32.load offset=4 - local.get $4 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $6 + local.get $5 + local.get $6 i32.load i32.store offset=8 - local.get $0 - local.get $3 + local.get $6 + local.get $5 i32.store + local.get $3 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) local.get $0 local.get $1 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.3 + end call $~lib/map/Map#find - local.tee $0 + local.set $3 + local.get $3 if (result i32) - local.get $0 + local.get $3 i32.load offset=4 else unreachable end ) - (func $~lib/map/Map#delete (; 28 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#get:size (; 45 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/map/Map#delete (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 local.get $1 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + block $~lib/util/hash/HASH|inlined.4 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.4 + end call $~lib/map/Map#find - local.tee $1 + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $1 - local.get $1 + local.get $3 + local.get $3 i32.load offset=8 i32.const 1 i32.or @@ -2220,15 +3910,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $2 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $2 local.get $0 i32.load offset=20 - local.tee $1 - i32.const 4 - local.get $1 + local.tee $5 + local.get $2 + local.get $5 i32.gt_u select i32.ge_u @@ -2247,371 +3939,420 @@ end if local.get $0 - local.get $2 + local.get $4 call $~lib/map/Map#rehash end + i32.const 1 ) - (func $std/map/testNumeric (; 29 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 47 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + i32.const 0 call $~lib/map/Map#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_s - if + local.set $0 + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 local.get $1 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + i32.const 10 local.get $1 - local.get $0 - local.get $0 i32.const 16 i32.shl i32.const 16 i32.shr_s - i32.const 10 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 10 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 10 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - i32.const 10 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 11 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|1 - local.get $0 - i32.const 100 - i32.lt_s - if + block $break|1 + i32.const 0 + local.set $1 + loop $repeat|1 local.get $1 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 17 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 10 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - i32.const 10 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 18 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + i32.const 20 local.get $1 - local.get $0 - local.get $0 i32.const 16 i32.shl i32.const 16 i32.shr_s - i32.const 20 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 20 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 20 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - i32.const 20 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 21 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|1 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i32.const 50 - i32.lt_s - if + block $break|2 + i32.const 0 + local.set $1 + loop $repeat|2 local.get $1 + i32.const 50 + i32.lt_s + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 27 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 20 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - i32.const 20 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 28 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 30 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|2 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i32.const 50 - i32.lt_s - if + block $break|3 + i32.const 0 + local.set $1 + loop $repeat|3 local.get $1 + i32.const 50 + i32.lt_s + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 36 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + i32.const 10 local.get $1 - local.get $0 - local.get $0 i32.const 16 i32.shl i32.const 16 i32.shr_s - i32.const 10 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 38 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 40 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|3 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/map/Map#clear - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#clear + local.get $0 + call $~lib/map/Map#get:size + i32.const 0 + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#constructor (; 30 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 20 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 + (func $~lib/map/Map#clear (; 48 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 - i32.const 0 + i32.const 4 i32.store offset=12 local.get $0 i32.const 0 @@ -2619,34 +4360,108 @@ local.get $0 i32.const 0 i32.store offset=20 - local.get $0 - call $~lib/map/Map#clear + ) + (func $~lib/map/Map#constructor (; 49 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 20 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#has (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#find (; 50 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 + if + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load16_u + local.get $1 + i32.const 65535 + i32.and + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 + end + end + end + i32.const 0 + ) + (func $~lib/map/Map#has (; 51 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - i32.const 65535 - i32.and - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - call $~lib/map/Map#find + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 65535 + i32.and + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.0 + end + call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 52 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2654,146 +4469,165 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $7 - i32.const 12 + local.set $4 + i32.const 0 + local.get $4 + block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) + i32.const 12 + end i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 12 + block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) + i32.const 12 + end i32.mul i32.add + local.set $7 + local.get $5 local.set $8 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $8 - i32.ne - if - local.get $2 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - i32.load16_u - i32.store16 - local.get $3 - local.get $2 - i32.load offset=4 - i32.store offset=4 - local.get $3 - local.get $2 - i32.load16_u - local.tee $5 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $5 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.and - i32.const 2 - i32.shl local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i32.load16_u + i32.store16 + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i32.load16_u + local.set $11 + local.get $11 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) + i32.const 12 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end i32.add - local.tee $5 - i32.load - i32.store offset=8 - local.get $5 - local.get $3 - i32.store - local.get $3 - i32.const 12 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 12 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $6 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $7 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 33 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 53 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - local.get $1 - i32.const 65535 - i32.and - local.tee $3 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $3 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 + (local $6 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 65535 + i32.and + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.1 + end local.set $4 local.get $0 local.get $1 - local.get $3 - call $~lib/map/Map#find - local.tee $3 + local.get $4 + call $~lib/map/Map#find + local.set $5 + local.get $5 if - local.get $3 + local.get $5 local.get $2 i32.store offset=4 else @@ -2828,23 +4662,29 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $3 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $5 - i32.const 1 - i32.add - i32.store offset=16 - local.get $5 - i32.const 12 - i32.mul local.get $3 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $6 + i32.const 1 + i32.add + i32.store offset=16 + local.get $6 + end + block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) + i32.const 12 + end + i32.mul i32.add - local.tee $3 + local.set $5 + local.get $5 local.get $1 i32.store16 - local.get $3 + local.get $5 local.get $2 i32.store offset=4 local.get $0 @@ -2853,80 +4693,81 @@ i32.const 1 i32.add i32.store offset=20 - local.get $3 local.get $0 i32.load + local.get $4 local.get $0 i32.load offset=4 - local.get $4 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $6 + local.get $5 + local.get $6 i32.load i32.store offset=8 - local.get $0 - local.get $3 + local.get $6 + local.get $5 i32.store + local.get $3 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 54 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) local.get $0 local.get $1 - local.get $1 - i32.const 65535 - i32.and - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - call $~lib/map/Map#find - local.tee $0 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 65535 + i32.and + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.3 + end + call $~lib/map/Map#find + local.set $3 + local.get $3 if (result i32) - local.get $0 + local.get $3 i32.load offset=4 else unreachable end ) - (func $~lib/map/Map#delete (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#get:size (; 55 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/map/Map#delete (; 56 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 local.get $1 - local.get $1 - i32.const 65535 - i32.and - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - call $~lib/map/Map#find - local.tee $1 + block $~lib/util/hash/HASH|inlined.4 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 65535 + i32.and + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.4 + end + call $~lib/map/Map#find + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $1 - local.get $1 + local.get $3 + local.get $3 i32.load offset=8 i32.const 1 i32.or @@ -2941,15 +4782,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $2 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $2 local.get $0 i32.load offset=20 - local.tee $1 - i32.const 4 - local.get $1 + local.tee $5 + local.get $2 + local.get $5 i32.gt_u select i32.ge_u @@ -2968,357 +4811,406 @@ end if local.get $0 - local.get $2 + local.get $4 call $~lib/map/Map#rehash end + i32.const 1 ) - (func $std/map/testNumeric (; 36 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 57 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + i32.const 0 call $~lib/map/Map#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_u - if + local.set $0 + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + i32.const 10 local.get $1 - local.get $0 - local.get $0 i32.const 65535 i32.and - i32.const 10 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 10 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 10 + local.get $1 i32.const 65535 i32.and - i32.const 10 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 11 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|1 - local.get $0 - i32.const 100 - i32.lt_u - if + block $break|1 + i32.const 0 + local.set $1 + loop $repeat|1 local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 17 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 10 + local.get $1 i32.const 65535 i32.and - i32.const 10 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 18 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + i32.const 20 local.get $1 - local.get $0 - local.get $0 i32.const 65535 i32.and - i32.const 20 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 20 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 20 + local.get $1 i32.const 65535 i32.and - i32.const 20 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 21 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|1 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i32.const 50 - i32.lt_u - if + block $break|2 + i32.const 0 + local.set $1 + loop $repeat|2 local.get $1 + i32.const 50 + i32.lt_u + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 27 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 + i32.const 20 + local.get $1 i32.const 65535 i32.and - i32.const 20 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 28 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 30 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|2 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i32.const 50 - i32.lt_u - if + block $break|3 + i32.const 0 + local.set $1 + loop $repeat|3 local.get $1 + i32.const 50 + i32.lt_u + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 36 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + i32.const 10 local.get $1 - local.get $0 - local.get $0 i32.const 65535 i32.and - i32.const 10 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 38 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 40 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|3 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/map/Map#clear - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#clear + local.get $0 + call $~lib/map/Map#get:size + i32.const 0 + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#constructor (; 37 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 21 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 + (func $~lib/map/Map#clear (; 58 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 - i32.const 0 + i32.const 4 i32.store offset=12 local.get $0 i32.const 0 @@ -3326,18 +5218,54 @@ local.get $0 i32.const 0 i32.store offset=20 - local.get $0 - call $~lib/map/Map#clear + ) + (func $~lib/map/Map#constructor (; 59 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 21 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/map/Map#clear local.get $0 ) - (func $~lib/util/hash/hash32 (; 38 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 60 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + i32.const -2128831035 + local.set $1 + local.get $1 local.get $0 i32.const 255 i32.and - i32.const -2128831035 i32.xor i32.const 16777619 i32.mul + local.set $1 + local.get $1 local.get $0 i32.const 8 i32.shr_u @@ -3346,6 +5274,8 @@ i32.xor i32.const 16777619 i32.mul + local.set $1 + local.get $1 local.get $0 i32.const 16 i32.shr_u @@ -3354,64 +5284,80 @@ i32.xor i32.const 16777619 i32.mul + local.set $1 + local.get $1 local.get $0 i32.const 24 i32.shr_u i32.xor i32.const 16777619 i32.mul + local.set $1 + local.get $1 ) - (func $~lib/map/Map#find (; 39 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $0 i32.load + local.get $2 local.get $0 i32.load offset=4 - local.get $2 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add i32.load - local.set $0 - loop $continue|0 - local.get $0 - if - local.get $0 - i32.load offset=8 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $0 - i32.load - local.get $1 - i32.eq - end + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 if - local.get $0 - return + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load + local.get $1 + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 end - local.get $0 - i32.load offset=8 - i32.const -2 - i32.and - local.set $0 - br $continue|0 end end i32.const 0 ) - (func $~lib/map/Map#has (; 40 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 62 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/hash32 + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 41 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 63 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3419,118 +5365,163 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $6 - i32.const 12 + local.set $4 + i32.const 0 + local.get $4 + block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) + i32.const 12 + end i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 12 + block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) + i32.const 12 + end i32.mul i32.add local.set $7 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $7 - i32.ne - if - local.get $2 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - i32.load - i32.store - local.get $3 - local.get $2 - i32.load offset=4 - i32.store offset=4 - local.get $3 - local.get $2 - i32.load - call $~lib/util/hash/hash32 - local.get $1 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 i32.and - i32.const 2 - i32.shl - local.get $5 + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i32.load + i32.store + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i32.load + local.set $11 + local.get $11 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) + i32.const 12 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end i32.add - local.tee $8 - i32.load - i32.store offset=8 - local.get $8 - local.get $3 - i32.store - local.get $3 - i32.const 12 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 12 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $5 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $6 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 42 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 64 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $3 + local.get $3 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $4 local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/hash32 - local.tee $4 + local.get $4 call $~lib/map/Map#find - local.tee $3 + local.set $5 + local.get $5 if - local.get $3 + local.get $5 local.get $2 i32.store offset=4 else @@ -3565,23 +5556,29 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $3 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $5 - i32.const 1 - i32.add - i32.store offset=16 - local.get $5 - i32.const 12 - i32.mul local.get $3 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $6 + i32.const 1 + i32.add + i32.store offset=16 + local.get $6 + end + block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) + i32.const 12 + end + i32.mul i32.add - local.tee $3 + local.set $5 + local.get $5 local.get $1 i32.store - local.get $3 + local.get $5 local.get $2 i32.store offset=4 local.get $0 @@ -3590,52 +5587,77 @@ i32.const 1 i32.add i32.store offset=20 - local.get $3 local.get $0 i32.load + local.get $4 local.get $0 i32.load offset=4 - local.get $4 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $6 + local.get $5 + local.get $6 i32.load i32.store offset=8 - local.get $0 - local.get $3 + local.get $6 + local.get $5 i32.store + local.get $3 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 65 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/hash32 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 + end call $~lib/map/Map#find - local.tee $0 + local.set $3 + local.get $3 if (result i32) - local.get $0 + local.get $3 i32.load offset=4 else unreachable end ) - (func $~lib/map/Map#delete (; 44 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#get:size (; 66 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/map/Map#delete (; 67 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/hash32 + block $~lib/util/hash/HASH|inlined.4 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.4 + end call $~lib/map/Map#find - local.tee $1 + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $1 - local.get $1 + local.get $3 + local.get $3 i32.load offset=8 i32.const 1 i32.or @@ -3650,15 +5672,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $2 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $2 local.get $0 i32.load offset=20 - local.tee $1 - i32.const 4 - local.get $1 + local.tee $5 + local.get $2 + local.get $5 i32.gt_u select i32.ge_u @@ -3677,694 +5701,389 @@ end if local.get $0 - local.get $2 + local.get $4 call $~lib/map/Map#rehash end + i32.const 1 ) - (func $std/map/testNumeric (; 45 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 68 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + i32.const 0 call $~lib/map/Map#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_s - if + local.set $0 + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 local.get $1 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 - local.get $0 i32.const 10 + local.get $1 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 10 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 i32.const 10 + local.get $1 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 11 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|1 - local.get $0 - i32.const 100 - i32.lt_s - if + block $break|1 + i32.const 0 + local.set $1 + loop $repeat|1 local.get $1 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 17 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 i32.const 10 + local.get $1 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 18 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 - local.get $0 i32.const 20 + local.get $1 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 20 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 i32.const 20 + local.get $1 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 21 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|1 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i32.const 50 - i32.lt_s - if + block $break|2 + i32.const 0 + local.set $1 + loop $repeat|2 local.get $1 + i32.const 50 + i32.lt_s + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 27 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 i32.const 20 + local.get $1 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 28 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 30 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|2 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i32.const 50 - i32.lt_s - if + block $break|3 + i32.const 0 + local.set $1 + loop $repeat|3 local.get $1 + i32.const 50 + i32.lt_s + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 36 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 - local.get $0 i32.const 10 + local.get $1 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 38 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 40 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|3 end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/map/Map#clear - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#clear + local.get $0 + call $~lib/map/Map#get:size + i32.const 0 + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#constructor (; 46 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 22 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 + (func $~lib/map/Map#clear (; 69 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - call $~lib/map/Map#clear - local.get $0 - ) - (func $std/map/testNumeric (; 47 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - call $~lib/map/Map#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_u - if - local.get $1 - local.get $0 - call $~lib/map/Map#has - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - local.get $0 - i32.const 10 - i32.add - call $~lib/map/Map#set - local.get $1 - local.get $0 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/map/Map#get - local.get $0 - i32.const 10 - i32.add - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 11 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 100 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 13 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - local.set $0 - loop $repeat|1 - local.get $0 - i32.const 100 - i32.lt_u - if - local.get $1 - local.get $0 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 17 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/map/Map#get - local.get $0 - i32.const 10 - i32.add - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - local.get $0 - i32.const 20 - i32.add - call $~lib/map/Map#set - local.get $1 - local.get $0 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/map/Map#get - local.get $0 - i32.const 20 - i32.add - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 21 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|1 - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 100 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 23 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i32.const 50 - i32.lt_u - if - local.get $1 - local.get $0 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 27 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/map/Map#get - local.get $0 - i32.const 20 - i32.add - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/map/Map#delete - local.get $1 - local.get $0 - call $~lib/map/Map#has - if - i32.const 0 - i32.const 136 - i32.const 30 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|2 - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 50 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i32.const 50 - i32.lt_u - if - local.get $1 - local.get $0 - call $~lib/map/Map#has - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - local.get $0 - i32.const 10 - i32.add - call $~lib/map/Map#set - local.get $1 - local.get $0 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/map/Map#delete - local.get $1 - local.get $0 - call $~lib/map/Map#has - if - i32.const 0 - i32.const 136 - i32.const 40 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|3 - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 50 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 42 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - local.get $1 - call $~lib/map/Map#clear - local.get $1 - i32.load offset=20 - if - i32.const 0 - i32.const 136 - i32.const 46 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/map/Map#clear (; 48 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor local.tee $1 - local.get $0 - i32.load - i32.ne - drop - local.get $0 - local.get $1 - i32.store - local.get $0 - i32.const 3 - i32.store offset=4 - i32.const 64 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $1 - local.get $0 - i32.load offset=8 - i32.ne - drop - local.get $0 - local.get $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 i32.const 4 @@ -4376,151 +6095,103 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 49 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 23 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - call $~lib/map/Map#clear + (func $~lib/map/Map#constructor (; 70 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 22 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/map/Map#clear local.get $0 ) - (func $~lib/util/hash/hash64 (; 50 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) - (local $1 i32) - local.get $0 - i32.wrap_i64 - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i64.const 32 - i64.shr_u - i32.wrap_i64 - local.tee $1 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - ) - (func $~lib/map/Map#find (; 51 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 71 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $0 i32.load + local.get $2 local.get $0 i32.load offset=4 - local.get $2 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add i32.load - local.set $0 - loop $continue|0 - local.get $0 - if - local.get $0 - i32.load offset=12 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $0 - i64.load - local.get $1 - i64.eq - end + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 if - local.get $0 - return + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load + local.get $1 + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 end - local.get $0 - i32.load offset=12 - i32.const -2 - i32.and - local.set $0 - br $continue|0 end end i32.const 0 ) - (func $~lib/map/Map#has (; 52 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#has (; 72 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/hash64 - call $~lib/map/Map#find + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 + end + call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 53 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 73 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4528,118 +6199,1087 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $6 - i32.const 4 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor local.set $4 + i32.const 0 + local.get $4 + block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) + i32.const 12 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 4 - i32.shl + block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) + i32.const 12 + end + i32.mul i32.add local.set $7 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $7 - i32.ne - if - local.get $2 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - i64.load - i64.store - local.get $3 - local.get $2 + local.get $6 + local.set $9 + local.get $9 i32.load offset=8 - i32.store offset=8 - local.get $3 - local.get $2 - i64.load - call $~lib/util/hash/hash64 - local.get $1 + i32.const 1 i32.and - i32.const 2 - i32.shl - local.get $5 + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i32.load + i32.store + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i32.load + local.set $11 + local.get $11 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) + i32.const 12 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end i32.add - local.tee $8 - i32.load - i32.store offset=12 - local.get $8 - local.get $3 - i32.store - local.get $3 - i32.const 16 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 16 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $5 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $6 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 54 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/map/Map#set (; 74 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $3 + local.get $3 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $4 + local.get $0 + local.get $1 + local.get $4 + call $~lib/map/Map#find + local.set $5 + local.get $5 + if + local.get $5 + local.get $2 + i32.store offset=4 + else + local.get $0 + i32.load offset=16 + local.get $0 + i32.load offset=12 + i32.eq + if + local.get $0 + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + f64.convert_i32_s + f64.const 0.75 + f64.mul + i32.trunc_f64_s + i32.lt_s + if (result i32) + local.get $0 + i32.load offset=4 + else + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shl + i32.const 1 + i32.or + end + call $~lib/map/Map#rehash + end + local.get $0 + i32.load offset=8 + call $~lib/rt/purerc/__retain + local.set $3 + local.get $3 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $6 + i32.const 1 + i32.add + i32.store offset=16 + local.get $6 + end + block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) + i32.const 12 + end + i32.mul + i32.add + local.set $5 + local.get $5 + local.get $1 + i32.store + local.get $5 + local.get $2 + i32.store offset=4 + local.get $0 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.add + i32.store offset=20 + local.get $0 + i32.load + local.get $4 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.load + i32.store offset=8 + local.get $6 + local.get $5 + i32.store + local.get $3 + call $~lib/rt/purerc/__release + end + ) + (func $~lib/map/Map#get (; 75 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 + end + call $~lib/map/Map#find + local.set $3 + local.get $3 + if (result i32) + local.get $3 + i32.load offset=4 + else + unreachable + end + ) + (func $~lib/map/Map#get:size (; 76 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/map/Map#delete (; 77 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/hash64 - local.tee $4 - call $~lib/map/Map#find - local.tee $3 + block $~lib/util/hash/HASH|inlined.4 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.4 + end + call $~lib/map/Map#find + local.set $3 + local.get $3 + i32.eqz if + i32.const 0 + return + end + local.get $3 + local.get $3 + i32.load offset=8 + i32.const 1 + i32.or + i32.store offset=8 + local.get $0 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.sub + i32.store offset=20 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shr_u + local.set $4 + local.get $4 + i32.const 1 + i32.add + i32.const 4 + local.tee $2 + local.get $0 + i32.load offset=20 + local.tee $5 + local.get $2 + local.get $5 + i32.gt_u + select + i32.ge_u + if (result i32) + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + f64.convert_i32_s + f64.const 0.75 + f64.mul + i32.trunc_f64_s + i32.lt_s + else + i32.const 0 + end + if + local.get $0 + local.get $4 + call $~lib/map/Map#rehash + end + i32.const 1 + ) + (func $std/map/testNumeric (; 78 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + call $~lib/map/Map#constructor + local.set $0 + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 + local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 10 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 11 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + unreachable + end + unreachable + end + local.get $0 + call $~lib/map/Map#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 13 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|1 + i32.const 0 + local.set $1 + loop $repeat|1 + local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 17 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 20 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 21 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + unreachable + end + unreachable + end + local.get $0 + call $~lib/map/Map#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 23 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|2 + i32.const 0 + local.set $1 + loop $repeat|2 + local.get $1 + i32.const 50 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 27 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + call $~lib/map/Map#get:size + i32.const 50 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|3 + i32.const 0 + local.set $1 + loop $repeat|3 + local.get $1 + i32.const 50 + i32.lt_u + i32.eqz + br_if $break|3 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|3 + unreachable + end + unreachable + end + local.get $0 + call $~lib/map/Map#get:size + i32.const 50 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 42 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/map/Map#clear + local.get $0 + call $~lib/map/Map#get:size + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 46 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/map/Map#clear (; 79 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end + i32.store + local.get $0 + i32.const 4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor + end + i32.store offset=8 + local.get $0 + i32.const 4 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + ) + (func $~lib/map/Map#constructor (; 80 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 23 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/map/Map#clear + local.get $0 + ) + (func $~lib/util/hash/hash64 (; 81 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.wrap_i64 + local.set $1 + local.get $0 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.set $2 + i32.const -2128831035 + local.set $3 + local.get $3 + local.get $1 + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $1 + i32.const 8 + i32.shr_u + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $1 + i32.const 16 + i32.shr_u + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $1 + i32.const 24 + i32.shr_u + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $2 + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $2 + i32.const 8 + i32.shr_u + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $2 + i32.const 16 + i32.shr_u + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $2 + i32.const 24 + i32.shr_u + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + ) + (func $~lib/map/Map#find (; 82 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 + if + local.get $3 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i64.load + local.get $1 + i64.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=12 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 + end + end + end + i32.const 0 + ) + (func $~lib/map/Map#has (; 83 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (local $2 i64) + local.get $0 + local.get $1 + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.0 + end + call $~lib/map/Map#find + i32.const 0 + i32.ne + ) + (func $~lib/map/Map#rehash (; 84 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i64) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.const 1 + i32.add + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $3 + local.get $2 + f64.convert_i32_s + f64.const 2.6666666666666665 + f64.mul + i32.trunc_f64_s + local.set $4 + i32.const 0 + local.get $4 + block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) + i32.const 16 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 + local.get $0 + i32.load offset=8 + local.set $6 + local.get $6 + local.get $0 + i32.load offset=16 + block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) + i32.const 16 + end + i32.mul + i32.add + local.set $7 + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne + if + local.get $6 + local.set $9 + local.get $9 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i64.load + i64.store + local.get $10 + local.get $9 + i32.load offset=8 + i32.store offset=8 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i64.load + local.set $11 + local.get $11 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=12 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) + i32.const 16 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end + i32.add + local.set $6 + br $continue|0 + end + end + end + local.get $0 + local.tee $9 + local.get $3 + local.get $9 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $0 + local.get $1 + i32.store offset=4 + local.get $0 + local.tee $9 + local.get $5 + local.get $9 + i32.load offset=8 + call $~lib/rt/purerc/__retainRelease + i32.store offset=8 + local.get $0 + local.get $4 + i32.store offset=12 + local.get $0 + local.get $0 + i32.load offset=20 + i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + ) + (func $~lib/map/Map#set (; 85 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (local $3 i64) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $3 local.get $3 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $4 + local.get $0 + local.get $1 + local.get $4 + call $~lib/map/Map#find + local.set $5 + local.get $5 + if + local.get $5 local.get $2 i32.store offset=8 else @@ -4674,23 +7314,29 @@ end local.get $0 i32.load offset=8 - local.set $3 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $5 - i32.const 1 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $6 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $7 + i32.const 1 + i32.add + i32.store offset=16 + local.get $7 + end + block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) + i32.const 16 + end + i32.mul i32.add - i32.store offset=16 + local.set $5 local.get $5 - i32.const 4 - i32.shl - local.get $3 - i32.add - local.tee $3 local.get $1 i64.store - local.get $3 + local.get $5 local.get $2 i32.store offset=8 local.get $0 @@ -4699,53 +7345,78 @@ i32.const 1 i32.add i32.store offset=20 - local.get $3 local.get $0 i32.load + local.get $4 local.get $0 i32.load offset=4 - local.get $4 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $7 + local.get $5 + local.get $7 i32.load i32.store offset=12 - local.get $0 - local.get $3 + local.get $7 + local.get $5 i32.store + local.get $6 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 55 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#get (; 86 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (local $2 i64) + (local $3 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/hash64 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.3 + end call $~lib/map/Map#find - local.tee $0 + local.set $3 + local.get $3 if (result i32) - local.get $0 + local.get $3 i32.load offset=8 else unreachable end ) - (func $~lib/map/Map#delete (; 56 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) - (local $2 i32) + (func $~lib/map/Map#get:size (; 87 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/map/Map#delete (; 88 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (local $2 i64) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/hash64 + block $~lib/util/hash/HASH|inlined.4 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.4 + end call $~lib/map/Map#find - local.tee $2 + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $2 - local.get $2 + local.get $3 + local.get $3 i32.load offset=12 i32.const 1 i32.or @@ -4760,15 +7431,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $3 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $5 local.get $0 i32.load offset=20 - local.tee $2 - i32.const 4 - local.get $2 + local.tee $6 + local.get $5 + local.get $6 i32.gt_u select i32.ge_u @@ -4787,701 +7460,399 @@ end if local.get $0 - local.get $3 + local.get $4 call $~lib/map/Map#rehash end + i32.const 1 ) - (func $std/map/testNumeric (; 57 ;) (type $FUNCSIG$v) - (local $0 i64) - (local $1 i32) + (func $std/map/testNumeric (; 89 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i64) + i32.const 0 call $~lib/map/Map#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i64.const 100 - i64.lt_s - if + local.set $0 + block $break|0 + i64.const 0 + local.set $1 + loop $repeat|0 local.get $1 + i64.const 100 + i64.lt_s + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 - local.get $0 - i32.wrap_i64 i32.const 10 + local.get $1 + i32.wrap_i64 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 10 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 - i32.wrap_i64 i32.const 10 + local.get $1 + i32.wrap_i64 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 11 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|0 end + local.get $1 + i64.const 1 + i64.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort unreachable end - i64.const 0 - local.set $0 - loop $repeat|1 - local.get $0 - i64.const 100 - i64.lt_s - if + block $break|1 + i64.const 0 + local.set $1 + loop $repeat|1 local.get $1 + i64.const 100 + i64.lt_s + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 17 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 - i32.wrap_i64 i32.const 10 + local.get $1 + i32.wrap_i64 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 18 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 - local.get $0 - i32.wrap_i64 i32.const 20 + local.get $1 + i32.wrap_i64 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 20 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 - i32.wrap_i64 i32.const 20 + local.get $1 + i32.wrap_i64 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 21 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|1 end + local.get $1 + i64.const 1 + i64.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort unreachable end - i64.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i64.const 50 - i64.lt_s - if + block $break|2 + i64.const 0 + local.set $1 + loop $repeat|2 local.get $1 + i64.const 50 + i64.lt_s + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 27 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 - i32.wrap_i64 i32.const 20 + local.get $1 + i32.wrap_i64 i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 28 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 30 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|2 end + local.get $1 + i64.const 1 + i64.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort unreachable end - i64.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i64.const 50 - i64.lt_s - if + block $break|3 + i64.const 0 + local.set $1 + loop $repeat|3 local.get $1 + i64.const 50 + i64.lt_s + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 36 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 - local.get $0 - i32.wrap_i64 i32.const 10 + local.get $1 + i32.wrap_i64 i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 38 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 40 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|3 end + local.get $1 + i64.const 1 + i64.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 call $~lib/map/Map#clear - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size + i32.const 0 + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#constructor (; 58 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 24 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - call $~lib/map/Map#clear - local.get $0 - ) - (func $std/map/testNumeric (; 59 ;) (type $FUNCSIG$v) - (local $0 i64) + (func $~lib/map/Map#clear (; 90 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - call $~lib/map/Map#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i64.const 100 - i64.lt_u - if - local.get $1 - local.get $0 - call $~lib/map/Map#has - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - local.get $0 - i32.wrap_i64 - i32.const 10 - i32.add - call $~lib/map/Map#set - local.get $1 - local.get $0 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/map/Map#get - local.get $0 - i32.wrap_i64 - i32.const 10 - i32.add - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 11 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|0 - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 100 - i32.ne - if + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release i32.const 0 - i32.const 136 - i32.const 13 - i32.const 2 - call $~lib/builtins/abort - unreachable + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end - i64.const 0 - local.set $0 - loop $repeat|1 - local.get $0 - i64.const 100 - i64.lt_u - if - local.get $1 - local.get $0 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 17 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/map/Map#get - local.get $0 - i32.wrap_i64 - i32.const 10 - i32.add - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - local.get $0 - i32.wrap_i64 - i32.const 20 - i32.add - call $~lib/map/Map#set - local.get $1 - local.get $0 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/map/Map#get - local.get $0 - i32.wrap_i64 - i32.const 20 - i32.add - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 21 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|1 - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 100 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 23 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - i64.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i64.const 50 - i64.lt_u - if - local.get $1 - local.get $0 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 27 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/map/Map#get - local.get $0 - i32.wrap_i64 - i32.const 20 - i32.add - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/map/Map#delete - local.get $1 - local.get $0 - call $~lib/map/Map#has - if - i32.const 0 - i32.const 136 - i32.const 30 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|2 - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 50 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - i64.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i64.const 50 - i64.lt_u - if - local.get $1 - local.get $0 - call $~lib/map/Map#has - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - local.get $0 - i32.wrap_i64 - i32.const 10 - i32.add - call $~lib/map/Map#set - local.get $1 - local.get $0 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/map/Map#delete - local.get $1 - local.get $0 - call $~lib/map/Map#has - if - i32.const 0 - i32.const 136 - i32.const 40 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|3 - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 50 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 42 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - local.get $1 - call $~lib/map/Map#clear - local.get $1 - i32.load offset=20 - if - i32.const 0 - i32.const 136 - i32.const 46 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/map/Map#constructor (; 60 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 25 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 - i32.const 0 + i32.const 4 i32.store offset=12 local.get $0 i32.const 0 @@ -5489,62 +7860,104 @@ local.get $0 i32.const 0 i32.store offset=20 - local.get $0 - call $~lib/map/Map#clear + ) + (func $~lib/map/Map#constructor (; 91 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 24 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 61 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 92 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (local $3 i32) local.get $0 i32.load + local.get $2 local.get $0 i32.load offset=4 - local.get $2 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add i32.load - local.set $0 - loop $continue|0 - local.get $0 - if - local.get $0 - i32.load offset=8 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $0 - f32.load - local.get $1 - f32.eq - end + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 if - local.get $0 - return + local.get $3 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i64.load + local.get $1 + i64.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=12 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 end - local.get $0 - i32.load offset=8 - i32.const -2 - i32.and - local.set $0 - br $continue|0 end end i32.const 0 ) - (func $~lib/map/Map#has (; 62 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#has (; 93 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (local $2 i64) local.get $0 local.get $1 - local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - call $~lib/map/Map#find + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.0 + end + call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 63 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 94 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5552,120 +7965,1012 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i64) + (local $12 i32) + (local $13 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $6 - i32.const 12 + local.set $4 + i32.const 0 + local.get $4 + block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) + i32.const 16 + end i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 12 + block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) + i32.const 16 + end i32.mul i32.add local.set $7 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $7 - i32.ne - if - local.get $2 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - f32.load - f32.store - local.get $3 - local.get $2 - i32.load offset=4 - i32.store offset=4 - local.get $3 - local.get $2 - f32.load - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - local.get $1 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=12 + i32.const 1 i32.and - i32.const 2 - i32.shl - local.get $5 + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i64.load + i64.store + local.get $10 + local.get $9 + i32.load offset=8 + i32.store offset=8 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i64.load + local.set $11 + local.get $11 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=12 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) + i32.const 16 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end i32.add - local.tee $8 - i32.load - i32.store offset=8 - local.get $8 - local.get $3 - i32.store - local.get $3 - i32.const 12 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 12 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $5 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $6 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 64 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) + (func $~lib/map/Map#set (; 95 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (local $3 i64) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $3 + local.get $3 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $4 + local.get $0 + local.get $1 + local.get $4 + call $~lib/map/Map#find + local.set $5 + local.get $5 + if + local.get $5 + local.get $2 + i32.store offset=8 + else + local.get $0 + i32.load offset=16 + local.get $0 + i32.load offset=12 + i32.eq + if + local.get $0 + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + f64.convert_i32_s + f64.const 0.75 + f64.mul + i32.trunc_f64_s + i32.lt_s + if (result i32) + local.get $0 + i32.load offset=4 + else + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shl + i32.const 1 + i32.or + end + call $~lib/map/Map#rehash + end + local.get $0 + i32.load offset=8 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $6 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $7 + i32.const 1 + i32.add + i32.store offset=16 + local.get $7 + end + block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) + i32.const 16 + end + i32.mul + i32.add + local.set $5 + local.get $5 + local.get $1 + i64.store + local.get $5 + local.get $2 + i32.store offset=8 + local.get $0 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.add + i32.store offset=20 + local.get $0 + i32.load + local.get $4 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + local.set $7 + local.get $5 + local.get $7 + i32.load + i32.store offset=12 + local.get $7 + local.get $5 + i32.store + local.get $6 + call $~lib/rt/purerc/__release + end + ) + (func $~lib/map/Map#get (; 96 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (local $2 i64) + (local $3 i32) + local.get $0 + local.get $1 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.3 + end + call $~lib/map/Map#find + local.set $3 + local.get $3 + if (result i32) + local.get $3 + i32.load offset=8 + else + unreachable + end + ) + (func $~lib/map/Map#get:size (; 97 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/map/Map#delete (; 98 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (local $2 i64) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) local.get $0 local.get $1 - local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - local.tee $4 - call $~lib/map/Map#find - local.tee $3 + block $~lib/util/hash/HASH|inlined.4 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.4 + end + call $~lib/map/Map#find + local.set $3 + local.get $3 + i32.eqz if + i32.const 0 + return + end + local.get $3 + local.get $3 + i32.load offset=12 + i32.const 1 + i32.or + i32.store offset=12 + local.get $0 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.sub + i32.store offset=20 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shr_u + local.set $4 + local.get $4 + i32.const 1 + i32.add + i32.const 4 + local.tee $5 + local.get $0 + i32.load offset=20 + local.tee $6 + local.get $5 + local.get $6 + i32.gt_u + select + i32.ge_u + if (result i32) + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + f64.convert_i32_s + f64.const 0.75 + f64.mul + i32.trunc_f64_s + i32.lt_s + else + i32.const 0 + end + if + local.get $0 + local.get $4 + call $~lib/map/Map#rehash + end + i32.const 1 + ) + (func $std/map/testNumeric (; 99 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i64) + i32.const 0 + call $~lib/map/Map#constructor + local.set $0 + block $break|0 + i64.const 0 + local.set $1 + loop $repeat|0 + local.get $1 + i64.const 100 + i64.lt_u + i32.eqz + br_if $break|0 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 10 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 11 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i64.const 1 + i64.add + local.set $1 + br $repeat|0 + unreachable + end + unreachable + end + local.get $0 + call $~lib/map/Map#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 13 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|1 + i64.const 0 + local.set $1 + loop $repeat|1 + local.get $1 + i64.const 100 + i64.lt_u + i32.eqz + br_if $break|1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 17 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 20 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 21 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i64.const 1 + i64.add + local.set $1 + br $repeat|1 + unreachable + end + unreachable + end + local.get $0 + call $~lib/map/Map#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 23 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|2 + i64.const 0 + local.set $1 + loop $repeat|2 + local.get $1 + i64.const 50 + i64.lt_u + i32.eqz + br_if $break|2 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 27 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i64.const 1 + i64.add + local.set $1 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + call $~lib/map/Map#get:size + i32.const 50 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|3 + i64.const 0 + local.set $1 + loop $repeat|3 + local.get $1 + i64.const 50 + i64.lt_u + i32.eqz + br_if $break|3 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i64.const 1 + i64.add + local.set $1 + br $repeat|3 + unreachable + end + unreachable + end + local.get $0 + call $~lib/map/Map#get:size + i32.const 50 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 42 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/map/Map#clear + local.get $0 + call $~lib/map/Map#get:size + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 46 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/map/Map#clear (; 100 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end + i32.store + local.get $0 + i32.const 4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + end + i32.store offset=8 + local.get $0 + i32.const 4 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + ) + (func $~lib/map/Map#constructor (; 101 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 25 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/map/Map#clear + local.get $0 + ) + (func $~lib/map/Map#find (; 102 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 + if + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + f32.load + local.get $1 + f32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 + end + end + end + i32.const 0 + ) + (func $~lib/map/Map#has (; 103 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (local $2 f32) + local.get $0 + local.get $1 + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 + end + call $~lib/map/Map#find + i32.const 0 + i32.ne + ) + (func $~lib/map/Map#rehash (; 104 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 f32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.const 1 + i32.add + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $3 + local.get $2 + f64.convert_i32_s + f64.const 2.6666666666666665 + f64.mul + i32.trunc_f64_s + local.set $4 + i32.const 0 + local.get $4 + block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) + i32.const 12 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 + local.get $0 + i32.load offset=8 + local.set $6 + local.get $6 + local.get $0 + i32.load offset=16 + block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) + i32.const 12 + end + i32.mul + i32.add + local.set $7 + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne + if + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + f32.load + f32.store + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + f32.load + local.set $11 + local.get $11 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=8 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) + i32.const 12 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end + i32.add + local.set $6 + br $continue|0 + end + end + end + local.get $0 + local.tee $9 + local.get $3 + local.get $9 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $0 + local.get $1 + i32.store offset=4 + local.get $0 + local.tee $9 + local.get $5 + local.get $9 + i32.load offset=8 + call $~lib/rt/purerc/__retainRelease + i32.store offset=8 + local.get $0 + local.get $4 + i32.store offset=12 + local.get $0 + local.get $0 + i32.load offset=20 + i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + ) + (func $~lib/map/Map#set (; 105 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) + (local $3 f32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $3 local.get $3 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $4 + local.get $0 + local.get $1 + local.get $4 + call $~lib/map/Map#find + local.set $5 + local.get $5 + if + local.get $5 local.get $2 i32.store offset=4 else @@ -5700,23 +9005,29 @@ end local.get $0 i32.load offset=8 - local.set $3 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $5 - i32.const 1 - i32.add - i32.store offset=16 - local.get $5 - i32.const 12 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $6 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $7 + i32.const 1 + i32.add + i32.store offset=16 + local.get $7 + end + block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) + i32.const 12 + end i32.mul - local.get $3 i32.add - local.tee $3 + local.set $5 + local.get $5 local.get $1 f32.store - local.get $3 + local.get $5 local.get $2 i32.store offset=4 local.get $0 @@ -5725,55 +9036,80 @@ i32.const 1 i32.add i32.store offset=20 - local.get $3 local.get $0 i32.load + local.get $4 local.get $0 i32.load offset=4 - local.get $4 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $7 + local.get $5 + local.get $7 i32.load i32.store offset=8 - local.get $0 - local.get $3 + local.get $7 + local.get $5 i32.store + local.get $6 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 65 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#get (; 106 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (local $2 f32) + (local $3 i32) local.get $0 local.get $1 - local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 + end call $~lib/map/Map#find - local.tee $0 + local.set $3 + local.get $3 if (result i32) - local.get $0 + local.get $3 i32.load offset=4 else unreachable end ) - (func $~lib/map/Map#delete (; 66 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) - (local $2 i32) + (func $~lib/map/Map#get:size (; 107 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/map/Map#delete (; 108 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (local $2 f32) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 local.get $1 - local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + block $~lib/util/hash/HASH|inlined.4 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.4 + end call $~lib/map/Map#find - local.tee $2 + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $2 - local.get $2 + local.get $3 + local.get $3 i32.load offset=8 i32.const 1 i32.or @@ -5788,15 +9124,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $3 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $5 local.get $0 i32.load offset=20 - local.tee $2 - i32.const 4 - local.get $2 + local.tee $6 + local.get $5 + local.get $6 i32.gt_u select i32.ge_u @@ -5815,350 +9153,399 @@ end if local.get $0 - local.get $3 + local.get $4 call $~lib/map/Map#rehash end + i32.const 1 ) - (func $std/map/testNumeric (; 67 ;) (type $FUNCSIG$v) - (local $0 f32) - (local $1 i32) + (func $std/map/testNumeric (; 109 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 f32) + i32.const 0 call $~lib/map/Map#constructor - local.set $1 - loop $repeat|0 - local.get $0 - f32.const 100 - f32.lt - if + local.set $0 + block $break|0 + f32.const 0 + local.set $1 + loop $repeat|0 local.get $1 + f32.const 100 + f32.lt + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 - local.get $0 - i32.trunc_f32_s i32.const 10 + local.get $1 + i32.trunc_f32_s i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 10 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 - i32.trunc_f32_s i32.const 10 + local.get $1 + i32.trunc_f32_s i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 11 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - f32.const 1 - f32.add - local.set $0 - br $repeat|0 end + local.get $1 + f32.const 1 + f32.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort unreachable end - f32.const 0 - local.set $0 - loop $repeat|1 - local.get $0 - f32.const 100 - f32.lt - if + block $break|1 + f32.const 0 + local.set $1 + loop $repeat|1 local.get $1 + f32.const 100 + f32.lt + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 17 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 - i32.trunc_f32_s i32.const 10 + local.get $1 + i32.trunc_f32_s i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 18 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 - local.get $0 - i32.trunc_f32_s i32.const 20 + local.get $1 + i32.trunc_f32_s i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 20 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 - i32.trunc_f32_s i32.const 20 + local.get $1 + i32.trunc_f32_s i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 21 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - f32.const 1 - f32.add - local.set $0 - br $repeat|1 end + local.get $1 + f32.const 1 + f32.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort unreachable end - f32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - f32.const 50 - f32.lt - if + block $break|2 + f32.const 0 + local.set $1 + loop $repeat|2 local.get $1 + f32.const 50 + f32.lt + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 27 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 - i32.trunc_f32_s i32.const 20 + local.get $1 + i32.trunc_f32_s i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 28 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 30 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - f32.const 1 - f32.add - local.set $0 - br $repeat|2 end + local.get $1 + f32.const 1 + f32.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort unreachable end - f32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - f32.const 50 - f32.lt - if + block $break|3 + f32.const 0 + local.set $1 + loop $repeat|3 local.get $1 + f32.const 50 + f32.lt + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 36 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 - local.get $0 - i32.trunc_f32_s i32.const 10 + local.get $1 + i32.trunc_f32_s i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 38 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 40 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - f32.const 1 - f32.add - local.set $0 - br $repeat|3 end + local.get $1 + f32.const 1 + f32.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/map/Map#clear - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#clear + local.get $0 + call $~lib/map/Map#get:size + i32.const 0 + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#constructor (; 68 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 26 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 + (func $~lib/map/Map#clear (; 110 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 - i32.const 0 + i32.const 4 i32.store offset=12 local.get $0 i32.const 0 @@ -6166,62 +9553,105 @@ local.get $0 i32.const 0 i32.store offset=20 - local.get $0 - call $~lib/map/Map#clear + ) + (func $~lib/map/Map#constructor (; 111 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 26 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 69 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 112 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (local $3 i32) local.get $0 i32.load + local.get $2 local.get $0 i32.load offset=4 - local.get $2 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add i32.load - local.set $0 - loop $continue|0 - local.get $0 - if - local.get $0 - i32.load offset=12 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $0 - f64.load - local.get $1 - f64.eq - end + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 if - local.get $0 - return + local.get $3 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + f64.load + local.get $1 + f64.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=12 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 end - local.get $0 - i32.load offset=12 - i32.const -2 - i32.and - local.set $0 - br $continue|0 end end i32.const 0 ) - (func $~lib/map/Map#has (; 70 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#has (; 113 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (local $2 f64) local.get $0 local.get $1 - local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 71 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 114 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6229,120 +9659,167 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 f64) + (local $12 i32) + (local $13 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $6 - i32.const 4 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor local.set $4 + i32.const 0 + local.get $4 + block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) + i32.const 16 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 4 - i32.shl + block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) + i32.const 16 + end + i32.mul i32.add local.set $7 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $7 - i32.ne - if - local.get $2 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - f64.load - f64.store - local.get $3 - local.get $2 - i32.load offset=8 - i32.store offset=8 - local.get $3 - local.get $2 - f64.load - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - local.get $1 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=12 + i32.const 1 i32.and - i32.const 2 - i32.shl - local.get $5 + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + f64.load + f64.store + local.get $10 + local.get $9 + i32.load offset=8 + i32.store offset=8 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + f64.load + local.set $11 + local.get $11 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=12 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) + i32.const 16 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end i32.add - local.tee $8 - i32.load - i32.store offset=12 - local.get $8 - local.get $3 - i32.store - local.get $3 - i32.const 16 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 16 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $5 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $6 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 72 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) - (local $3 i32) + (func $~lib/map/Map#set (; 115 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) + (local $3 f64) (local $4 i32) (local $5 i32) + (local $6 i32) + (local $7 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $3 + local.get $3 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $4 local.get $0 local.get $1 - local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - local.tee $4 + local.get $4 call $~lib/map/Map#find - local.tee $3 + local.set $5 + local.get $5 if - local.get $3 + local.get $5 local.get $2 i32.store offset=8 else @@ -6377,23 +9854,29 @@ end local.get $0 i32.load offset=8 - local.set $3 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $5 - i32.const 1 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $6 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $7 + i32.const 1 + i32.add + i32.store offset=16 + local.get $7 + end + block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) + i32.const 16 + end + i32.mul i32.add - i32.store offset=16 + local.set $5 local.get $5 - i32.const 4 - i32.shl - local.get $3 - i32.add - local.tee $3 local.get $1 f64.store - local.get $3 + local.get $5 local.get $2 i32.store offset=8 local.get $0 @@ -6402,55 +9885,80 @@ i32.const 1 i32.add i32.store offset=20 - local.get $3 local.get $0 i32.load + local.get $4 local.get $0 i32.load offset=4 - local.get $4 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $7 + local.get $5 + local.get $7 i32.load i32.store offset=12 - local.get $0 - local.get $3 + local.get $7 + local.get $5 i32.store + local.get $6 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 73 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#get (; 116 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (local $2 f64) + (local $3 i32) local.get $0 local.get $1 - local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.3 + end call $~lib/map/Map#find - local.tee $0 + local.set $3 + local.get $3 if (result i32) - local.get $0 + local.get $3 i32.load offset=8 else unreachable end ) - (func $~lib/map/Map#delete (; 74 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) - (local $2 i32) + (func $~lib/map/Map#get:size (; 117 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/map/Map#delete (; 118 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (local $2 f64) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 local.get $1 - local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + block $~lib/util/hash/HASH|inlined.4 (result i32) + local.get $1 + local.set $2 + local.get $2 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.4 + end call $~lib/map/Map#find - local.tee $2 + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $2 - local.get $2 + local.get $3 + local.get $3 i32.load offset=12 i32.const 1 i32.or @@ -6465,15 +9973,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $3 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $5 local.get $0 i32.load offset=20 - local.tee $2 - i32.const 4 - local.get $2 + local.tee $6 + local.get $5 + local.get $6 i32.gt_u select i32.ge_u @@ -6492,507 +10002,369 @@ end if local.get $0 - local.get $3 + local.get $4 call $~lib/map/Map#rehash end + i32.const 1 ) - (func $std/map/testNumeric (; 75 ;) (type $FUNCSIG$v) - (local $0 f64) - (local $1 i32) + (func $std/map/testNumeric (; 119 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 f64) + i32.const 0 call $~lib/map/Map#constructor - local.set $1 - loop $repeat|0 - local.get $0 - f64.const 100 - f64.lt - if + local.set $0 + block $break|0 + f64.const 0 + local.set $1 + loop $repeat|0 local.get $1 + f64.const 100 + f64.lt + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 - local.get $0 - i32.trunc_f64_s i32.const 10 + local.get $1 + i32.trunc_f64_s i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 10 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 - i32.trunc_f64_s i32.const 10 + local.get $1 + i32.trunc_f64_s i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 11 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - f64.const 1 - f64.add - local.set $0 - br $repeat|0 end + local.get $1 + f64.const 1 + f64.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort unreachable end - f64.const 0 - local.set $0 - loop $repeat|1 - local.get $0 - f64.const 100 - f64.lt - if + block $break|1 + f64.const 0 + local.set $1 + loop $repeat|1 local.get $1 + f64.const 100 + f64.lt + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 17 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 - i32.trunc_f64_s i32.const 10 + local.get $1 + i32.trunc_f64_s i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 18 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 - local.get $0 - i32.trunc_f64_s i32.const 20 + local.get $1 + i32.trunc_f64_s i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 20 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 - i32.trunc_f64_s i32.const 20 + local.get $1 + i32.trunc_f64_s i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 21 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - f64.const 1 - f64.add - local.set $0 - br $repeat|1 end + local.get $1 + f64.const 1 + f64.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort unreachable end - f64.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - f64.const 50 - f64.lt - if + block $break|2 + f64.const 0 + local.set $1 + loop $repeat|2 local.get $1 + f64.const 50 + f64.lt + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 27 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 call $~lib/map/Map#get - local.get $0 - i32.trunc_f64_s i32.const 20 + local.get $1 + i32.trunc_f64_s i32.add - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 28 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 30 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - f64.const 1 - f64.add - local.set $0 - br $repeat|2 end + local.get $1 + f64.const 1 + f64.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort unreachable end - f64.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - f64.const 50 - f64.lt - if + block $break|3 + f64.const 0 + local.set $1 + loop $repeat|3 local.get $1 + f64.const 50 + f64.lt + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 36 i32.const 4 call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - local.get $0 - local.get $0 - i32.trunc_f64_s i32.const 10 + local.get $1 + i32.trunc_f64_s i32.add call $~lib/map/Map#set - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 38 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 + local.get $1 call $~lib/map/Map#delete - local.get $1 + drop local.get $0 + local.get $1 call $~lib/map/Map#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 40 i32.const 4 call $~lib/builtins/abort unreachable - else - local.get $0 - f64.const 1 - f64.add - local.set $0 - br $repeat|3 end + local.get $1 + f64.const 1 + f64.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/map/Map#clear - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/map/Map#clear + local.get $0 + call $~lib/map/Map#get:size + i32.const 0 + i32.eq + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end - ) - (func $~lib/runtime/runtime.instanceof (; 76 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.const 16 - i32.sub - i32.load - local.tee $0 - if (result i32) - local.get $0 - i32.const 160 - i32.load - i32.le_u - else - i32.const 0 - end - if - loop $continue|0 - local.get $0 - local.get $1 - i32.eq - if - i32.const 1 - return - end - local.get $0 - i32.const 3 - i32.shl - i32.const 160 - i32.add - i32.load offset=4 - local.tee $0 - br_if $continue|0 - end - end - i32.const 0 + call $~lib/rt/purerc/__release ) - (func $~lib/runtime/runtime.flags (; 77 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - if (result i32) - local.get $0 - i32.const 160 - i32.load - i32.gt_u - else - i32.const 1 - end - if (result i32) - unreachable - else - local.get $0 - i32.const 3 - i32.shl - i32.const 160 - i32.add - i32.load - end - ) - (func $~lib/runtime/runtime.newObject (; 78 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - call $~lib/util/runtime/allocate - local.get $1 - call $~lib/util/runtime/register - ) - (func $~lib/runtime/runtime.newString (; 79 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 1 - i32.shl - i32.const 16 - call $~lib/runtime/runtime.newObject - ) - (func $~lib/runtime/runtime.newArrayBuffer (; 80 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 15 - call $~lib/runtime/runtime.newObject - ) - (func $~lib/runtime/runtime.newArray (; 81 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - local.tee $2 - if (result i32) - local.get $2 - i32.const 160 - i32.load - i32.gt_u - else - i32.const 1 - end - if (result i32) - unreachable - else - local.get $2 - i32.const 3 - i32.shl - i32.const 160 - i32.add - i32.load - end - local.tee $0 - i32.const 16 - i32.div_u - i32.const 31 - i32.and - local.set $4 - local.get $1 - if (result i32) - local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - else - i32.const 0 - call $~lib/runtime/runtime.newArrayBuffer - local.set $1 - i32.const 0 - end - local.set $3 - local.get $2 - i32.const 16 - call $~lib/runtime/runtime.newObject - local.tee $2 - i32.load - drop - local.get $2 - local.get $1 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - local.get $3 - i32.store offset=8 - local.get $2 - local.get $3 - local.get $4 - i32.shr_u - i32.store offset=12 - local.get $0 - i32.const 1024 - i32.and - if - local.get $1 - local.get $3 - i32.add - local.set $0 - loop $continue|0 - local.get $1 - local.get $0 - i32.lt_u - if - local.get $1 - i32.load - drop - local.get $1 - i32.const 4 - i32.add - local.set $1 - br $continue|0 - end - end - end - local.get $2 - ) - (func $~lib/runtime/runtime.retain (; 82 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/runtime/runtime.collect (; 83 ;) (type $FUNCSIG$v) - nop - ) - (func $start (; 84 ;) (type $FUNCSIG$v) - i32.const 392 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (func $start:std/map (; 120 ;) (type $FUNCSIG$v) call $std/map/testNumeric call $std/map/testNumeric call $std/map/testNumeric @@ -7003,10 +10375,1175 @@ call $std/map/testNumeric call $std/map/testNumeric call $std/map/testNumeric + ) + (func $start (; 121 ;) (type $FUNCSIG$v) + call $start:std/map + ) + (func $~lib/rt/purerc/increment (; 122 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 123 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 124 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 125 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 328 + i32.const 384 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 126 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 127 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 i32.const 0 - call $~lib/util/runtime/allocate - i32.const 28 - call $~lib/util/runtime/register - global.set $~lib/runtime/ROOT + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 128 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 129 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__retainRelease (; 130 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.ne + if + global.get $~lib/builtins/HEAP_BASE + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + local.get $2 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + end + local.get $0 + ) + (func $~lib/rt/purerc/__release (; 131 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/purerc/markGray (; 132 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 133 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 134 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 135 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 136 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/map/Map#__visit_impl (; 137 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 138 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 139 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 140 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 141 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 142 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 143 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 144 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 145 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 146 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/builtins/__visit_members (; 147 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$28 + block $switch$1$case$27 + block $switch$1$case$26 + block $switch$1$case$25 + block $switch$1$case$24 + block $switch$1$case$23 + block $switch$1$case$22 + block $switch$1$case$21 + block $switch$1$case$20 + block $switch$1$case$19 + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$19 $switch$1$case$20 $switch$1$case$21 $switch$1$case$22 $switch$1$case$23 $switch$1$case$24 $switch$1$case$25 $switch$1$case$26 $switch$1$case$27 $switch$1$case$28 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 148 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/map.ts b/tests/compiler/std/map.ts index fed0f646..e5269875 100644 --- a/tests/compiler/std/map.ts +++ b/tests/compiler/std/map.ts @@ -1,5 +1,3 @@ -import "collector/dummy"; - function testNumeric(): void { var map = new Map(); diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index 17e5e951..e372c05a 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -1,12 +1,12 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$iij (func (param i32 i64) (result i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$iiji (func (param i32 i64 i32) (result i32))) @@ -18,506 +18,1670 @@ (type $FUNCSIG$iidi (func (param i32 f64 i32) (result i32))) (type $FUNCSIG$vidi (func (param i32 f64 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00(\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00") - (data (i32.const 64) "\10\00\00\00&\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 120) "\10\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00s\00t\00d\00/\00m\00a\00p\00.\00t\00s\00") - (data (i32.const 160) "\1c\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00L\08\00\00\00\00\00\00L\08\00\00\00\00\00\00L\10\00\00\00\00\00\00L\10\00\00\00\00\00\00L \00\00\00\00\00\00L \00\00\00\00\00\00L@\00\00\00\00\00\00L@\00\00\00\00\00\00L \00\00\00\00\00\00L@\00\00\00\00\00\00I\00\00\00\0e\00\00\00\08\00\00\00\00\00\00\00") + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\10\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 56) "&\00\00\00\01\00\00\00\10\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 160) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\10\00\00\00\14\00\00\00s\00t\00d\00/\00m\00a\00p\00.\00t\00s\00") + (data (i32.const 256) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 312) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 368) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 424) "\1a\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00L\08\00\00\00\00\00\00L\08\00\00\00\00\00\00L\10\00\00\00\00\00\00L\10\00\00\00\00\00\00L \00\00\00\00\00\00L \00\00\00\00\00\00L@\00\00\00\00\00\00L@\00\00\00\00\00\00L \00\00\00\00\00\00L@\00\00\00\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/util/runtime/HEADER_SIZE i32 (i32.const 16)) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/util/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) - (global $~lib/ASC_NO_ASSERT i32 (i32.const 0)) - (global $~lib/util/runtime/MAX_BYTELENGTH i32 (i32.const 1073741808)) - (global $~lib/runtime/ROOT (mut i32) (i32.const 0)) - (global $~lib/runtime/RTTI_BASE i32 (i32.const 160)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 392)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 424)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 640)) (export "memory" (memory $0)) - (export "$.instanceof" (func $~lib/runtime/runtime.instanceof)) - (export "$.flags" (func $~lib/runtime/runtime.flags)) - (export "$.newObject" (func $~lib/runtime/runtime.newObject)) - (export "$.newString" (func $~lib/runtime/runtime.newString)) - (export "$.newArrayBuffer" (func $~lib/runtime/runtime.newArrayBuffer)) - (export "$.newArray" (func $~lib/runtime/runtime.newArray)) - (export "$.retain" (func $~lib/runtime/runtime.retain)) - (export "$.release" (func $~lib/runtime/runtime.release)) - (export "$.collect" (func $~lib/runtime/runtime.collect)) (start $start) - (func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/removeBlock (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 i32.const 1 - i32.const 32 - local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end ) - (func $~lib/allocator/arena/__mem_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/insertBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 6 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 7 ;) (type $FUNCSIG$v) + (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 - local.get $2 - local.get $3 - i32.gt_u - select + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 i32.add - i32.const 7 - i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 + local.set $0 current_memory - local.set $5 - local.get $4 - local.get $5 + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and i32.const 16 - i32.shl - i32.gt_u - if - local.get $4 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 local.get $1 i32.sub - i32.const 65535 + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl i32.add - i32.const 65535 + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 i32.const -1 i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $2 - local.get $5 - local.tee $3 local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if local.get $3 grow_memory i32.const 0 i32.lt_s if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end + unreachable end end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/memory/memory.allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + current_memory + local.set $7 local.get $0 - call $~lib/allocator/arena/__mem_allocate - return - ) - (func $~lib/util/runtime/allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - call $~lib/util/runtime/adjust - call $~lib/memory/memory.allocate - local.set $1 - local.get $1 - global.get $~lib/util/runtime/HEADER_MAGIC - i32.store - local.get $1 - local.get $0 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.store offset=8 - local.get $1 - i32.const 0 - i32.store offset=12 - local.get $1 - global.get $~lib/util/runtime/HEADER_SIZE - i32.add - ) - (func $~lib/collector/dummy/__ref_register (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/util/runtime/register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $0 - global.get $~lib/memory/HEAP_BASE - i32.gt_u - i32.eqz - if - i32.const 0 - i32.const 24 - i32.const 129 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.sub - local.set $2 local.get $2 - i32.load - global.get $~lib/util/runtime/HEADER_MAGIC - i32.eq - i32.eqz - if - i32.const 0 - i32.const 24 - i32.const 131 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $2 - local.get $1 - i32.store - local.get $0 - call $~lib/collector/dummy/__ref_register - local.get $0 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop ) - (func $~lib/memory/memory.fill (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/prepareBlock (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i64) - block $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 i32.eqz if br $~lib/util/memory/memset|inlined.0 end - local.get $0 - local.get $1 + local.get $5 + local.get $4 i32.store8 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 1 i32.sub - local.get $1 + local.get $4 i32.store8 - local.get $2 + local.get $3 i32.const 2 i32.le_u if br $~lib/util/memory/memset|inlined.0 end - local.get $0 + local.get $5 i32.const 1 i32.add - local.get $1 + local.get $4 i32.store8 - local.get $0 + local.get $5 i32.const 2 i32.add - local.get $1 + local.get $4 i32.store8 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 2 i32.sub - local.get $1 + local.get $4 i32.store8 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 3 i32.sub - local.get $1 + local.get $4 i32.store8 - local.get $2 + local.get $3 i32.const 6 i32.le_u if br $~lib/util/memory/memset|inlined.0 end - local.get $0 + local.get $5 i32.const 3 i32.add - local.get $1 + local.get $4 i32.store8 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 4 i32.sub - local.get $1 + local.get $4 i32.store8 - local.get $2 + local.get $3 i32.const 8 i32.le_u if br $~lib/util/memory/memset|inlined.0 end i32.const 0 - local.get $0 + local.get $5 i32.sub i32.const 3 i32.and - local.set $5 - local.get $0 + local.set $6 local.get $5 + local.get $6 i32.add - local.set $0 - local.get $2 - local.get $5 + local.set $5 + local.get $3 + local.get $6 i32.sub - local.set $2 - local.get $2 + local.set $3 + local.get $3 i32.const -4 i32.and - local.set $2 + local.set $3 i32.const -1 i32.const 255 i32.div_u - local.get $1 + local.get $4 i32.const 255 i32.and i32.mul - local.set $4 - local.get $0 - local.get $4 + local.set $7 + local.get $5 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 4 i32.sub - local.get $4 + local.get $7 i32.store - local.get $2 + local.get $3 i32.const 8 i32.le_u if br $~lib/util/memory/memset|inlined.0 end - local.get $0 + local.get $5 i32.const 4 i32.add - local.get $4 + local.get $7 i32.store - local.get $0 + local.get $5 i32.const 8 i32.add - local.get $4 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 12 i32.sub - local.get $4 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 8 i32.sub - local.get $4 + local.get $7 i32.store - local.get $2 + local.get $3 i32.const 24 i32.le_u if br $~lib/util/memory/memset|inlined.0 end - local.get $0 + local.get $5 i32.const 12 i32.add - local.get $4 + local.get $7 i32.store - local.get $0 + local.get $5 i32.const 16 i32.add - local.get $4 + local.get $7 i32.store - local.get $0 + local.get $5 i32.const 20 i32.add - local.get $4 + local.get $7 i32.store - local.get $0 + local.get $5 i32.const 24 i32.add - local.get $4 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 28 i32.sub - local.get $4 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 24 i32.sub - local.get $4 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 20 i32.sub - local.get $4 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 16 i32.sub - local.get $4 + local.get $7 i32.store i32.const 24 - local.get $0 + local.get $5 i32.const 4 i32.and i32.add - local.set $5 - local.get $0 + local.set $6 local.get $5 + local.get $6 i32.add - local.set $0 - local.get $2 - local.get $5 + local.set $5 + local.get $3 + local.get $6 i32.sub - local.set $2 - local.get $4 + local.set $3 + local.get $7 i64.extend_i32_u - local.get $4 + local.get $7 i64.extend_i32_u i64.const 32 i64.shl i64.or - local.set $6 + local.set $8 block $break|0 loop $continue|0 - local.get $2 + local.get $3 i32.const 32 i32.ge_u if - block - local.get $0 - local.get $6 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $6 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $6 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $6 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 br $continue|0 end end end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 - global.get $~lib/util/runtime/MAX_BYTELENGTH + i32.const 1073741808 i32.gt_u if - i32.const 0 - i32.const 80 - i32.const 54 - i32.const 43 + i32.const 24 + i32.const 72 + i32.const 56 + i32.const 42 call $~lib/builtins/abort unreachable end local.get $1 - call $~lib/util/runtime/allocate + i32.const 15 + call $~lib/rt/tlsf/__alloc local.set $2 local.get $2 i32.const 0 local.get $1 call $~lib/memory/memory.fill local.get $2 - i32.const 15 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/collector/dummy/__ref_link (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - nop - ) - (func $~lib/collector/dummy/__ref_unlink (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - nop - ) - (func $~lib/map/Map#clear (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -527,27 +1691,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 48 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -560,15 +1710,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 17 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -594,14 +1744,14 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/util/hash/hash8 (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash8 (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const -2128831035 local.get $0 i32.xor i32.const 16777619 i32.mul ) - (func $~lib/map/Map#find (; 14 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 19 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -618,43 +1768,41 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load8_s - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i32.load8_s + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -673,7 +1821,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 21 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -729,63 +1877,61 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load8_s + i32.store8 + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load8_s - i32.store8 - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load8_s - local.set $11 - local.get $11 - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load - i32.store offset=8 - local.get $12 - local.get $8 - i32.store - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end + i32.add + local.set $6 br $continue|0 end end @@ -793,25 +1939,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $12 local.get $9 i32.load - local.tee $11 - i32.ne - if (result i32) - local.get $11 - if - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -819,25 +1949,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $11 local.get $9 i32.load offset=8 - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $11 - else - local.get $11 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -846,8 +1960,12 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 17 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -906,6 +2024,7 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $3 local.get $3 block (result i32) @@ -953,9 +2072,11 @@ local.get $6 local.get $5 i32.store + local.get $3 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -981,11 +2102,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 24 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1061,7 +2182,7 @@ end i32.const 1 ) - (func $std/map/testNumeric (; 21 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 26 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -1076,62 +2197,60 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 10 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 11 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 11 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1149,7 +2268,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort @@ -1164,81 +2283,79 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 17 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 17 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 20 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 21 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 21 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1256,7 +2373,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort @@ -1271,56 +2388,54 @@ i32.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 27 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 30 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 27 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1338,7 +2453,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort @@ -1353,59 +2468,57 @@ i32.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 40 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1423,7 +2536,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort @@ -1438,40 +2551,26 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#clear (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -1481,27 +2580,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 48 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -1514,15 +2599,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 18 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -1548,7 +2633,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 24 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 29 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -1565,41 +2650,39 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 + i32.load8_u + local.get $1 + i32.const 255 i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load8_u - local.get $1 - i32.const 255 - i32.and - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -1616,7 +2699,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 26 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1672,63 +2755,61 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load8_u + i32.store8 + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load8_u - i32.store8 - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load8_u - local.set $11 - local.get $11 - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load - i32.store offset=8 - local.get $12 - local.get $8 - i32.store - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end + i32.add + local.set $6 br $continue|0 end end @@ -1736,25 +2817,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $12 local.get $9 i32.load - local.tee $11 - i32.ne - if (result i32) - local.get $11 - if - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -1762,25 +2827,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $11 local.get $9 i32.load offset=8 - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $11 - else - local.get $11 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -1789,8 +2838,12 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 27 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 32 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -1847,6 +2900,7 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $3 local.get $3 block (result i32) @@ -1894,9 +2948,11 @@ local.get $6 local.get $5 i32.store + local.get $3 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -1920,11 +2976,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1998,7 +3054,7 @@ end i32.const 1 ) - (func $std/map/testNumeric (; 31 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 36 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -2013,58 +3069,56 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 255 + i32.and + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 10 - local.get $1 - i32.const 255 - i32.and - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 255 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 11 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 255 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 11 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2082,7 +3136,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort @@ -2097,75 +3151,73 @@ i32.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 17 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 255 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 17 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 255 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.const 255 + i32.and + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 20 - local.get $1 - i32.const 255 - i32.and - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 255 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 21 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 255 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 21 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2183,7 +3235,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort @@ -2198,54 +3250,52 @@ i32.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 27 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 255 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 30 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 27 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 255 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2263,7 +3313,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort @@ -2278,57 +3328,55 @@ i32.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.const 255 - i32.and - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 40 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 255 + i32.and + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2346,7 +3394,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort @@ -2361,40 +3409,26 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#clear (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -2404,27 +3438,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 48 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -2437,15 +3457,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 38 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 19 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -2471,7 +3491,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/util/hash/hash16 (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash16 (; 39 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -2493,7 +3513,7 @@ local.set $1 local.get $1 ) - (func $~lib/map/Map#find (; 35 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 40 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -2510,43 +3530,41 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load16_s - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i32.load16_s + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -2565,7 +3583,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 37 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 42 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2621,63 +3639,61 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load16_s + i32.store16 + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load16_s - i32.store16 - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load16_s - local.set $11 - local.get $11 - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load - i32.store offset=8 - local.get $12 - local.get $8 - i32.store - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end + i32.add + local.set $6 br $continue|0 end end @@ -2685,25 +3701,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $12 local.get $9 i32.load - local.tee $11 - i32.ne - if (result i32) - local.get $11 - if - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -2711,25 +3711,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $11 local.get $9 i32.load offset=8 - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $11 - else - local.get $11 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -2738,8 +3722,12 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 38 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 43 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2798,6 +3786,7 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $3 local.get $3 block (result i32) @@ -2845,9 +3834,11 @@ local.get $6 local.get $5 i32.store + local.get $3 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -2873,11 +3864,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 45 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2953,7 +3944,7 @@ end i32.const 1 ) - (func $std/map/testNumeric (; 42 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 47 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -2968,62 +3959,60 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 10 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 11 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 11 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3041,7 +4030,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort @@ -3056,81 +4045,79 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 17 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 17 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 20 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 21 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 21 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3148,7 +4135,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort @@ -3163,56 +4150,54 @@ i32.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 27 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 30 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 27 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3230,7 +4215,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort @@ -3245,59 +4230,57 @@ i32.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 40 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3315,7 +4298,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort @@ -3330,40 +4313,26 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#clear (; 43 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 48 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -3373,27 +4342,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 48 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -3406,15 +4361,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 44 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 49 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 20 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -3440,7 +4395,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 45 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 50 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -3457,41 +4412,39 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 + i32.load16_u + local.get $1 + i32.const 65535 i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load16_u - local.get $1 - i32.const 65535 - i32.and - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 51 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -3508,7 +4461,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 47 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 52 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3564,63 +4517,61 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load16_u + i32.store16 + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load16_u - i32.store16 - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load16_u - local.set $11 - local.get $11 - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load - i32.store offset=8 - local.get $12 - local.get $8 - i32.store - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end + i32.add + local.set $6 br $continue|0 end end @@ -3628,25 +4579,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $12 local.get $9 i32.load - local.tee $11 - i32.ne - if (result i32) - local.get $11 - if - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -3654,25 +4589,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $11 local.get $9 i32.load offset=8 - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $11 - else - local.get $11 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -3681,8 +4600,12 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 48 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 53 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3739,6 +4662,7 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $3 local.get $3 block (result i32) @@ -3786,9 +4710,11 @@ local.get $6 local.get $5 i32.store + local.get $3 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 49 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 54 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -3812,11 +4738,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 50 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 55 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 51 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 56 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3890,7 +4816,7 @@ end i32.const 1 ) - (func $std/map/testNumeric (; 52 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 57 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -3905,58 +4831,56 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 65535 + i32.and + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 10 - local.get $1 - i32.const 65535 - i32.and - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 65535 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 11 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 65535 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 11 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3974,7 +4898,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort @@ -3989,75 +4913,73 @@ i32.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 17 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 65535 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 17 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 65535 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.const 65535 + i32.and + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 20 - local.get $1 - i32.const 65535 - i32.and - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 65535 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 21 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 65535 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 21 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4075,7 +4997,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort @@ -4090,54 +5012,52 @@ i32.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 27 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 65535 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 30 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 27 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 65535 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4155,7 +5075,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort @@ -4170,57 +5090,55 @@ i32.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.const 65535 - i32.and - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 40 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 65535 + i32.and + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4238,7 +5156,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort @@ -4253,40 +5171,26 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#clear (; 53 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 58 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -4296,27 +5200,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 48 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -4329,15 +5219,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 54 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 59 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 21 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -4363,7 +5253,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/util/hash/hash32 (; 55 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 60 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -4405,7 +5295,7 @@ local.set $1 local.get $1 ) - (func $~lib/map/Map#find (; 56 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -4422,39 +5312,37 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load - local.get $1 - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i32.load + local.get $1 + i32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 57 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 62 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -4469,7 +5357,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 58 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 63 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4525,63 +5413,61 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load + i32.store + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load - i32.store - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load - local.set $11 - local.get $11 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load - i32.store offset=8 - local.get $12 - local.get $8 - i32.store - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end + i32.add + local.set $6 br $continue|0 end end @@ -4589,25 +5475,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $12 local.get $9 i32.load - local.tee $11 - i32.ne - if (result i32) - local.get $11 - if - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -4615,25 +5485,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $11 local.get $9 i32.load offset=8 - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $11 - else - local.get $11 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -4642,8 +5496,12 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 59 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 64 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4698,6 +5556,7 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $3 local.get $3 block (result i32) @@ -4745,9 +5604,11 @@ local.get $6 local.get $5 i32.store + local.get $3 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 60 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 65 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -4769,11 +5630,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 61 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 66 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 62 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 67 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4845,7 +5706,7 @@ end i32.const 1 ) - (func $std/map/testNumeric (; 63 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 68 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -4860,54 +5721,52 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 10 - local.get $1 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 11 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 11 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4925,7 +5784,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort @@ -4940,69 +5799,67 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 17 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 17 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 20 - local.get $1 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 21 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 21 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5020,7 +5877,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort @@ -5035,52 +5892,50 @@ i32.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 27 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 30 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 27 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5098,7 +5953,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort @@ -5113,55 +5968,53 @@ i32.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 40 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5179,7 +6032,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort @@ -5194,40 +6047,26 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#clear (; 64 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 69 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -5237,27 +6076,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 48 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -5270,15 +6095,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 65 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 70 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 22 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -5304,7 +6129,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 66 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 71 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -5321,39 +6146,37 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load - local.get $1 - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i32.load + local.get $1 + i32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 67 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 72 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -5368,7 +6191,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 68 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 73 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5424,63 +6247,61 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load + i32.store + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load - i32.store - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load - local.set $11 - local.get $11 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load - i32.store offset=8 - local.get $12 - local.get $8 - i32.store - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end + i32.add + local.set $6 br $continue|0 end end @@ -5488,25 +6309,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $12 local.get $9 i32.load - local.tee $11 - i32.ne - if (result i32) - local.get $11 - if - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -5514,25 +6319,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $11 local.get $9 i32.load offset=8 - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $11 - else - local.get $11 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -5541,8 +6330,12 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 69 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 74 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5597,6 +6390,7 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $3 local.get $3 block (result i32) @@ -5644,9 +6438,11 @@ local.get $6 local.get $5 i32.store + local.get $3 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 70 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 75 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -5668,11 +6464,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 71 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 76 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 72 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 77 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5744,7 +6540,7 @@ end i32.const 1 ) - (func $std/map/testNumeric (; 73 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 78 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -5759,54 +6555,52 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 10 - local.get $1 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 11 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 11 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5824,7 +6618,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort @@ -5839,69 +6633,67 @@ i32.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 17 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 17 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 20 - local.get $1 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 21 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 21 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5919,7 +6711,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort @@ -5934,52 +6726,50 @@ i32.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 27 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 30 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 27 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5997,7 +6787,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort @@ -6012,55 +6802,53 @@ i32.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 40 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -6078,7 +6866,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort @@ -6093,40 +6881,26 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#clear (; 74 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 79 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -6136,27 +6910,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 64 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -6169,15 +6929,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 75 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 80 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 23 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -6203,7 +6963,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/util/hash/hash64 (; 76 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/hash64 (; 81 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -6291,7 +7051,7 @@ local.set $3 local.get $3 ) - (func $~lib/map/Map#find (; 77 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 82 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -6308,39 +7068,37 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i64.load - local.get $1 - i64.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=12 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i64.load + local.get $1 + i64.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=12 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 78 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#has (; 83 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) local.get $0 local.get $1 @@ -6355,7 +7113,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 79 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 84 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6412,63 +7170,61 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i64.load + i64.store + local.get $10 + local.get $9 + i32.load offset=8 + i32.store offset=8 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i64.load - i64.store - local.get $10 - local.get $9 - i32.load offset=8 - i32.store offset=8 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i64.load - local.set $11 - local.get $11 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load - i32.store offset=12 - local.get $13 - local.get $8 - i32.store - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 16 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=12 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end + i32.add + local.set $6 br $continue|0 end end @@ -6476,25 +7232,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $13 local.get $9 i32.load - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $13 - else - local.get $13 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -6502,25 +7242,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $12 local.get $9 i32.load offset=8 - local.tee $13 - i32.ne - if (result i32) - local.get $13 - if - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -6529,8 +7253,12 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 80 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/map/Map#set (; 85 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i64) (local $4 i32) (local $5 i32) @@ -6586,6 +7314,7 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $6 local.get $6 block (result i32) @@ -6633,9 +7362,11 @@ local.get $7 local.get $5 i32.store + local.get $6 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 81 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#get (; 86 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) local.get $0 @@ -6657,11 +7388,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 82 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 87 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 83 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#delete (; 88 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) (local $4 i32) @@ -6734,7 +7465,7 @@ end i32.const 1 ) - (func $std/map/testNumeric (; 84 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 89 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i64) i32.const 0 @@ -6749,56 +7480,54 @@ i64.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 11 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 11 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6816,7 +7545,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort @@ -6831,72 +7560,70 @@ i64.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 17 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 17 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 20 - local.get $1 - i32.wrap_i64 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 21 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 21 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6914,7 +7641,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort @@ -6929,53 +7656,51 @@ i64.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 27 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 30 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 27 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6993,7 +7718,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort @@ -7008,56 +7733,54 @@ i64.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 40 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -7075,7 +7798,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort @@ -7090,40 +7813,26 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#clear (; 85 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 90 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -7133,27 +7842,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 64 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -7166,15 +7861,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 86 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 91 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 24 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -7200,7 +7895,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 87 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 92 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -7217,39 +7912,37 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i64.load - local.get $1 - i64.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=12 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i64.load + local.get $1 + i64.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=12 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 88 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#has (; 93 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) local.get $0 local.get $1 @@ -7264,7 +7957,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 89 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 94 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7321,63 +8014,61 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i64.load + i64.store + local.get $10 + local.get $9 + i32.load offset=8 + i32.store offset=8 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i64.load - i64.store - local.get $10 - local.get $9 - i32.load offset=8 - i32.store offset=8 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i64.load - local.set $11 - local.get $11 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load - i32.store offset=12 - local.get $13 - local.get $8 - i32.store - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 16 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=12 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end + i32.add + local.set $6 br $continue|0 end end @@ -7385,25 +8076,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $13 local.get $9 i32.load - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $13 - else - local.get $13 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -7411,25 +8086,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $12 local.get $9 i32.load offset=8 - local.tee $13 - i32.ne - if (result i32) - local.get $13 - if - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -7438,8 +8097,12 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 90 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/map/Map#set (; 95 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i64) (local $4 i32) (local $5 i32) @@ -7495,6 +8158,7 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $6 local.get $6 block (result i32) @@ -7542,9 +8206,11 @@ local.get $7 local.get $5 i32.store + local.get $6 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 91 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#get (; 96 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) local.get $0 @@ -7566,11 +8232,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 92 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 97 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 93 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#delete (; 98 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) (local $4 i32) @@ -7643,7 +8309,7 @@ end i32.const 1 ) - (func $std/map/testNumeric (; 94 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 99 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i64) i32.const 0 @@ -7658,56 +8324,54 @@ i64.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 11 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 11 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -7725,7 +8389,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort @@ -7740,72 +8404,70 @@ i64.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 17 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 17 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 20 - local.get $1 - i32.wrap_i64 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 21 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 21 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -7823,7 +8485,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort @@ -7838,53 +8500,51 @@ i64.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 27 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 30 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 27 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -7902,7 +8562,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort @@ -7917,56 +8577,54 @@ i64.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 40 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -7984,7 +8642,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort @@ -7999,40 +8657,26 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#clear (; 95 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 100 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -8042,27 +8686,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 48 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -8075,15 +8705,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 96 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 101 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 25 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -8109,7 +8739,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 97 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 102 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -8126,39 +8756,37 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - f32.load - local.get $1 - f32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + f32.load + local.get $1 + f32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 98 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#has (; 103 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) (local $2 f32) local.get $0 local.get $1 @@ -8174,7 +8802,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 99 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 104 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8231,64 +8859,62 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + f32.load + f32.store + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 f32.load - f32.store - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - f32.load - local.set $11 - local.get $11 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load - i32.store offset=8 - local.get $13 - local.get $8 - i32.store - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=8 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end + i32.add + local.set $6 br $continue|0 end end @@ -8296,25 +8922,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $13 local.get $9 i32.load - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $13 - else - local.get $13 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -8322,25 +8932,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $12 local.get $9 i32.load offset=8 - local.tee $13 - i32.ne - if (result i32) - local.get $13 - if - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -8349,8 +8943,12 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 100 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) + (func $~lib/map/Map#set (; 105 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) (local $3 f32) (local $4 i32) (local $5 i32) @@ -8407,6 +9005,7 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $6 local.get $6 block (result i32) @@ -8454,9 +9053,11 @@ local.get $7 local.get $5 i32.store + local.get $6 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 101 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#get (; 106 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) (local $2 f32) (local $3 i32) local.get $0 @@ -8479,11 +9080,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 102 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 107 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 103 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#delete (; 108 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) (local $2 f32) (local $3 i32) (local $4 i32) @@ -8557,7 +9158,7 @@ end i32.const 1 ) - (func $std/map/testNumeric (; 104 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 109 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 f32) i32.const 0 @@ -8572,56 +9173,54 @@ f32.lt i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.trunc_f32_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 10 - local.get $1 - i32.trunc_f32_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.trunc_f32_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 11 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.trunc_f32_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 11 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -8639,7 +9238,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort @@ -8654,72 +9253,70 @@ f32.lt i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 17 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.trunc_f32_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 17 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.trunc_f32_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.trunc_f32_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 20 - local.get $1 - i32.trunc_f32_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.trunc_f32_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 21 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.trunc_f32_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 21 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -8737,7 +9334,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort @@ -8752,53 +9349,51 @@ f32.lt i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 27 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.trunc_f32_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 30 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 27 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.trunc_f32_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -8816,7 +9411,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort @@ -8831,56 +9426,54 @@ f32.lt i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.trunc_f32_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 40 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.trunc_f32_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -8898,7 +9491,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort @@ -8913,40 +9506,26 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#clear (; 105 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 110 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -8956,27 +9535,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 64 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -8989,15 +9554,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 106 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 111 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 26 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -9023,7 +9588,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 107 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 112 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -9040,39 +9605,37 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - f64.load - local.get $1 - f64.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=12 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + f64.load + local.get $1 + f64.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=12 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 108 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#has (; 113 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 f64) local.get $0 local.get $1 @@ -9088,7 +9651,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 109 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 114 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9145,64 +9708,62 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + f64.load + f64.store + local.get $10 + local.get $9 + i32.load offset=8 + i32.store offset=8 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 f64.load - f64.store - local.get $10 - local.get $9 - i32.load offset=8 - i32.store offset=8 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - f64.load - local.set $11 - local.get $11 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load - i32.store offset=12 - local.get $13 - local.get $8 - i32.store - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 16 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=12 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end + i32.add + local.set $6 br $continue|0 end end @@ -9210,25 +9771,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $13 local.get $9 i32.load - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $13 - else - local.get $13 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -9236,25 +9781,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $12 local.get $9 i32.load offset=8 - local.tee $13 - i32.ne - if (result i32) - local.get $13 - if - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -9263,8 +9792,12 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/map/Map#set (; 110 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) + (func $~lib/map/Map#set (; 115 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) (local $3 f64) (local $4 i32) (local $5 i32) @@ -9321,6 +9854,7 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/purerc/__retain local.set $6 local.get $6 block (result i32) @@ -9368,9 +9902,11 @@ local.get $7 local.get $5 i32.store + local.get $6 + call $~lib/rt/purerc/__release end ) - (func $~lib/map/Map#get (; 111 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#get (; 116 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 f64) (local $3 i32) local.get $0 @@ -9393,11 +9929,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 112 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 117 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 113 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#delete (; 118 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 f64) (local $3 i32) (local $4 i32) @@ -9471,7 +10007,7 @@ end i32.const 1 ) - (func $std/map/testNumeric (; 114 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 119 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 f64) i32.const 0 @@ -9486,56 +10022,54 @@ f64.lt i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.trunc_f64_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 10 - local.get $1 - i32.trunc_f64_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.trunc_f64_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 11 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.trunc_f64_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 11 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f64.const 1 @@ -9553,7 +10087,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 13 i32.const 2 call $~lib/builtins/abort @@ -9568,72 +10102,70 @@ f64.lt i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 17 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.trunc_f64_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 17 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.trunc_f64_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.trunc_f64_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 20 - local.get $1 - i32.trunc_f64_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.trunc_f64_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 21 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.trunc_f64_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 21 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f64.const 1 @@ -9651,7 +10183,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 23 i32.const 2 call $~lib/builtins/abort @@ -9666,53 +10198,51 @@ f64.lt i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 27 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.trunc_f64_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 30 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 27 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.trunc_f64_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f64.const 1 @@ -9730,7 +10260,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 32 i32.const 2 call $~lib/builtins/abort @@ -9745,56 +10275,54 @@ f64.lt i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.trunc_f64_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 40 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.trunc_f64_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f64.const 1 @@ -9812,7 +10340,7 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 42 i32.const 2 call $~lib/builtins/abort @@ -9827,24 +10355,16 @@ i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 46 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $start:std/map (; 115 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (func $start:std/map (; 120 ;) (type $FUNCSIG$v) call $std/map/testNumeric call $std/map/testNumeric call $std/map/testNumeric @@ -9856,49 +10376,102 @@ call $std/map/testNumeric call $std/map/testNumeric ) - (func $~lib/runtime/runtime.instanceof (; 116 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $start (; 121 ;) (type $FUNCSIG$v) + call $start:std/map + ) + (func $~lib/rt/purerc/increment (; 122 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.sub + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 123 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 124 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 i32.load local.set $2 - global.get $~lib/runtime/RTTI_BASE - local.set $3 local.get $2 - if (result i32) - local.get $2 - local.get $3 - i32.load - i32.le_u - else - i32.const 0 - end + i32.const 1 + i32.and + i32.eqz + i32.eqz if - loop $continue|0 - local.get $2 - local.get $1 - i32.eq - if - i32.const 1 - return - end - local.get $3 - local.get $2 - i32.const 8 - i32.mul - i32.add - i32.load offset=4 - local.tee $2 - br_if $continue|0 - end + i32.const 0 + i32.const 128 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable end - i32.const 0 + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree ) - (func $~lib/runtime/runtime.flags (; 117 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/common/__typeinfo (; 125 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - global.get $~lib/runtime/RTTI_BASE + global.get $~lib/builtins/RTTI_BASE local.set $1 local.get $0 i32.eqz @@ -9910,183 +10483,1067 @@ i32.load i32.gt_u end - if (result i32) + if + i32.const 328 + i32.const 384 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort unreachable - else - local.get $1 - local.get $0 - i32.const 8 - i32.mul - i32.add - i32.load end - ) - (func $~lib/runtime/runtime.newObject (; 118 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - call $~lib/util/runtime/allocate local.get $1 - call $~lib/util/runtime/register - ) - (func $~lib/runtime/runtime.newString (; 119 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 1 - i32.shl - i32.const 16 - call $~lib/runtime/runtime.newObject + i32.const 8 + i32.mul + i32.add + i32.load ) - (func $~lib/runtime/runtime.newArrayBuffer (; 120 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 15 - call $~lib/runtime/runtime.newObject - ) - (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 121 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.sub - i32.load offset=4 - ) - (func $~lib/runtime/runtime.newArray (; 122 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/memory/memory.copy (; 126 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $0 - call $~lib/runtime/runtime.flags - local.set $2 - local.get $2 - i32.const 16 - i32.div_u - i32.const 31 - i32.and - local.set $3 - local.get $1 - i32.eqz - if - i32.const 0 - local.tee $4 - call $~lib/runtime/runtime.newArrayBuffer - local.set $1 - else + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 local.get $1 - call $~lib/arraybuffer/ArrayBuffer#get:byteLength local.set $4 - end - local.get $0 - i32.const 16 - call $~lib/runtime/runtime.newObject - local.set $5 - local.get $5 - local.tee $6 - local.get $1 - local.tee $7 - local.get $6 - i32.load - local.tee $8 - i32.ne - if (result i32) - local.get $8 - if - local.get $8 - local.get $6 - call $~lib/collector/dummy/__ref_unlink - end - local.get $7 - local.get $6 - call $~lib/collector/dummy/__ref_link - local.get $7 - else - local.get $7 - end - i32.store - local.get $5 - local.get $1 - i32.store offset=4 - local.get $5 - local.get $4 - i32.store offset=8 - local.get $5 - local.get $4 - local.get $3 - i32.shr_u - i32.store offset=12 - local.get $2 - i32.const 1024 - i32.and - if - local.get $1 - local.set $6 - local.get $6 + local.get $2 + local.set $3 + local.get $5 local.get $4 - i32.add - local.set $8 - block $break|0 - loop $continue|0 - local.get $6 - local.get $8 - i32.lt_u - if - block - local.get $6 - i32.load - local.set $7 - local.get $7 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and if - local.get $7 - local.get $5 - call $~lib/collector/dummy/__ref_link + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 end - local.get $6 - i32.const 4 - i32.add - local.set $6 end - br $continue|0 + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end end end end end - local.get $5 ) - (func $~lib/runtime/Root#constructor (; 123 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/purerc/growRoots (; 127 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 128 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 129 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz i32.eqz if i32.const 0 - call $~lib/util/runtime/allocate - i32.const 28 - call $~lib/util/runtime/register - local.set $0 + i32.const 272 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__retainRelease (; 130 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.ne + if + global.get $~lib/builtins/HEAP_BASE + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + local.get $2 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end end local.get $0 ) - (func $~lib/runtime/runtime.retain (; 124 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/purerc/__release (; 131 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 - global.get $~lib/runtime/ROOT - call $~lib/collector/dummy/__ref_link + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end ) - (func $~lib/runtime/runtime.release (; 125 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/purerc/markGray (; 132 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) local.get $0 - global.get $~lib/runtime/ROOT - call $~lib/collector/dummy/__ref_unlink + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end ) - (func $~lib/collector/dummy/__ref_collect (; 126 ;) (type $FUNCSIG$v) - nop - ) - (func $~lib/runtime/runtime.collect (; 127 ;) (type $FUNCSIG$v) - call $~lib/collector/dummy/__ref_collect - ) - (func $~lib/runtime/runtime#constructor (; 128 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - unreachable - ) - (func $start (; 129 ;) (type $FUNCSIG$v) - call $start:std/map + (func $~lib/rt/purerc/scanBlack (; 133 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and i32.const 0 - call $~lib/runtime/Root#constructor - global.set $~lib/runtime/ROOT + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members ) - (func $null (; 130 ;) (type $FUNCSIG$v) + (func $~lib/rt/purerc/scan (; 134 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 135 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 136 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/map/Map#__visit_impl (; 137 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 138 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 139 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 140 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 141 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 142 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 143 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 144 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 145 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/map/Map#__visit_impl (; 146 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/builtins/__visit_members (; 147 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$28 + block $switch$1$case$27 + block $switch$1$case$26 + block $switch$1$case$25 + block $switch$1$case$24 + block $switch$1$case$23 + block $switch$1$case$22 + block $switch$1$case$21 + block $switch$1$case$20 + block $switch$1$case$19 + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$19 $switch$1$case$20 $switch$1$case$21 $switch$1$case$22 $switch$1$case$23 $switch$1$case$24 $switch$1$case$25 $switch$1$case$26 $switch$1$case$27 $switch$1$case$28 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 148 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index 906f5ddc..c767c1ac 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -60,14 +60,11 @@ (import "Math" "tanh" (func $~lib/bindings/Math/tanh (param f64) (result f64))) (import "Math" "trunc" (func $~lib/bindings/Math/trunc (param f64) (result f64))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\16") - (data (i32.const 24) "s\00t\00d\00/\00m\00a\00t\00h\00.\00t\00s") - (data (i32.const 48) "\0f\00\00\00 ") - (data (i32.const 64) ")\15DNn\83\f9\a2\c0\dd4\f5\d1W\'\fcA\90C<\99\95b\dba\c5\bb\de\abcQ\fe") - (data (i32.const 96) "\11\00\00\00\10") - (data (i32.const 112) "@\00\00\00@\00\00\00 \00\00\00\04") - (data (i32.const 128) "\10\00\00\00\18") - (data (i32.const 144) "~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s") + (data (i32.const 8) "\16\00\00\00\01\00\00\00\10\00\00\00\16\00\00\00s\00t\00d\00/\00m\00a\00t\00h\00.\00t\00s") + (data (i32.const 48) " \00\00\00\01\00\00\00\0f\00\00\00 \00\00\00)\15DNn\83\f9\a2\c0\dd4\f5\d1W\'\fcA\90C<\99\95b\dba\c5\bb\de\abcQ\fe") + (data (i32.const 96) "\10\00\00\00\01\00\00\00\11\00\00\00\10\00\00\00@\00\00\00@\00\00\00 \00\00\00\04") + (data (i32.const 128) "\18\00\00\00\01\00\00\00\10\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s") + (data (i32.const 168) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00P\00R\00N\00G\00 \00m\00u\00s\00t\00 \00b\00e\00 \00s\00e\00e\00d\00e\00d\00.") (global $~lib/math/rempio2f_y (mut f64) (f64.const 0)) (global $~lib/math/random_seeded (mut i32) (i32.const 0)) (global $~lib/math/random_state0_64 (mut i64) (i64.const 0)) @@ -8299,7 +8296,7 @@ global.get $~lib/math/random_seeded i32.eqz if - i32.const 0 + i32.const 184 i32.const 144 i32.const 1030 i32.const 24 @@ -8346,7 +8343,7 @@ global.get $~lib/math/random_seeded i32.eqz if - i32.const 0 + i32.const 184 i32.const 144 i32.const 2312 i32.const 24 diff --git a/tests/compiler/std/math.untouched.wat b/tests/compiler/std/math.untouched.wat index ed77e58b..48ca0ad9 100644 --- a/tests/compiler/std/math.untouched.wat +++ b/tests/compiler/std/math.untouched.wat @@ -62,10 +62,11 @@ (import "Math" "tanh" (func $~lib/bindings/Math/tanh (param f64) (result f64))) (import "Math" "trunc" (func $~lib/bindings/Math/trunc (param f64) (result f64))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\16\00\00\00\00\00\00\00\00\00\00\00s\00t\00d\00/\00m\00a\00t\00h\00.\00t\00s\00") - (data (i32.const 48) "\0f\00\00\00 \00\00\00\00\00\00\00\00\00\00\00)\15DNn\83\f9\a2\c0\dd4\f5\d1W\'\fcA\90C<\99\95b\dba\c5\bb\de\abcQ\fe") - (data (i32.const 96) "\11\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00@\00\00\00@\00\00\00 \00\00\00\04\00\00\00") - (data (i32.const 128) "\10\00\00\00\18\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00") + (data (i32.const 8) "\16\00\00\00\01\00\00\00\10\00\00\00\16\00\00\00s\00t\00d\00/\00m\00a\00t\00h\00.\00t\00s\00") + (data (i32.const 48) " \00\00\00\01\00\00\00\0f\00\00\00 \00\00\00)\15DNn\83\f9\a2\c0\dd4\f5\d1W\'\fcA\90C<\99\95b\dba\c5\bb\de\abcQ\fe") + (data (i32.const 96) "\10\00\00\00\01\00\00\00\11\00\00\00\10\00\00\00@\00\00\00@\00\00\00 \00\00\00\04\00\00\00") + (data (i32.const 128) "\18\00\00\00\01\00\00\00\10\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00") + (data (i32.const 168) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00P\00R\00N\00G\00 \00m\00u\00s\00t\00 \00b\00e\00 \00s\00e\00e\00d\00e\00d\00.\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $std/math/js i32 (i32.const 1)) @@ -252,7 +253,7 @@ local.get $1 f64.eq if - block $~lib/math/NativeMath.signbit|inlined.2 (result i32) + block $~lib/math/NativeMath.signbit|inlined.0 (result i32) local.get $0 local.set $3 local.get $3 @@ -267,7 +268,7 @@ end i32.const 0 i32.ne - block $~lib/math/NativeMath.signbit|inlined.3 (result i32) + block $~lib/math/NativeMath.signbit|inlined.1 (result i32) local.get $1 local.set $3 local.get $3 @@ -491,7 +492,7 @@ local.get $1 f32.eq if - block $~lib/math/NativeMathf.signbit|inlined.2 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.0 (result i32) local.get $0 local.set $3 local.get $3 @@ -505,7 +506,7 @@ end i32.const 0 i32.ne - block $~lib/math/NativeMathf.signbit|inlined.3 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.1 (result i32) local.get $1 local.set $3 local.get $3 @@ -1104,9 +1105,7 @@ local.get $2 i32.const 1 i32.shl - i32.const 1017118720 - i32.const 1 - i32.shl + i32.const 2034237440 i32.lt_u if local.get $0 @@ -1504,9 +1503,7 @@ i64.and local.set $1 local.get $1 - i64.const 1023 - i64.const 1 - i64.add + i64.const 1024 i64.lt_u if local.get $0 @@ -1531,9 +1528,7 @@ return end local.get $1 - i64.const 1023 - i64.const 26 - i64.add + i64.const 1049 i64.lt_u if f64.const 2 @@ -1640,9 +1635,7 @@ local.get $1 i32.const 1 i32.shl - i32.const 864026624 - i32.const 1 - i32.shl + i32.const 1728053248 i32.lt_u if local.get $0 @@ -1973,11 +1966,7 @@ i32.and local.set $2 local.get $2 - i32.const 1065353216 - i32.const 1 - i32.const 23 - i32.shl - i32.add + i32.const 1073741824 i32.lt_u if local.get $0 @@ -1996,11 +1985,7 @@ return end local.get $2 - i32.const 1065353216 - i32.const 12 - i32.const 23 - i32.shl - i32.add + i32.const 1166016512 i32.lt_u if f32.const 2 @@ -2335,9 +2320,7 @@ f64.reinterpret_i64 local.set $3 local.get $2 - i64.const 1023 - i64.const 26 - i64.add + i64.const 1049 i64.ge_u if local.get $3 @@ -2347,9 +2330,7 @@ local.set $3 else local.get $2 - i64.const 1023 - i64.const 1 - i64.add + i64.const 1024 i64.ge_u if f64.const 2 @@ -2370,9 +2351,7 @@ local.set $3 else local.get $2 - i64.const 1023 - i64.const 26 - i64.sub + i64.const 997 i64.ge_u if local.get $3 @@ -2434,11 +2413,7 @@ f32.reinterpret_i32 local.set $2 local.get $1 - i32.const 1065353216 - i32.const 12 - i32.const 23 - i32.shl - i32.add + i32.const 1166016512 i32.ge_u if local.get $2 @@ -2448,11 +2423,7 @@ local.set $2 else local.get $1 - i32.const 1065353216 - i32.const 1 - i32.const 23 - i32.shl - i32.add + i32.const 1073741824 i32.ge_u if f32.const 2 @@ -2473,11 +2444,7 @@ local.set $2 else local.get $1 - i32.const 1065353216 - i32.const 12 - i32.const 23 - i32.shl - i32.sub + i32.const 964689920 i32.ge_u if local.get $2 @@ -3087,15 +3054,11 @@ f64.reinterpret_i64 local.set $4 local.get $2 - i64.const 1023 - i64.const 1 - i64.sub + i64.const 1022 i64.lt_u if local.get $2 - i64.const 1023 - i64.const 32 - i64.sub + i64.const 991 i64.ge_u if f64.const 0.5 @@ -3171,19 +3134,11 @@ f32.reinterpret_i32 local.set $2 local.get $1 - i32.const 1065353216 - i32.const 1 - i32.const 23 - i32.shl - i32.sub + i32.const 1056964608 i32.lt_u if local.get $1 - i32.const 1065353216 - i32.const 32 - i32.const 23 - i32.shl - i32.sub + i32.const 796917760 i32.ge_u if f32.const 0.5 @@ -3468,9 +3423,7 @@ end end local.get $3 - i32.const 64 - i32.const 20 - i32.shl + i32.const 67108864 i32.add local.get $5 i32.lt_u @@ -3502,9 +3455,7 @@ i32.and if (result i32) local.get $5 - i32.const 64 - i32.const 20 - i32.shl + i32.const 67108864 i32.add local.get $3 i32.lt_u @@ -3811,9 +3762,7 @@ end end local.get $2 - i32.const 26 - i32.const 23 - i32.shl + i32.const 218103808 i32.add local.get $3 i32.lt_u @@ -3845,9 +3794,7 @@ i32.and if (result i32) local.get $3 - i32.const 26 - i32.const 23 - i32.shl + i32.const 218103808 i32.add local.get $2 i32.lt_u @@ -5410,11 +5357,7 @@ i32.lt_u if local.get $2 - i32.const 1072693248 - i32.const 26 - i32.const 20 - i32.shl - i32.sub + i32.const 1045430272 i32.lt_u if f64.const 1 @@ -5959,11 +5902,7 @@ i32.lt_u if local.get $1 - i32.const 1065353216 - i32.const 12 - i32.const 23 - i32.shl - i32.sub + i32.const 964689920 i32.lt_u if f32.const 1 @@ -6227,9 +6166,7 @@ f64.const 1 local.set $7 local.get $5 - i32.const 1023 - i32.const 510 - i32.add + i32.const 1533 i32.gt_s if f64.const 5260135901548373507240989e186 @@ -6244,9 +6181,7 @@ local.set $1 else local.get $6 - i32.const 1023 - i32.const 450 - i32.sub + i32.const 573 i32.lt_s if f64.const 1.90109156629516e-211 @@ -6399,18 +6334,14 @@ f32.reinterpret_i32 local.set $1 local.get $3 - i32.const 255 - i32.const 23 - i32.shl + i32.const 2139095040 i32.eq if local.get $1 return end local.get $2 - i32.const 255 - i32.const 23 - i32.shl + i32.const 2139095040 i32.ge_u if (result i32) i32.const 1 @@ -6425,9 +6356,7 @@ local.get $2 local.get $3 i32.sub - i32.const 25 - i32.const 23 - i32.shl + i32.const 209715200 i32.ge_u end if @@ -6439,11 +6368,7 @@ f32.const 1 local.set $5 local.get $2 - i32.const 127 - i32.const 60 - i32.add - i32.const 23 - i32.shl + i32.const 1568669696 i32.ge_u if f32.const 1237940039285380274899124e3 @@ -6458,11 +6383,7 @@ local.set $1 else local.get $3 - i32.const 127 - i32.const 60 - i32.sub - i32.const 23 - i32.shl + i32.const 562036736 i32.lt_u if f32.const 8.077935669463161e-28 @@ -7792,34 +7713,32 @@ local.get $5 i64.gt_s if - block + local.get $2 + local.get $3 + i64.ge_u + if local.get $2 local.get $3 - i64.ge_u + i64.eq if - local.get $2 - local.get $3 - i64.eq - if - f64.const 0 - local.get $0 - f64.mul - return - end - local.get $2 - local.get $3 - i64.sub - local.set $2 + f64.const 0 + local.get $0 + f64.mul + return end local.get $2 - i64.const 1 - i64.shl - local.set $2 - local.get $4 - i64.const 1 + local.get $3 i64.sub - local.set $4 + local.set $2 end + local.get $2 + i64.const 1 + i64.shl + local.set $2 + local.get $4 + i64.const 1 + i64.sub + local.set $4 br $continue|0 end end @@ -8068,34 +7987,32 @@ local.get $5 i32.gt_s if - block + local.get $2 + local.get $3 + i32.ge_u + if local.get $2 local.get $3 - i32.ge_u + i32.eq if - local.get $2 - local.get $3 - i32.eq - if - f32.const 0 - local.get $0 - f32.mul - return - end - local.get $2 - local.get $3 - i32.sub - local.set $2 + f32.const 0 + local.get $0 + f32.mul + return end local.get $2 - i32.const 1 - i32.shl - local.set $2 - local.get $4 - i32.const 1 + local.get $3 i32.sub - local.set $4 + local.set $2 end + local.get $2 + i32.const 1 + i32.shl + local.set $2 + local.get $4 + i32.const 1 + i32.sub + local.set $4 br $continue|0 end end @@ -10324,7 +10241,7 @@ global.get $~lib/math/random_seeded i32.eqz if - i32.const 0 + i32.const 184 i32.const 144 i32.const 1030 i32.const 24 @@ -10381,7 +10298,7 @@ global.get $~lib/math/random_seeded i32.eqz if - i32.const 0 + i32.const 184 i32.const 144 i32.const 2312 i32.const 24 @@ -10695,33 +10612,31 @@ local.get $5 i64.gt_s if - block + local.get $8 + local.get $3 + i64.ge_u + if local.get $8 local.get $3 - i64.ge_u - if - local.get $8 - local.get $3 - i64.sub - local.set $8 - local.get $9 - i32.const 1 - i32.add - local.set $9 - end - local.get $8 - i64.const 1 - i64.shl + i64.sub local.set $8 local.get $9 i32.const 1 - i32.shl + i32.add local.set $9 - local.get $4 - i64.const 1 - i64.sub - local.set $4 end + local.get $8 + i64.const 1 + i64.shl + local.set $8 + local.get $9 + i32.const 1 + i32.shl + local.set $9 + local.get $4 + i64.const 1 + i64.sub + local.set $4 br $continue|1 end end @@ -11018,33 +10933,31 @@ local.get $5 i32.gt_s if - block + local.get $7 + local.get $3 + i32.ge_u + if local.get $7 local.get $3 - i32.ge_u - if - local.get $7 - local.get $3 - i32.sub - local.set $7 - local.get $8 - i32.const 1 - i32.add - local.set $8 - end - local.get $7 - i32.const 1 - i32.shl + i32.sub local.set $7 local.get $8 i32.const 1 - i32.shl + i32.add local.set $8 - local.get $4 - i32.const 1 - i32.sub - local.set $4 end + local.get $7 + i32.const 1 + i32.shl + local.set $7 + local.get $8 + i32.const 1 + i32.shl + local.set $8 + local.get $4 + i32.const 1 + i32.sub + local.set $4 br $continue|1 end end @@ -11853,11 +11766,7 @@ i32.lt_u if local.get $3 - i32.const 1072693248 - i32.const 26 - i32.const 20 - i32.shl - i32.sub + i32.const 1045430272 i32.lt_u if local.get $0 @@ -11975,11 +11884,7 @@ i32.lt_u if local.get $1 - i32.const 1065353216 - i32.const 12 - i32.const 23 - i32.shl - i32.sub + i32.const 964689920 i32.lt_u if local.get $0 @@ -13284,25 +13189,23 @@ i32.const 0 i32.gt_s if - block - local.get $1 - i32.const 1 - i32.and - if - local.get $2 - local.get $0 - i64.mul - local.set $2 - end - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 + local.get $1 + i32.const 1 + i32.and + if + local.get $2 local.get $0 i64.mul - local.set $0 + local.set $2 end + local.get $1 + i32.const 1 + i32.shr_s + local.set $1 + local.get $0 + local.get $0 + i64.mul + local.set $0 br $continue|2 end end @@ -13328,25 +13231,23 @@ loop $continue|0 local.get $1 if - block - local.get $3 - local.get $0 - f32.const 1 - local.get $1 - i32.const 1 - i32.and - select - f32.mul - local.set $3 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - f32.mul - local.set $0 - end + local.get $3 + local.get $0 + f32.const 1 + local.get $1 + i32.const 1 + i32.and + select + f32.mul + local.set $3 + local.get $1 + i32.const 1 + i32.shr_s + local.set $1 + local.get $0 + local.get $0 + f32.mul + local.set $0 br $continue|0 end end @@ -13379,25 +13280,23 @@ loop $continue|0 local.get $1 if - block - local.get $3 - local.get $0 - f64.const 1 - local.get $1 - i32.const 1 - i32.and - select - f64.mul - local.set $3 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - f64.mul - local.set $0 - end + local.get $3 + local.get $0 + f64.const 1 + local.get $1 + i32.const 1 + i32.and + select + f64.mul + local.set $3 + local.get $1 + i32.const 1 + i32.shr_s + local.set $1 + local.get $0 + local.get $0 + f64.mul + local.set $0 br $continue|0 end end @@ -37696,28 +37595,26 @@ f64.lt i32.eqz br_if $break|0 - block - call $~lib/math/NativeMath.random - local.set $1 + call $~lib/math/NativeMath.random + local.set $1 + local.get $1 + f64.const 0 + f64.ge + if (result i32) local.get $1 - f64.const 0 - f64.ge - if (result i32) - local.get $1 - f64.const 1 - f64.lt - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 24 - i32.const 2579 - i32.const 2 - call $~lib/builtins/abort - unreachable - end + f64.const 1 + f64.lt + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 2579 + i32.const 2 + call $~lib/builtins/abort + unreachable end local.get $0 i32.const 1 @@ -37745,28 +37642,26 @@ f64.lt i32.eqz br_if $break|1 - block - call $~lib/math/NativeMathf.random - local.set $3 + call $~lib/math/NativeMathf.random + local.set $3 + local.get $3 + f32.const 0 + f32.ge + if (result i32) local.get $3 - f32.const 0 - f32.ge - if (result i32) - local.get $3 - f32.const 1 - f32.lt - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 24 - i32.const 2587 - i32.const 2 - call $~lib/builtins/abort - unreachable - end + f32.const 1 + f32.lt + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 2587 + i32.const 2 + call $~lib/builtins/abort + unreachable end local.get $0 i32.const 1 @@ -38791,7 +38686,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.4 (result i32) + block $~lib/math/NativeMath.signbit|inlined.2 (result i32) f64.const 0 local.set $1 local.get $1 @@ -38817,7 +38712,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.5 (result i32) + block $~lib/math/NativeMath.signbit|inlined.3 (result i32) f64.const -0 local.set $1 local.get $1 @@ -38843,7 +38738,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.6 (result i32) + block $~lib/math/NativeMath.signbit|inlined.4 (result i32) f64.const 1 local.set $1 local.get $1 @@ -38869,7 +38764,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.7 (result i32) + block $~lib/math/NativeMath.signbit|inlined.5 (result i32) f64.const -1 local.set $1 local.get $1 @@ -38895,7 +38790,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.8 (result i32) + block $~lib/math/NativeMath.signbit|inlined.6 (result i32) f64.const nan:0x8000000000000 local.set $1 local.get $1 @@ -38921,7 +38816,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.9 (result i32) + block $~lib/math/NativeMath.signbit|inlined.7 (result i32) f64.const nan:0x8000000000000 f64.neg local.set $1 @@ -38948,7 +38843,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.10 (result i32) + block $~lib/math/NativeMath.signbit|inlined.8 (result i32) f64.const inf local.set $1 local.get $1 @@ -38974,7 +38869,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.11 (result i32) + block $~lib/math/NativeMath.signbit|inlined.9 (result i32) f64.const inf f64.neg local.set $1 @@ -39001,7 +38896,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.4 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.2 (result i32) f32.const 0 local.set $3 local.get $3 @@ -39026,7 +38921,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.5 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.3 (result i32) f32.const -0 local.set $3 local.get $3 @@ -39051,7 +38946,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.6 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.4 (result i32) f32.const 1 local.set $3 local.get $3 @@ -39076,7 +38971,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.7 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.5 (result i32) f32.const -1 local.set $3 local.get $3 @@ -39101,7 +38996,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.8 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.6 (result i32) f32.const nan:0x400000 local.set $3 local.get $3 @@ -39126,7 +39021,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.9 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.7 (result i32) f32.const nan:0x400000 f32.neg local.set $3 @@ -39152,7 +39047,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.10 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.8 (result i32) f32.const inf local.set $3 local.get $3 @@ -39177,7 +39072,7 @@ call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.11 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.9 (result i32) f32.const inf f32.neg local.set $3 diff --git a/tests/compiler/std/mod.optimized.wat b/tests/compiler/std/mod.optimized.wat index e69838d6..710fc46e 100644 --- a/tests/compiler/std/mod.optimized.wat +++ b/tests/compiler/std/mod.optimized.wat @@ -1,39 +1,52 @@ (module (type $FUNCSIG$iddd (func (param f64 f64 f64) (result i32))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$idd (func (param f64 f64) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$ifff (func (param f32 f32 f32) (result i32))) (type $FUNCSIG$fff (func (param f32 f32) (result f32))) + (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$iff (func (param f32 f32) (result i32))) (type $FUNCSIG$v (func)) (import "math" "mod" (func $std/mod/mod (param f64 f64) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\14") - (data (i32.const 24) "s\00t\00d\00/\00m\00o\00d\00.\00t\00s") + (data (i32.const 8) "\14\00\00\00\01\00\00\00\10\00\00\00\14\00\00\00s\00t\00d\00/\00m\00o\00d\00.\00t\00s\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $std/mod/js i32 (i32.const 1)) (export "memory" (memory $0)) (export "mod" (func $std/mod/mod)) (start $start) - (func $~lib/math/NativeMath.mod (; 2 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/builtins/isNaN (; 2 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/math/NativeMath.mod (; 3 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) (local $5 i64) (local $6 i64) (local $7 i64) - (local $8 i64) + (local $8 f64) + (local $9 i64) + (local $10 i64) local.get $0 i64.reinterpret_f64 - local.tee $2 + local.set $2 + local.get $1 + i64.reinterpret_f64 + local.set $3 + local.get $2 i64.const 52 i64.shr_u i64.const 2047 i64.and local.set $4 - local.get $1 - i64.reinterpret_f64 - local.tee $3 + local.get $3 i64.const 52 i64.shr_u i64.const 2047 @@ -42,11 +55,12 @@ local.get $2 i64.const 63 i64.shr_u - local.set $7 + local.set $6 local.get $3 i64.const 1 i64.shl - local.tee $6 + local.set $7 + local.get $7 i64.const 0 i64.eq if (result i32) @@ -60,81 +74,103 @@ i32.const 1 else local.get $1 - local.get $1 - f64.ne + call $~lib/builtins/isNaN end if local.get $0 local.get $1 f64.mul - local.tee $0 - local.get $0 + local.set $8 + local.get $8 + local.get $8 f64.div return end - block $folding-inner0 - local.get $2 - i64.const 1 - i64.shl - local.tee $8 - local.get $6 - i64.le_u + local.get $2 + i64.const 1 + i64.shl + local.set $9 + local.get $9 + local.get $7 + i64.le_u + if + local.get $9 + local.get $7 + i64.eq if - local.get $6 - local.get $8 - i64.eq - br_if $folding-inner0 + f64.const 0 local.get $0 + f64.mul return end + local.get $0 + return + end + local.get $4 + i64.eqz + if local.get $4 - i64.eqz - if (result i64) - local.get $2 - i64.const 0 - local.get $4 - local.get $2 - i64.const 12 - i64.shl - i64.clz - i64.sub - local.tee $4 - i64.sub - i64.const 1 - i64.add - i64.shl - else - local.get $2 - i64.const 4503599627370495 - i64.and - i64.const 4503599627370496 - i64.or - end + local.get $2 + i64.const 12 + i64.shl + i64.clz + i64.sub + local.set $4 + local.get $2 + i64.const 0 + local.get $4 + i64.sub + i64.const 1 + i64.add + i64.shl local.set $2 + else + local.get $2 + i64.const -1 + i64.const 12 + i64.shr_u + i64.and + local.set $2 + local.get $2 + i64.const 1 + i64.const 52 + i64.shl + i64.or + local.set $2 + end + local.get $5 + i64.eqz + if local.get $5 - i64.eqz - if (result i64) - local.get $3 - i64.const 0 - local.get $5 - local.get $3 - i64.const 12 - i64.shl - i64.clz - i64.sub - local.tee $5 - i64.sub - i64.const 1 - i64.add - i64.shl - else - local.get $3 - i64.const 4503599627370495 - i64.and - i64.const 4503599627370496 - i64.or - end + local.get $3 + i64.const 12 + i64.shl + i64.clz + i64.sub + local.set $5 + local.get $3 + i64.const 0 + local.get $5 + i64.sub + i64.const 1 + i64.add + i64.shl local.set $3 + else + local.get $3 + i64.const -1 + i64.const 12 + i64.shr_u + i64.and + local.set $3 + local.get $3 + i64.const 1 + i64.const 52 + i64.shl + i64.or + local.set $3 + end + block $break|0 loop $continue|0 local.get $4 local.get $5 @@ -147,7 +183,12 @@ local.get $2 local.get $3 i64.eq - br_if $folding-inner0 + if + f64.const 0 + local.get $0 + f64.mul + return + end local.get $2 local.get $3 i64.sub @@ -164,76 +205,87 @@ br $continue|0 end end + end + local.get $2 + local.get $3 + i64.ge_u + if local.get $2 local.get $3 - i64.ge_u + i64.eq if - local.get $2 - local.get $3 - i64.eq - br_if $folding-inner0 - local.get $2 - local.get $3 - i64.sub - local.set $2 + f64.const 0 + local.get $0 + f64.mul + return end local.get $2 - local.get $2 - i64.const 11 - i64.shl - i64.clz - local.tee $3 - i64.shl - local.set $2 - local.get $4 local.get $3 i64.sub - local.tee $3 - i64.const 0 - i64.gt_s - if (result i64) - local.get $2 - i64.const 4503599627370496 - i64.sub - local.get $3 - i64.const 52 - i64.shl - i64.or - else - local.get $2 - i64.const 0 - local.get $3 - i64.sub - i64.const 1 - i64.add - i64.shr_u - end - local.get $7 - i64.const 63 + local.set $2 + end + local.get $2 + i64.const 11 + i64.shl + i64.clz + local.set $10 + local.get $4 + local.get $10 + i64.sub + local.set $4 + local.get $2 + local.get $10 + i64.shl + local.set $2 + local.get $4 + i64.const 0 + i64.gt_s + if + local.get $2 + i64.const 1 + i64.const 52 + i64.shl + i64.sub + local.set $2 + local.get $2 + local.get $4 + i64.const 52 i64.shl i64.or - f64.reinterpret_i64 - return + local.set $2 + else + local.get $2 + i64.const 0 + local.get $4 + i64.sub + i64.const 1 + i64.add + i64.shr_u + local.set $2 end - f64.const 0 - local.get $0 - f64.mul + local.get $2 + local.get $6 + i64.const 63 + i64.shl + i64.or + local.set $2 + local.get $2 + f64.reinterpret_i64 ) - (func $std/mod/check (; 3 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $std/mod/check (; 4 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $1 - local.get $1 - f64.ne + call $~lib/builtins/isNaN if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN return end local.get $1 f64.const 0 f64.eq if - f64.const 1 + i32.const 1 + f64.convert_i32_u local.get $1 f64.div f64.const 1 @@ -246,41 +298,56 @@ local.get $1 f64.eq ) - (func $std/mod/test_fmod (; 4 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/mod/test_fmod (; 5 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.mod local.get $2 call $std/mod/check if (result i32) - local.get $0 - local.get $1 - call $std/mod/mod - local.get $2 - call $std/mod/check + global.get $std/mod/js + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + call $std/mod/mod + local.get $2 + call $std/mod/check + end else i32.const 0 end ) - (func $~lib/math/NativeMathf.mod (; 5 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/builtins/isNaN (; 6 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/math/NativeMathf.mod (; 7 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) + (local $8 f32) + (local $9 i32) + (local $10 i32) local.get $0 i32.reinterpret_f32 - local.tee $2 + local.set $2 + local.get $1 + i32.reinterpret_f32 + local.set $3 + local.get $2 i32.const 23 i32.shr_u i32.const 255 i32.and local.set $4 - local.get $1 - i32.reinterpret_f32 - local.tee $3 + local.get $3 i32.const 23 i32.shr_u i32.const 255 @@ -289,91 +356,122 @@ local.get $2 i32.const -2147483648 i32.and - local.set $7 + local.set $6 local.get $3 i32.const 1 i32.shl - local.tee $6 + local.set $7 + local.get $7 + i32.const 0 + i32.eq if (result i32) + i32.const 1 + else local.get $4 i32.const 255 i32.eq - else - i32.const 1 end if (result i32) i32.const 1 else local.get $1 - local.get $1 - f32.ne + call $~lib/builtins/isNaN end if local.get $0 local.get $1 f32.mul - local.tee $0 - local.get $0 + local.set $8 + local.get $8 + local.get $8 f32.div return end - block $folding-inner0 - local.get $2 - i32.const 1 - i32.shl - local.tee $8 - local.get $6 - i32.le_u + local.get $2 + i32.const 1 + i32.shl + local.set $9 + local.get $9 + local.get $7 + i32.le_u + if + local.get $9 + local.get $7 + i32.eq if - local.get $6 - local.get $8 - i32.eq - br_if $folding-inner0 + f32.const 0 local.get $0 + f32.mul return end + local.get $0 + return + end + local.get $4 + i32.eqz + if local.get $4 - if (result i32) - local.get $2 - i32.const 8388607 - i32.and - i32.const 8388608 - i32.or - else - local.get $2 - i32.const 1 - local.get $4 - local.get $2 - i32.const 9 - i32.shl - i32.clz - i32.sub - local.tee $4 - i32.sub - i32.shl - end + local.get $2 + i32.const 9 + i32.shl + i32.clz + i32.sub + local.set $4 + local.get $2 + i32.const 0 + local.get $4 + i32.sub + i32.const 1 + i32.add + i32.shl local.set $2 + else + local.get $2 + i32.const -1 + i32.const 9 + i32.shr_u + i32.and + local.set $2 + local.get $2 + i32.const 1 + i32.const 23 + i32.shl + i32.or + local.set $2 + end + local.get $5 + i32.eqz + if local.get $5 - if (result i32) - local.get $3 - i32.const 8388607 - i32.and - i32.const 8388608 - i32.or - else - local.get $3 - i32.const 1 - local.get $5 - local.get $3 - i32.const 9 - i32.shl - i32.clz - i32.sub - local.tee $5 - i32.sub - i32.shl - end + local.get $3 + i32.const 9 + i32.shl + i32.clz + i32.sub + local.set $5 + local.get $3 + i32.const 0 + local.get $5 + i32.sub + i32.const 1 + i32.add + i32.shl local.set $3 + else + local.get $3 + i32.const -1 + i32.const 9 + i32.shr_u + i32.and + local.set $3 + local.get $3 + i32.const 1 + i32.const 23 + i32.shl + i32.or + local.set $3 + end + block $break|0 loop $continue|0 local.get $4 local.get $5 @@ -386,7 +484,12 @@ local.get $2 local.get $3 i32.eq - br_if $folding-inner0 + if + f32.const 0 + local.get $0 + f32.mul + return + end local.get $2 local.get $3 i32.sub @@ -403,72 +506,85 @@ br $continue|0 end end + end + local.get $2 + local.get $3 + i32.ge_u + if local.get $2 local.get $3 - i32.ge_u + i32.eq if - local.get $2 - local.get $3 - i32.eq - br_if $folding-inner0 - local.get $2 - local.get $3 - i32.sub - local.set $2 + f32.const 0 + local.get $0 + f32.mul + return end local.get $2 - local.get $2 - i32.const 8 - i32.shl - i32.clz - local.tee $3 - i32.shl - local.set $2 - local.get $4 local.get $3 i32.sub - local.tee $3 - i32.const 0 - i32.gt_s - if (result i32) - local.get $2 - i32.const 8388608 - i32.sub - local.get $3 - i32.const 23 - i32.shl - i32.or - else - local.get $2 - i32.const 1 - local.get $3 - i32.sub - i32.shr_u - end - local.get $7 - i32.or - f32.reinterpret_i32 - return + local.set $2 end - f32.const 0 - local.get $0 - f32.mul + local.get $2 + i32.const 8 + i32.shl + i32.clz + local.set $10 + local.get $4 + local.get $10 + i32.sub + local.set $4 + local.get $2 + local.get $10 + i32.shl + local.set $2 + local.get $4 + i32.const 0 + i32.gt_s + if + local.get $2 + i32.const 1 + i32.const 23 + i32.shl + i32.sub + local.set $2 + local.get $2 + local.get $4 + i32.const 23 + i32.shl + i32.or + local.set $2 + else + local.get $2 + i32.const 0 + local.get $4 + i32.sub + i32.const 1 + i32.add + i32.shr_u + local.set $2 + end + local.get $2 + local.get $6 + i32.or + local.set $2 + local.get $2 + f32.reinterpret_i32 ) - (func $std/mod/check (; 6 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/mod/check (; 8 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $1 - local.get $1 - f32.ne + call $~lib/builtins/isNaN if local.get $0 - local.get $0 - f32.ne + call $~lib/builtins/isNaN return end local.get $1 f32.const 0 f32.eq if - f32.const 1 + i32.const 1 + f32.convert_i32_u local.get $1 f32.div f32.const 1 @@ -481,14 +597,14 @@ local.get $1 f32.eq ) - (func $std/mod/test_fmodf (; 7 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/mod/test_fmodf (; 9 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.mod local.get $2 call $std/mod/check ) - (func $start:std/mod (; 8 ;) (type $FUNCSIG$v) + (func $start:std/mod (; 10 ;) (type $FUNCSIG$v) f64.const 3 f64.const 2 f64.const 1 @@ -1166,7 +1282,8 @@ unreachable end f64.const 0 - f64.const -inf + f64.const inf + f64.neg f64.const 0 call $std/mod/test_fmod i32.eqz @@ -1179,7 +1296,8 @@ unreachable end f64.const -0 - f64.const -inf + f64.const inf + f64.neg f64.const -0 call $std/mod/test_fmod i32.eqz @@ -1218,7 +1336,8 @@ unreachable end f64.const 1 - f64.const -inf + f64.const inf + f64.neg f64.const 1 call $std/mod/test_fmod i32.eqz @@ -1231,7 +1350,8 @@ unreachable end f64.const -1 - f64.const -inf + f64.const inf + f64.neg f64.const -1 call $std/mod/test_fmod i32.eqz @@ -1269,7 +1389,8 @@ call $~lib/builtins/abort unreachable end - f64.const -inf + f64.const inf + f64.neg f64.const 0 f64.const nan:0x8000000000000 call $std/mod/test_fmod @@ -1282,7 +1403,8 @@ call $~lib/builtins/abort unreachable end - f64.const -inf + f64.const inf + f64.neg f64.const -0 f64.const nan:0x8000000000000 call $std/mod/test_fmod @@ -1321,7 +1443,8 @@ call $~lib/builtins/abort unreachable end - f64.const -inf + f64.const inf + f64.neg f64.const 1 f64.const nan:0x8000000000000 call $std/mod/test_fmod @@ -1334,7 +1457,8 @@ call $~lib/builtins/abort unreachable end - f64.const -inf + f64.const inf + f64.neg f64.const -1 f64.const nan:0x8000000000000 call $std/mod/test_fmod @@ -1360,7 +1484,8 @@ call $~lib/builtins/abort unreachable end - f64.const -inf + f64.const inf + f64.neg f64.const inf f64.const nan:0x8000000000000 call $std/mod/test_fmod @@ -1374,7 +1499,8 @@ unreachable end f64.const inf - f64.const -inf + f64.const inf + f64.neg f64.const nan:0x8000000000000 call $std/mod/test_fmod i32.eqz @@ -1386,8 +1512,10 @@ call $~lib/builtins/abort unreachable end - f64.const -inf - f64.const -inf + f64.const inf + f64.neg + f64.const inf + f64.neg f64.const nan:0x8000000000000 call $std/mod/test_fmod i32.eqz @@ -1412,7 +1540,8 @@ call $~lib/builtins/abort unreachable end - f64.const -inf + f64.const inf + f64.neg f64.const nan:0x8000000000000 f64.const nan:0x8000000000000 call $std/mod/test_fmod @@ -1439,7 +1568,8 @@ unreachable end f64.const nan:0x8000000000000 - f64.const -inf + f64.const inf + f64.neg f64.const nan:0x8000000000000 call $std/mod/test_fmod i32.eqz @@ -1959,7 +2089,8 @@ unreachable end f32.const 0 - f32.const -inf + f32.const inf + f32.neg f32.const 0 call $std/mod/test_fmodf i32.eqz @@ -1972,7 +2103,8 @@ unreachable end f32.const -0 - f32.const -inf + f32.const inf + f32.neg f32.const -0 call $std/mod/test_fmodf i32.eqz @@ -2011,7 +2143,8 @@ unreachable end f32.const 1 - f32.const -inf + f32.const inf + f32.neg f32.const 1 call $std/mod/test_fmodf i32.eqz @@ -2024,7 +2157,8 @@ unreachable end f32.const -1 - f32.const -inf + f32.const inf + f32.neg f32.const -1 call $std/mod/test_fmodf i32.eqz @@ -2062,7 +2196,8 @@ call $~lib/builtins/abort unreachable end - f32.const -inf + f32.const inf + f32.neg f32.const 0 f32.const nan:0x400000 call $std/mod/test_fmodf @@ -2075,7 +2210,8 @@ call $~lib/builtins/abort unreachable end - f32.const -inf + f32.const inf + f32.neg f32.const -0 f32.const nan:0x400000 call $std/mod/test_fmodf @@ -2114,7 +2250,8 @@ call $~lib/builtins/abort unreachable end - f32.const -inf + f32.const inf + f32.neg f32.const 1 f32.const nan:0x400000 call $std/mod/test_fmodf @@ -2127,7 +2264,8 @@ call $~lib/builtins/abort unreachable end - f32.const -inf + f32.const inf + f32.neg f32.const -1 f32.const nan:0x400000 call $std/mod/test_fmodf @@ -2153,7 +2291,8 @@ call $~lib/builtins/abort unreachable end - f32.const -inf + f32.const inf + f32.neg f32.const inf f32.const nan:0x400000 call $std/mod/test_fmodf @@ -2167,7 +2306,8 @@ unreachable end f32.const inf - f32.const -inf + f32.const inf + f32.neg f32.const nan:0x400000 call $std/mod/test_fmodf i32.eqz @@ -2179,8 +2319,10 @@ call $~lib/builtins/abort unreachable end - f32.const -inf - f32.const -inf + f32.const inf + f32.neg + f32.const inf + f32.neg f32.const nan:0x400000 call $std/mod/test_fmodf i32.eqz @@ -2205,7 +2347,8 @@ call $~lib/builtins/abort unreachable end - f32.const -inf + f32.const inf + f32.neg f32.const nan:0x400000 f32.const nan:0x400000 call $std/mod/test_fmodf @@ -2232,7 +2375,8 @@ unreachable end f32.const nan:0x400000 - f32.const -inf + f32.const inf + f32.neg f32.const nan:0x400000 call $std/mod/test_fmodf i32.eqz @@ -2245,10 +2389,9 @@ unreachable end ) - (func $start (; 9 ;) (type $FUNCSIG$v) + (func $start (; 11 ;) (type $FUNCSIG$v) call $start:std/mod ) - (func $null (; 10 ;) (type $FUNCSIG$v) - nop + (func $null (; 12 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/mod.untouched.wat b/tests/compiler/std/mod.untouched.wat index 3f997d2d..710fc46e 100644 --- a/tests/compiler/std/mod.untouched.wat +++ b/tests/compiler/std/mod.untouched.wat @@ -12,7 +12,7 @@ (import "math" "mod" (func $std/mod/mod (param f64 f64) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00s\00t\00d\00/\00m\00o\00d\00.\00t\00s\00") + (data (i32.const 8) "\14\00\00\00\01\00\00\00\10\00\00\00\14\00\00\00s\00t\00d\00/\00m\00o\00d\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $std/mod/js i32 (i32.const 1)) @@ -176,34 +176,32 @@ local.get $5 i64.gt_s if - block + local.get $2 + local.get $3 + i64.ge_u + if local.get $2 local.get $3 - i64.ge_u + i64.eq if - local.get $2 - local.get $3 - i64.eq - if - f64.const 0 - local.get $0 - f64.mul - return - end - local.get $2 - local.get $3 - i64.sub - local.set $2 + f64.const 0 + local.get $0 + f64.mul + return end local.get $2 - i64.const 1 - i64.shl - local.set $2 - local.get $4 - i64.const 1 + local.get $3 i64.sub - local.set $4 + local.set $2 end + local.get $2 + i64.const 1 + i64.shl + local.set $2 + local.get $4 + i64.const 1 + i64.sub + local.set $4 br $continue|0 end end @@ -479,34 +477,32 @@ local.get $5 i32.gt_s if - block + local.get $2 + local.get $3 + i32.ge_u + if local.get $2 local.get $3 - i32.ge_u + i32.eq if - local.get $2 - local.get $3 - i32.eq - if - f32.const 0 - local.get $0 - f32.mul - return - end - local.get $2 - local.get $3 - i32.sub - local.set $2 + f32.const 0 + local.get $0 + f32.mul + return end local.get $2 - i32.const 1 - i32.shl - local.set $2 - local.get $4 - i32.const 1 + local.get $3 i32.sub - local.set $4 + local.set $2 end + local.get $2 + i32.const 1 + i32.shl + local.set $2 + local.get $4 + i32.const 1 + i32.sub + local.set $4 br $continue|0 end end diff --git a/tests/compiler/std/object-literal.ts b/tests/compiler/std/object-literal.ts index 3a5b8b46..d5625db0 100644 --- a/tests/compiler/std/object-literal.ts +++ b/tests/compiler/std/object-literal.ts @@ -1,5 +1,3 @@ -import "collector/dummy"; - class Foo { bar: i32; baz: string; diff --git a/tests/compiler/std/set.json b/tests/compiler/std/set.json index b1da366f..9f7878d4 100644 --- a/tests/compiler/std/set.json +++ b/tests/compiler/std/set.json @@ -1,5 +1,6 @@ { "asc_flags": [ - "--runtime none" + "--runtime half", + "--use ASC_RTRACE=1" ] } \ No newline at end of file diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 8194d76d..87ae76e2 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -1,11 +1,12 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$iij (func (param i32 i64) (result i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$iiji (func (param i32 i64 i32) (result i32))) @@ -16,409 +17,1688 @@ (type $FUNCSIG$iid (func (param i32 f64) (result i32))) (type $FUNCSIG$iidi (func (param i32 f64 i32) (result i32))) (type $FUNCSIG$vid (func (param i32 f64))) - (type $FUNCSIG$i (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00(") - (data (i32.const 24) "~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s") - (data (i32.const 64) "\10\00\00\00&") - (data (i32.const 80) "~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 120) "\10\00\00\00\14") - (data (i32.const 136) "s\00t\00d\00/\00s\00e\00t\00.\00t\00s") - (data (i32.const 160) "\1c\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\1a\00\00\00\00\00\00\00\1a\00\00\00\00\00\00\00*\00\00\00\00\00\00\00*\00\00\00\00\00\00\00J\00\00\00\00\00\00\00J\00\00\00\00\00\00\00\8a\00\00\00\00\00\00\00\8a\00\00\00\00\00\00\00J\00\00\00\00\00\00\00\8a\00\00\00\00\00\00\00I\00\00\00\0e\00\00\00\08") - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/runtime/ROOT (mut i32) (i32.const 0)) + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\10\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 56) "&\00\00\00\01\00\00\00\10\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 160) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\10\00\00\00\14\00\00\00s\00t\00d\00/\00s\00e\00t\00.\00t\00s\00") + (data (i32.const 256) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 312) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 368) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 424) "\1a\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\1a\00\00\00\00\00\00\00\1a\00\00\00\00\00\00\00*\00\00\00\00\00\00\00*\00\00\00\00\00\00\00J\00\00\00\00\00\00\00J\00\00\00\00\00\00\00\8a\00\00\00\00\00\00\00\8a\00\00\00\00\00\00\00J\00\00\00\00\00\00\00\8a\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 424)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 640)) (export "memory" (memory $0)) - (export "$.instanceof" (func $~lib/runtime/runtime.instanceof)) - (export "$.flags" (func $~lib/runtime/runtime.flags)) - (export "$.newObject" (func $~lib/runtime/runtime.newObject)) - (export "$.newString" (func $~lib/runtime/runtime.newString)) - (export "$.newArrayBuffer" (func $~lib/runtime/runtime.newArrayBuffer)) - (export "$.newArray" (func $~lib/runtime/runtime.newArray)) - (export "$.retain" (func $~lib/runtime/runtime.retain)) - (export "$.release" (func $~lib/runtime/runtime.retain)) - (export "$.collect" (func $~lib/runtime/runtime.collect)) (start $start) - (func $~lib/allocator/arena/__mem_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 - local.get $0 - i32.const 1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 - i32.and - local.tee $0 - current_memory - local.tee $2 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.tee $3 - local.get $2 - local.get $3 - i32.gt_s - select - grow_memory - i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $0 - global.set $~lib/allocator/arena/offset + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) local.get $1 - ) - (func $~lib/util/runtime/allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 15 - i32.add - i32.clz - i32.sub - i32.shl - call $~lib/allocator/arena/__mem_allocate - local.tee $1 - i32.const -1520547049 - i32.store - local.get $1 - local.get $0 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.store offset=8 - local.get $1 - i32.const 0 - i32.store offset=12 - local.get $1 - i32.const 16 - i32.add - ) - (func $~lib/util/runtime/register (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $0 - i32.const 392 - i32.le_u - if - i32.const 0 - i32.const 24 - i32.const 129 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.const 16 - i32.sub - local.tee $2 i32.load - i32.const -1520547049 - i32.ne + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz if i32.const 0 - i32.const 24 - i32.const 131 - i32.const 4 + i32.const 128 + i32.const 275 + i32.const 13 call $~lib/builtins/abort unreachable end local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end local.get $1 - i32.store - local.get $0 - ) - (func $~lib/memory/memory.fill (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - block $~lib/util/memory/memset|inlined.0 - local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 i32.eqz - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 1 - i32.add - i32.const 0 - i32.store8 - local.get $0 - i32.const 2 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $1 - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.tee $1 - i32.sub - local.set $2 - local.get $0 - local.get $1 - i32.add - local.tee $0 - i32.const 0 - i32.store - local.get $2 - i32.const -4 - i32.and - local.tee $1 - local.get $0 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 4 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 8 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 12 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 16 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 20 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 24 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - local.get $0 - i32.add - local.set $0 - local.get $1 - local.get $2 - i32.sub - local.set $1 - loop $continue|0 - local.get $1 - i32.const 32 - i32.ge_u + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz if local.get $0 - i64.const 0 - i64.store local.get $0 - i32.const 8 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 16 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 24 - i32.add - i64.const 0 - i64.store - local.get $1 - i32.const 32 - i32.sub - local.set $1 - local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store end end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 1073741808 - i32.gt_u + (func $~lib/rt/tlsf/insertBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz if i32.const 0 - i32.const 80 - i32.const 54 - i32.const 43 + i32.const 128 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 6 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 7 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + current_memory + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 446 + i32.const 29 call $~lib/builtins/abort unreachable end local.get $0 - call $~lib/util/runtime/allocate + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $3 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + current_memory + local.set $7 local.get $0 - call $~lib/memory/memory.fill + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $continue|0 + end + end + end + end + ) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 1073741808 + i32.gt_u + if + i32.const 24 + i32.const 72 + i32.const 56 + i32.const 42 + call $~lib/builtins/abort + unreachable + end local.get $1 i32.const 15 - call $~lib/util/runtime/register - ) - (func $~lib/set/Set#clear (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $1 - local.get $0 - i32.load - i32.ne - drop - local.get $0 + call $~lib/rt/tlsf/__alloc + local.set $2 + local.get $2 + i32.const 0 local.get $1 + call $~lib/memory/memory.fill + local.get $2 + call $~lib/rt/purerc/__retain + ) + (func $~lib/set/Set#clear (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 3 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 - i32.const 32 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.get $0 local.tee $1 - local.get $0 - i32.load offset=8 - i32.ne - drop - local.get $0 - local.get $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 i32.const 4 @@ -430,94 +1710,118 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 7 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 17 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 + (func $~lib/set/Set#constructor (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 17 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/hash8 (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const -2128831035 + local.get $0 + i32.xor + i32.const 16777619 + i32.mul + ) + (func $~lib/set/Set#find (; 19 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $0 i32.load + local.get $2 local.get $0 i32.load offset=4 - local.get $2 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add i32.load - local.set $0 - loop $continue|0 - local.get $0 - if - local.get $0 - i32.load offset=4 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $0 - i32.load8_u - local.get $1 - i32.const 255 - i32.and - i32.eq - end + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 if - local.get $0 - return + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load8_s + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 end - local.get $0 - i32.load offset=4 - i32.const -2 - i32.and - local.set $0 - br $continue|0 end end i32.const 0 ) - (func $~lib/set/Set#has (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 21 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -525,123 +1829,160 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $6 - i32.const 3 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor local.set $4 + i32.const 0 + local.get $4 + block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) + i32.const 8 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 3 - i32.shl + block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) + i32.const 8 + end + i32.mul i32.add local.set $7 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $7 - i32.ne - if - local.get $2 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - i32.load8_s - i32.store8 - local.get $3 - local.get $2 - i32.load8_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 i32.and - i32.const 2 - i32.shl - local.get $5 + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i32.load8_s + i32.store8 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i32.load8_s + local.set $11 + local.get $11 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) + i32.const 8 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end i32.add - local.tee $8 - i32.load - i32.store offset=4 - local.get $8 - local.get $3 - i32.store - local.get $3 - i32.const 8 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 8 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $5 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $6 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 22 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.1 + end local.set $3 local.get $0 local.get $1 - local.get $2 + local.get $3 call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -675,20 +2016,23 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $4 - i32.const 1 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $2 + i32.const 1 + i32.add + i32.store offset=16 + local.get $2 + end + block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) + i32.const 8 + end + i32.mul i32.add - i32.store offset=16 + local.set $4 local.get $4 - i32.const 3 - i32.shl - local.get $2 - i32.add - local.tee $2 local.get $1 i32.store8 local.get $0 @@ -697,45 +2041,57 @@ i32.const 1 i32.add i32.store offset=20 - local.get $2 local.get $0 i32.load + local.get $3 local.get $0 i32.load offset=4 - local.get $3 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $2 + local.get $4 + local.get $2 i32.load i32.store offset=4 - local.get $0 local.get $2 + local.get $4 i32.store end ) - (func $~lib/set/Set#delete (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#get:size (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/set/Set#delete (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 local.get $1 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.3 + end call $~lib/set/Set#find - local.tee $1 + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $1 - local.get $1 + local.get $3 + local.get $3 i32.load offset=4 i32.const 1 i32.or @@ -750,15 +2106,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $2 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $2 local.get $0 i32.load offset=20 - local.tee $1 - i32.const 4 - local.get $1 + local.tee $5 + local.get $2 + local.get $5 i32.gt_u select i32.ge_u @@ -777,272 +2135,319 @@ end if local.get $0 - local.get $2 + local.get $4 call $~lib/set/Set#rehash end + i32.const 1 ) - (func $std/set/testNumeric (; 13 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 25 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + i32.const 0 call $~lib/set/Set#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_s - if + local.set $0 + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 local.get $1 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - else - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 1 + i32.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 50 - local.set $0 - loop $repeat|1 - local.get $0 - i32.const 100 - i32.lt_s - if + block $break|1 + i32.const 50 + local.set $1 + loop $repeat|1 local.get $1 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 16 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|1 - else - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 1 + i32.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i32.const 50 - i32.lt_s - if + block $break|2 + i32.const 0 + local.set $1 + loop $repeat|2 local.get $1 + i32.const 50 + i32.lt_s + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 24 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|2 - end + i32.const 1 + i32.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i32.const 50 - i32.lt_s - if + block $break|3 + i32.const 0 + local.set $1 + loop $repeat|3 local.get $1 + i32.const 50 + i32.lt_s + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 32 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 - call $~lib/set/Set#add local.get $1 + call $~lib/set/Set#delete + drop local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 34 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|3 - end + i32.const 1 + i32.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 call $~lib/set/Set#clear - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size + i32.const 0 + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 42 + i32.const 232 + i32.const 40 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#constructor (; 14 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 18 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 + (func $~lib/set/Set#clear (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 - i32.const 0 + i32.const 4 i32.store offset=12 local.get $0 i32.const 0 @@ -1050,25 +2455,108 @@ local.get $0 i32.const 0 i32.store offset=20 - local.get $0 - call $~lib/set/Set#clear + ) + (func $~lib/set/Set#constructor (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 18 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#has (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#find (; 28 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 + if + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load8_u + local.get $1 + i32.const 255 + i32.and + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 + end + end + end + i32.const 0 + ) + (func $~lib/set/Set#has (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - call $~lib/set/Set#find + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 255 + i32.and + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.0 + end + call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1076,121 +2564,158 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $6 - i32.const 3 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor local.set $4 + i32.const 0 + local.get $4 + block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) + i32.const 8 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 3 - i32.shl + block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) + i32.const 8 + end + i32.mul i32.add local.set $7 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $7 - i32.ne - if - local.get $2 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - i32.load8_u - i32.store8 - local.get $3 - local.get $2 - i32.load8_u - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 i32.and - i32.const 2 - i32.shl - local.get $5 + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i32.load8_u + i32.store8 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i32.load8_u + local.set $11 + local.get $11 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) + i32.const 8 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end i32.add - local.tee $8 - i32.load - i32.store offset=4 - local.get $8 - local.get $3 - i32.store - local.get $3 - i32.const 8 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 8 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $5 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $6 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 255 + i32.and + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.1 + end local.set $3 local.get $0 local.get $1 - local.get $2 - call $~lib/set/Set#find + local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -1224,20 +2749,23 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $4 - i32.const 1 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $2 + i32.const 1 + i32.add + i32.store offset=16 + local.get $2 + end + block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) + i32.const 8 + end + i32.mul i32.add - i32.store offset=16 + local.set $4 local.get $4 - i32.const 3 - i32.shl - local.get $2 - i32.add - local.tee $2 local.get $1 i32.store8 local.get $0 @@ -1246,43 +2774,55 @@ i32.const 1 i32.add i32.store offset=20 - local.get $2 local.get $0 i32.load + local.get $3 local.get $0 i32.load offset=4 - local.get $3 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $2 + local.get $4 + local.get $2 i32.load i32.store offset=4 - local.get $0 local.get $2 + local.get $4 i32.store end ) - (func $~lib/set/Set#delete (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#get:size (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/set/Set#delete (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 local.get $1 - local.get $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - call $~lib/set/Set#find - local.tee $1 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 255 + i32.and + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.3 + end + call $~lib/set/Set#find + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $1 - local.get $1 + local.get $3 + local.get $3 i32.load offset=4 i32.const 1 i32.or @@ -1297,15 +2837,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $2 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $2 local.get $0 i32.load offset=20 - local.tee $1 - i32.const 4 - local.get $1 + local.tee $5 + local.get $2 + local.get $5 i32.gt_u select i32.ge_u @@ -1324,272 +2866,319 @@ end if local.get $0 - local.get $2 + local.get $4 call $~lib/set/Set#rehash end + i32.const 1 ) - (func $std/set/testNumeric (; 19 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 34 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + i32.const 0 call $~lib/set/Set#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_u - if + local.set $0 + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - else - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 1 + i32.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 50 - local.set $0 - loop $repeat|1 - local.get $0 - i32.const 100 - i32.lt_u - if + block $break|1 + i32.const 50 + local.set $1 + loop $repeat|1 local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 16 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|1 - else - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 1 + i32.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i32.const 50 - i32.lt_u - if + block $break|2 + i32.const 0 + local.set $1 + loop $repeat|2 local.get $1 + i32.const 50 + i32.lt_u + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 24 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|2 - end + i32.const 1 + i32.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i32.const 50 - i32.lt_u - if + block $break|3 + i32.const 0 + local.set $1 + loop $repeat|3 local.get $1 + i32.const 50 + i32.lt_u + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 32 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 - call $~lib/set/Set#add local.get $1 + call $~lib/set/Set#delete + drop local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 34 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|3 - end + i32.const 1 + i32.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/set/Set#clear - local.get $1 - i32.load offset=20 - if - i32.const 0 - i32.const 136 - i32.const 42 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/set/Set#constructor (; 20 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 19 - call $~lib/util/runtime/register - local.tee $0 + local.get $0 + call $~lib/set/Set#clear + local.get $0 + call $~lib/set/Set#get:size i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/set/Set#clear (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 - i32.const 0 + i32.const 4 i32.store offset=12 local.get $0 i32.const 0 @@ -1597,79 +3186,134 @@ local.get $0 i32.const 0 i32.store offset=20 - local.get $0 - call $~lib/set/Set#clear - local.get $0 ) - (func $~lib/set/Set#find (; 21 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.load - local.get $0 - i32.load offset=4 - local.get $2 - i32.and - i32.const 2 - i32.shl - i32.add - i32.load - local.set $0 - loop $continue|0 + (func $~lib/set/Set#constructor (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) local.get $0 + i32.eqz if - local.get $0 - i32.load offset=4 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $0 - i32.load16_u - local.get $1 - i32.const 65535 - i32.and - i32.eq - end - if - local.get $0 - return - end - local.get $0 - i32.load offset=4 - i32.const -2 - i32.and + i32.const 24 + i32.const 19 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 - br $continue|0 end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 end - i32.const 0 - ) - (func $~lib/set/Set#has (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + call $~lib/set/Set#clear local.get $0 + ) + (func $~lib/util/hash/hash16 (; 37 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + i32.const -2128831035 + local.set $1 local.get $1 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - local.tee $0 + local.get $0 i32.const 255 i32.and - i32.const -2128831035 i32.xor i32.const 16777619 i32.mul + local.set $1 + local.get $1 local.get $0 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul + local.set $1 + local.get $1 + ) + (func $~lib/set/Set#find (; 38 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 + if + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load16_s + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 + end + end + end + i32.const 0 + ) + (func $~lib/set/Set#has (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 23 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 40 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1677,141 +3321,160 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $7 - i32.const 3 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor local.set $4 + i32.const 0 + local.get $4 + block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) + i32.const 8 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 3 - i32.shl + block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) + i32.const 8 + end + i32.mul i32.add + local.set $7 + local.get $5 local.set $8 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $8 - i32.ne - if - local.get $2 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - i32.load16_s - i32.store16 - local.get $3 - local.get $2 - i32.load16_s - local.tee $5 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $5 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.and - i32.const 2 - i32.shl local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i32.load16_s + i32.store16 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i32.load16_s + local.set $11 + local.get $11 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) + i32.const 8 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end i32.add - local.tee $5 - i32.load - i32.store offset=4 - local.get $5 - local.get $3 - i32.store - local.get $3 - i32.const 8 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 8 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $6 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $7 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 24 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 41 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - local.tee $2 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $2 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.1 + end local.set $3 local.get $0 local.get $1 - local.get $2 + local.get $3 call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -1845,20 +3508,23 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $4 - i32.const 1 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $2 + i32.const 1 + i32.add + i32.store offset=16 + local.get $2 + end + block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) + i32.const 8 + end + i32.mul i32.add - i32.store offset=16 + local.set $4 local.get $4 - i32.const 3 - i32.shl - local.get $2 - i32.add - local.tee $2 local.get $1 i32.store16 local.get $0 @@ -1867,54 +3533,57 @@ i32.const 1 i32.add i32.store offset=20 - local.get $2 local.get $0 i32.load + local.get $3 local.get $0 i32.load offset=4 - local.get $3 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $2 + local.get $4 + local.get $2 i32.load i32.store offset=4 - local.get $0 local.get $2 + local.get $4 i32.store end ) - (func $~lib/set/Set#delete (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#get:size (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/set/Set#delete (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 local.get $1 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.3 + end call $~lib/set/Set#find - local.tee $1 + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $1 - local.get $1 + local.get $3 + local.get $3 i32.load offset=4 i32.const 1 i32.or @@ -1929,15 +3598,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $2 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $2 local.get $0 i32.load offset=20 - local.tee $1 - i32.const 4 - local.get $1 + local.tee $5 + local.get $2 + local.get $5 i32.gt_u select i32.ge_u @@ -1956,272 +3627,319 @@ end if local.get $0 - local.get $2 + local.get $4 call $~lib/set/Set#rehash end + i32.const 1 ) - (func $std/set/testNumeric (; 26 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 44 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + i32.const 0 call $~lib/set/Set#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_s - if + local.set $0 + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 local.get $1 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - else - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 1 + i32.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 50 - local.set $0 - loop $repeat|1 - local.get $0 - i32.const 100 - i32.lt_s - if + block $break|1 + i32.const 50 + local.set $1 + loop $repeat|1 local.get $1 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 16 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|1 - else - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 1 + i32.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i32.const 50 - i32.lt_s - if + block $break|2 + i32.const 0 + local.set $1 + loop $repeat|2 local.get $1 + i32.const 50 + i32.lt_s + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 24 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|2 - end + i32.const 1 + i32.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i32.const 50 - i32.lt_s - if + block $break|3 + i32.const 0 + local.set $1 + loop $repeat|3 local.get $1 + i32.const 50 + i32.lt_s + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 32 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 - call $~lib/set/Set#add local.get $1 + call $~lib/set/Set#delete + drop local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 34 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|3 - end + i32.const 1 + i32.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/set/Set#clear - local.get $1 - i32.load offset=20 - if - i32.const 0 - i32.const 136 - i32.const 42 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/set/Set#constructor (; 27 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 20 - call $~lib/util/runtime/register - local.tee $0 + local.get $0 + call $~lib/set/Set#clear + local.get $0 + call $~lib/set/Set#get:size i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/set/Set#clear (; 45 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 - i32.const 0 + i32.const 4 i32.store offset=12 local.get $0 i32.const 0 @@ -2229,34 +3947,108 @@ local.get $0 i32.const 0 i32.store offset=20 - local.get $0 - call $~lib/set/Set#clear + ) + (func $~lib/set/Set#constructor (; 46 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 20 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#has (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#find (; 47 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 + if + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load16_u + local.get $1 + i32.const 65535 + i32.and + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 + end + end + end + i32.const 0 + ) + (func $~lib/set/Set#has (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - i32.const 65535 - i32.and - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - call $~lib/set/Set#find + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 65535 + i32.and + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.0 + end + call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 29 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 49 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2264,139 +4056,158 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $7 - i32.const 3 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor local.set $4 + i32.const 0 + local.get $4 + block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) + i32.const 8 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 3 - i32.shl + block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) + i32.const 8 + end + i32.mul i32.add + local.set $7 + local.get $5 local.set $8 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $8 - i32.ne - if - local.get $2 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - i32.load16_u - i32.store16 - local.get $3 - local.get $2 - i32.load16_u - local.tee $5 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $5 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.and - i32.const 2 - i32.shl local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i32.load16_u + i32.store16 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i32.load16_u + local.set $11 + local.get $11 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) + i32.const 8 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end i32.add - local.tee $5 - i32.load - i32.store offset=4 - local.get $5 - local.get $3 - i32.store - local.get $3 - i32.const 8 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 8 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $6 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $7 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 50 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 - i32.const 65535 - i32.and - local.tee $2 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $2 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 65535 + i32.and + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.1 + end local.set $3 local.get $0 local.get $1 - local.get $2 - call $~lib/set/Set#find + local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -2430,20 +4241,23 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $4 - i32.const 1 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $2 + i32.const 1 + i32.add + i32.store offset=16 + local.get $2 + end + block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) + i32.const 8 + end + i32.mul i32.add - i32.store offset=16 + local.set $4 local.get $4 - i32.const 3 - i32.shl - local.get $2 - i32.add - local.tee $2 local.get $1 i32.store16 local.get $0 @@ -2452,52 +4266,55 @@ i32.const 1 i32.add i32.store offset=20 - local.get $2 local.get $0 i32.load + local.get $3 local.get $0 i32.load offset=4 - local.get $3 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $2 + local.get $4 + local.get $2 i32.load i32.store offset=4 - local.get $0 local.get $2 + local.get $4 i32.store end ) - (func $~lib/set/Set#delete (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#get:size (; 51 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/set/Set#delete (; 52 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 local.get $1 - local.get $1 - i32.const 65535 - i32.and - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - call $~lib/set/Set#find - local.tee $1 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 65535 + i32.and + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.3 + end + call $~lib/set/Set#find + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $1 - local.get $1 + local.get $3 + local.get $3 i32.load offset=4 i32.const 1 i32.or @@ -2512,15 +4329,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $2 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $2 local.get $0 i32.load offset=20 - local.tee $1 - i32.const 4 - local.get $1 + local.tee $5 + local.get $2 + local.get $5 i32.gt_u select i32.ge_u @@ -2539,272 +4358,319 @@ end if local.get $0 - local.get $2 + local.get $4 call $~lib/set/Set#rehash end + i32.const 1 ) - (func $std/set/testNumeric (; 32 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 53 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + i32.const 0 call $~lib/set/Set#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_u - if + local.set $0 + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - else - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 1 + i32.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 50 - local.set $0 - loop $repeat|1 - local.get $0 - i32.const 100 - i32.lt_u - if + block $break|1 + i32.const 50 + local.set $1 + loop $repeat|1 local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 16 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|1 - else - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 1 + i32.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i32.const 50 - i32.lt_u - if + block $break|2 + i32.const 0 + local.set $1 + loop $repeat|2 local.get $1 + i32.const 50 + i32.lt_u + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 24 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|2 - end + i32.const 1 + i32.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i32.const 50 - i32.lt_u - if + block $break|3 + i32.const 0 + local.set $1 + loop $repeat|3 local.get $1 + i32.const 50 + i32.lt_u + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 32 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 - call $~lib/set/Set#add local.get $1 + call $~lib/set/Set#delete + drop local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 34 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|3 - end + i32.const 1 + i32.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/set/Set#clear - local.get $1 - i32.load offset=20 - if - i32.const 0 - i32.const 136 - i32.const 42 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/set/Set#constructor (; 33 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 21 - call $~lib/util/runtime/register - local.tee $0 + local.get $0 + call $~lib/set/Set#clear + local.get $0 + call $~lib/set/Set#get:size i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/set/Set#clear (; 54 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 - i32.const 0 + i32.const 4 i32.store offset=12 local.get $0 i32.const 0 @@ -2812,18 +4678,54 @@ local.get $0 i32.const 0 i32.store offset=20 - local.get $0 - call $~lib/set/Set#clear + ) + (func $~lib/set/Set#constructor (; 55 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 21 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash32 (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 56 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + i32.const -2128831035 + local.set $1 + local.get $1 local.get $0 i32.const 255 i32.and - i32.const -2128831035 i32.xor i32.const 16777619 i32.mul + local.set $1 + local.get $1 local.get $0 i32.const 8 i32.shr_u @@ -2832,6 +4734,8 @@ i32.xor i32.const 16777619 i32.mul + local.set $1 + local.get $1 local.get $0 i32.const 16 i32.shr_u @@ -2840,64 +4744,80 @@ i32.xor i32.const 16777619 i32.mul + local.set $1 + local.get $1 local.get $0 i32.const 24 i32.shr_u i32.xor i32.const 16777619 i32.mul + local.set $1 + local.get $1 ) - (func $~lib/set/Set#find (; 35 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 57 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $0 i32.load + local.get $2 local.get $0 i32.load offset=4 - local.get $2 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add i32.load - local.set $0 - loop $continue|0 - local.get $0 - if - local.get $0 - i32.load offset=4 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $0 - i32.load - local.get $1 - i32.eq - end + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 if - local.get $0 - return + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load + local.get $1 + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 end - local.get $0 - i32.load offset=4 - i32.const -2 - i32.and - local.set $0 - br $continue|0 end end i32.const 0 ) - (func $~lib/set/Set#has (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/hash32 + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 37 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 59 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2905,111 +4825,156 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $6 - i32.const 3 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor local.set $4 + i32.const 0 + local.get $4 + block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) + i32.const 8 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 3 - i32.shl + block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) + i32.const 8 + end + i32.mul i32.add local.set $7 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $7 - i32.ne - if - local.get $2 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - i32.load - i32.store - local.get $3 - local.get $2 - i32.load - call $~lib/util/hash/hash32 - local.get $1 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 i32.and - i32.const 2 - i32.shl - local.get $5 + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i32.load + i32.store + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i32.load + local.set $11 + local.get $11 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) + i32.const 8 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end i32.add - local.tee $8 - i32.load - i32.store offset=4 - local.get $8 - local.get $3 - i32.store - local.get $3 - i32.const 8 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 8 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $5 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $6 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 38 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 60 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/hash32 - local.tee $3 + local.get $3 call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -3043,20 +5008,23 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $4 - i32.const 1 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $2 + i32.const 1 + i32.add + i32.store offset=16 + local.get $2 + end + block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) + i32.const 8 + end + i32.mul i32.add - i32.store offset=16 + local.set $4 local.get $4 - i32.const 3 - i32.shl - local.get $2 - i32.add - local.tee $2 local.get $1 i32.store local.get $0 @@ -3065,38 +5033,53 @@ i32.const 1 i32.add i32.store offset=20 - local.get $2 local.get $0 i32.load + local.get $3 local.get $0 i32.load offset=4 - local.get $3 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $2 + local.get $4 + local.get $2 i32.load i32.store offset=4 - local.get $0 local.get $2 + local.get $4 i32.store end ) - (func $~lib/set/Set#delete (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#get:size (; 61 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/set/Set#delete (; 62 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/hash32 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 + end call $~lib/set/Set#find - local.tee $1 + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $1 - local.get $1 + local.get $3 + local.get $3 i32.load offset=4 i32.const 1 i32.or @@ -3111,15 +5094,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $2 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $2 local.get $0 i32.load offset=20 - local.tee $1 - i32.const 4 - local.get $1 + local.tee $5 + local.get $2 + local.get $5 i32.gt_u select i32.ge_u @@ -3138,552 +5123,316 @@ end if local.get $0 - local.get $2 + local.get $4 call $~lib/set/Set#rehash end + i32.const 1 ) - (func $std/set/testNumeric (; 40 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 63 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + i32.const 0 call $~lib/set/Set#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_s - if + local.set $0 + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 local.get $1 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - else - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 1 + i32.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 50 - local.set $0 - loop $repeat|1 - local.get $0 - i32.const 100 - i32.lt_s - if + block $break|1 + i32.const 50 + local.set $1 + loop $repeat|1 local.get $1 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 16 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|1 - else - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i32.const 1 + i32.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i32.const 50 - i32.lt_s - if + block $break|2 + i32.const 0 + local.set $1 + loop $repeat|2 local.get $1 + i32.const 50 + i32.lt_s + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 24 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|2 - end + i32.const 1 + i32.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable end - i32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i32.const 50 - i32.lt_s - if + block $break|3 + i32.const 0 + local.set $1 + loop $repeat|3 local.get $1 + i32.const 50 + i32.lt_s + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 32 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 - call $~lib/set/Set#add local.get $1 + call $~lib/set/Set#delete + drop local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 34 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|3 - end + i32.const 1 + i32.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/set/Set#clear - local.get $1 - i32.load offset=20 - if - i32.const 0 - i32.const 136 - i32.const 42 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/set/Set#constructor (; 41 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 22 - call $~lib/util/runtime/register - local.tee $0 + local.get $0 + call $~lib/set/Set#clear + local.get $0 + call $~lib/set/Set#get:size i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/set/Set#clear (; 64 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - call $~lib/set/Set#clear - local.get $0 - ) - (func $std/set/testNumeric (; 42 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - call $~lib/set/Set#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_u - if - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - else - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 100 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 12 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - i32.const 50 - local.set $0 - loop $repeat|1 - local.get $0 - i32.const 100 - i32.lt_u - if - local.get $1 - local.get $0 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|1 - else - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 100 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i32.const 50 - i32.lt_u - if - local.get $1 - local.get $0 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 24 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|2 - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 50 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i32.const 50 - i32.lt_u - if - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 34 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|3 - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 50 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - local.get $1 - call $~lib/set/Set#clear - local.get $1 - i32.load offset=20 - if - i32.const 0 - i32.const 136 - i32.const 42 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/set/Set#clear (; 43 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor local.tee $1 - local.get $0 - i32.load - i32.ne - drop - local.get $0 - local.get $1 - i32.store - local.get $0 - i32.const 3 - i32.store offset=4 - i32.const 64 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $1 - local.get $0 - i32.load offset=8 - i32.ne - drop - local.get $0 - local.get $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 i32.const 4 @@ -3695,151 +5444,103 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 44 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 23 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - call $~lib/set/Set#clear + (func $~lib/set/Set#constructor (; 65 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 22 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash64 (; 45 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) - (local $1 i32) - local.get $0 - i32.wrap_i64 - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i64.const 32 - i64.shr_u - i32.wrap_i64 - local.tee $1 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - ) - (func $~lib/set/Set#find (; 46 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 66 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $0 i32.load + local.get $2 local.get $0 i32.load offset=4 - local.get $2 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add i32.load - local.set $0 - loop $continue|0 - local.get $0 - if - local.get $0 - i32.load offset=8 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $0 - i64.load - local.get $1 - i64.eq - end + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 if - local.get $0 - return + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load + local.get $1 + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 end - local.get $0 - i32.load offset=8 - i32.const -2 - i32.and - local.set $0 - br $continue|0 end end i32.const 0 ) - (func $~lib/set/Set#has (; 47 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#has (; 67 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/hash64 - call $~lib/set/Set#find + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 + end + call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 48 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 68 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3847,111 +5548,969 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $6 - i32.const 4 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor local.set $4 + i32.const 0 + local.get $4 + block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) + i32.const 8 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 4 - i32.shl + block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) + i32.const 8 + end + i32.mul i32.add local.set $7 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $7 - i32.ne - if - local.get $2 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - i64.load - i64.store - local.get $3 - local.get $2 - i64.load - call $~lib/util/hash/hash64 - local.get $1 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 i32.and - i32.const 2 - i32.shl - local.get $5 + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i32.load + i32.store + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i32.load + local.set $11 + local.get $11 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) + i32.const 8 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end i32.add - local.tee $8 - i32.load - i32.store offset=8 - local.get $8 - local.get $3 - i32.store - local.get $3 - i32.const 16 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 16 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $5 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $6 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 49 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/set/Set#add (; 69 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 local.get $0 local.get $1 + local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 + i32.eqz + if + local.get $0 + i32.load offset=16 + local.get $0 + i32.load offset=12 + i32.eq + if + local.get $0 + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + f64.convert_i32_s + f64.const 0.75 + f64.mul + i32.trunc_f64_s + i32.lt_s + if (result i32) + local.get $0 + i32.load offset=4 + else + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shl + i32.const 1 + i32.or + end + call $~lib/set/Set#rehash + end + local.get $0 + i32.load offset=8 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $2 + i32.const 1 + i32.add + i32.store offset=16 + local.get $2 + end + block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) + i32.const 8 + end + i32.mul + i32.add + local.set $4 + local.get $4 + local.get $1 + i32.store + local.get $0 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.add + i32.store offset=20 + local.get $0 + i32.load + local.get $3 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + local.set $2 + local.get $4 + local.get $2 + i32.load + i32.store offset=4 + local.get $2 + local.get $4 + i32.store + end + ) + (func $~lib/set/Set#get:size (; 70 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/set/Set#delete (; 71 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 local.get $1 - call $~lib/util/hash/hash64 - local.tee $3 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 + end + call $~lib/set/Set#find + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + return + end + local.get $3 + local.get $3 + i32.load offset=4 + i32.const 1 + i32.or + i32.store offset=4 + local.get $0 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.sub + i32.store offset=20 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shr_u + local.set $4 + local.get $4 + i32.const 1 + i32.add + i32.const 4 + local.tee $2 + local.get $0 + i32.load offset=20 + local.tee $5 + local.get $2 + local.get $5 + i32.gt_u + select + i32.ge_u + if (result i32) + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + f64.convert_i32_s + f64.const 0.75 + f64.mul + i32.trunc_f64_s + i32.lt_s + else + i32.const 0 + end + if + local.get $0 + local.get $4 + call $~lib/set/Set#rehash + end + i32.const 1 + ) + (func $std/set/testNumeric (; 72 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + call $~lib/set/Set#constructor + local.set $0 + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 + local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + unreachable + end + unreachable + end + local.get $0 + call $~lib/set/Set#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 10 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|1 + i32.const 50 + local.set $1 + loop $repeat|1 + local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + unreachable + end + unreachable + end + local.get $0 + call $~lib/set/Set#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|2 + i32.const 0 + local.set $1 + loop $repeat|2 + local.get $1 + i32.const 50 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + call $~lib/set/Set#get:size + i32.const 50 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 26 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|3 + i32.const 0 + local.set $1 + loop $repeat|3 + local.get $1 + i32.const 50 + i32.lt_u + i32.eqz + br_if $break|3 + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|3 + unreachable + end + unreachable + end + local.get $0 + call $~lib/set/Set#get:size + i32.const 50 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/set/Set#clear + local.get $0 + call $~lib/set/Set#get:size + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/set/Set#clear (; 73 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end + i32.store + local.get $0 + i32.const 4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor + end + i32.store offset=8 + local.get $0 + i32.const 4 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + ) + (func $~lib/set/Set#constructor (; 74 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 23 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/set/Set#clear + local.get $0 + ) + (func $~lib/util/hash/hash64 (; 75 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.wrap_i64 + local.set $1 + local.get $0 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.set $2 + i32.const -2128831035 + local.set $3 + local.get $3 + local.get $1 + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $1 + i32.const 8 + i32.shr_u + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $1 + i32.const 16 + i32.shr_u + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $1 + i32.const 24 + i32.shr_u + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $2 + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $2 + i32.const 8 + i32.shr_u + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $2 + i32.const 16 + i32.shr_u + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + local.get $2 + i32.const 24 + i32.shr_u + i32.xor + i32.const 16777619 + i32.mul + local.set $3 + local.get $3 + ) + (func $~lib/set/Set#find (; 76 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 + if + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i64.load + local.get $1 + i64.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 + end + end + end + i32.const 0 + ) + (func $~lib/set/Set#has (; 77 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (local $2 i64) + local.get $0 + local.get $1 + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find + i32.const 0 + i32.ne + ) + (func $~lib/set/Set#rehash (; 78 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i64) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.const 1 + i32.add + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $3 + local.get $2 + f64.convert_i32_s + f64.const 2.6666666666666665 + f64.mul + i32.trunc_f64_s + local.set $4 + i32.const 0 + local.get $4 + block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) + i32.const 16 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 + local.get $0 + i32.load offset=8 + local.set $6 + local.get $6 + local.get $0 + i32.load offset=16 + block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) + i32.const 16 + end + i32.mul + i32.add + local.set $7 + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne + if + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i64.load + i64.store + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i64.load + local.set $11 + local.get $11 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=8 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) + i32.const 16 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end + i32.add + local.set $6 + br $continue|0 + end + end + end + local.get $0 + local.tee $9 + local.get $3 + local.get $9 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store + local.get $0 + local.get $1 + i32.store offset=4 + local.get $0 + local.tee $9 + local.get $5 + local.get $9 + i32.load offset=8 + call $~lib/rt/purerc/__retainRelease + i32.store offset=8 + local.get $0 + local.get $4 + i32.store offset=12 + local.get $0 + local.get $0 + i32.load offset=20 + i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + ) + (func $~lib/set/Set#add (; 79 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (local $2 i64) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 + local.get $0 + local.get $1 + local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -3985,20 +6544,23 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $4 - i32.const 1 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $5 + i32.const 1 + i32.add + i32.store offset=16 + local.get $5 + end + block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) + i32.const 16 + end + i32.mul i32.add - i32.store offset=16 + local.set $4 local.get $4 - i32.const 4 - i32.shl - local.get $2 - i32.add - local.tee $2 local.get $1 i64.store local.get $0 @@ -4007,39 +6569,54 @@ i32.const 1 i32.add i32.store offset=20 - local.get $2 local.get $0 i32.load + local.get $3 local.get $0 i32.load offset=4 - local.get $3 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $5 + local.get $4 + local.get $5 i32.load i32.store offset=8 - local.get $0 - local.get $2 + local.get $5 + local.get $4 i32.store end ) - (func $~lib/set/Set#delete (; 50 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) - (local $2 i32) + (func $~lib/set/Set#get:size (; 80 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/set/Set#delete (; 81 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (local $2 i64) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/hash64 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.3 + end call $~lib/set/Set#find - local.tee $2 + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $2 - local.get $2 + local.get $3 + local.get $3 i32.load offset=8 i32.const 1 i32.or @@ -4054,15 +6631,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $3 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $5 local.get $0 i32.load offset=20 - local.tee $2 - i32.const 4 - local.get $2 + local.tee $6 + local.get $5 + local.get $6 i32.gt_u select i32.ge_u @@ -4081,545 +6660,319 @@ end if local.get $0 - local.get $3 + local.get $4 call $~lib/set/Set#rehash end + i32.const 1 ) - (func $std/set/testNumeric (; 51 ;) (type $FUNCSIG$v) - (local $0 i64) - (local $1 i32) + (func $std/set/testNumeric (; 82 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i64) + i32.const 0 call $~lib/set/Set#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i64.const 100 - i64.lt_s - if + local.set $0 + block $break|0 + i64.const 0 + local.set $1 + loop $repeat|0 local.get $1 + i64.const 100 + i64.lt_s + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|0 - else - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i64.const 1 + i64.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable end - i64.const 50 - local.set $0 - loop $repeat|1 - local.get $0 - i64.const 100 - i64.lt_s - if + block $break|1 + i64.const 50 + local.set $1 + loop $repeat|1 local.get $1 + i64.const 100 + i64.lt_s + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 16 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|1 - else - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + i64.const 1 + i64.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable end - i64.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i64.const 50 - i64.lt_s - if + block $break|2 + i64.const 0 + local.set $1 + loop $repeat|2 local.get $1 + i64.const 50 + i64.lt_s + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 24 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|2 - end + i64.const 1 + i64.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable end - i64.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i64.const 50 - i64.lt_s - if + block $break|3 + i64.const 0 + local.set $1 + loop $repeat|3 local.get $1 + i64.const 50 + i64.lt_s + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 32 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 - call $~lib/set/Set#add local.get $1 + call $~lib/set/Set#delete + drop local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 34 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|3 - end + i64.const 1 + i64.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 call $~lib/set/Set#clear - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size + i32.const 0 + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 42 + i32.const 232 + i32.const 40 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#constructor (; 52 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 24 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - call $~lib/set/Set#clear - local.get $0 - ) - (func $std/set/testNumeric (; 53 ;) (type $FUNCSIG$v) - (local $0 i64) + (func $~lib/set/Set#clear (; 83 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - call $~lib/set/Set#constructor - local.set $1 - loop $repeat|0 - local.get $0 - i64.const 100 - i64.lt_u - if - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|0 - else - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 100 - i32.ne - if + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release i32.const 0 - i32.const 136 - i32.const 12 - i32.const 2 - call $~lib/builtins/abort - unreachable + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end - i64.const 50 - local.set $0 - loop $repeat|1 - local.get $0 - i64.const 100 - i64.lt_u - if - local.get $1 - local.get $0 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|1 - else - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 100 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 20 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - i64.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - i64.const 50 - i64.lt_u - if - local.get $1 - local.get $0 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 24 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|2 - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 50 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - i64.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - i64.const 50 - i64.lt_u - if - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 34 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - i64.const 1 - i64.add - local.set $0 - br $repeat|3 - end - unreachable - end - end - local.get $1 - i32.load offset=20 - i32.const 50 - i32.ne - if - i32.const 0 - i32.const 136 - i32.const 38 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - local.get $1 - call $~lib/set/Set#clear - local.get $1 - i32.load offset=20 - if - i32.const 0 - i32.const 136 - i32.const 42 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/set/Set#constructor (; 54 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 25 - call $~lib/util/runtime/register - local.tee $0 - i32.const 0 i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 - i32.const 0 + i32.const 4 i32.store offset=12 local.get $0 i32.const 0 @@ -4627,62 +6980,104 @@ local.get $0 i32.const 0 i32.store offset=20 - local.get $0 - call $~lib/set/Set#clear + ) + (func $~lib/set/Set#constructor (; 84 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 24 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 55 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 85 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (local $3 i32) local.get $0 i32.load + local.get $2 local.get $0 i32.load offset=4 - local.get $2 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add i32.load - local.set $0 - loop $continue|0 - local.get $0 - if - local.get $0 - i32.load offset=4 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $0 - f32.load - local.get $1 - f32.eq - end + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 if - local.get $0 - return + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i64.load + local.get $1 + i64.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 end - local.get $0 - i32.load offset=4 - i32.const -2 - i32.and - local.set $0 - br $continue|0 end end i32.const 0 ) - (func $~lib/set/Set#has (; 56 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/set/Set#has (; 86 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (local $2 i64) local.get $0 local.get $1 - local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - call $~lib/set/Set#find + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.0 + end + call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 57 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 87 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4690,113 +7085,887 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i64) + (local $12 i32) + (local $13 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $6 - i32.const 3 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor local.set $4 + i32.const 0 + local.get $4 + block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) + i32.const 16 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 3 - i32.shl + block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) + i32.const 16 + end + i32.mul i32.add local.set $7 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $7 - i32.ne - if - local.get $2 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - f32.load - f32.store - local.get $3 - local.get $2 - f32.load - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - local.get $1 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 i32.and - i32.const 2 - i32.shl - local.get $5 + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i64.load + i64.store + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i64.load + local.set $11 + local.get $11 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=8 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) + i32.const 16 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end i32.add - local.tee $8 - i32.load - i32.store offset=4 - local.get $8 - local.get $3 - i32.store - local.get $3 - i32.const 8 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 8 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $5 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $6 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 58 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (func $~lib/set/Set#add (; 88 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (local $2 i64) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 + local.get $0 + local.get $1 + local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 + i32.eqz + if + local.get $0 + i32.load offset=16 + local.get $0 + i32.load offset=12 + i32.eq + if + local.get $0 + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + f64.convert_i32_s + f64.const 0.75 + f64.mul + i32.trunc_f64_s + i32.lt_s + if (result i32) + local.get $0 + i32.load offset=4 + else + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shl + i32.const 1 + i32.or + end + call $~lib/set/Set#rehash + end + local.get $0 + i32.load offset=8 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $5 + i32.const 1 + i32.add + i32.store offset=16 + local.get $5 + end + block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) + i32.const 16 + end + i32.mul + i32.add + local.set $4 + local.get $4 + local.get $1 + i64.store + local.get $0 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.add + i32.store offset=20 + local.get $0 + i32.load + local.get $3 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + local.set $5 + local.get $4 + local.get $5 + i32.load + i32.store offset=8 + local.get $5 + local.get $4 + i32.store + end + ) + (func $~lib/set/Set#get:size (; 89 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/set/Set#delete (; 90 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (local $2 i64) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + local.get $1 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.3 + end + call $~lib/set/Set#find + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + return + end + local.get $3 + local.get $3 + i32.load offset=8 + i32.const 1 + i32.or + i32.store offset=8 + local.get $0 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.sub + i32.store offset=20 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shr_u + local.set $4 + local.get $4 + i32.const 1 + i32.add + i32.const 4 + local.tee $5 + local.get $0 + i32.load offset=20 + local.tee $6 + local.get $5 + local.get $6 + i32.gt_u + select + i32.ge_u + if (result i32) + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + f64.convert_i32_s + f64.const 0.75 + f64.mul + i32.trunc_f64_s + i32.lt_s + else + i32.const 0 + end + if + local.get $0 + local.get $4 + call $~lib/set/Set#rehash + end + i32.const 1 + ) + (func $std/set/testNumeric (; 91 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i64) + i32.const 0 + call $~lib/set/Set#constructor + local.set $0 + block $break|0 + i64.const 0 + local.set $1 + loop $repeat|0 + local.get $1 + i64.const 100 + i64.lt_u + i32.eqz + br_if $break|0 + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i64.const 1 + i64.add + local.set $1 + br $repeat|0 + unreachable + end + unreachable + end + local.get $0 + call $~lib/set/Set#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 10 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|1 + i64.const 50 + local.set $1 + loop $repeat|1 + local.get $1 + i64.const 100 + i64.lt_u + i32.eqz + br_if $break|1 + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i64.const 1 + i64.add + local.set $1 + br $repeat|1 + unreachable + end + unreachable + end + local.get $0 + call $~lib/set/Set#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 18 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|2 + i64.const 0 + local.set $1 + loop $repeat|2 + local.get $1 + i64.const 50 + i64.lt_u + i32.eqz + br_if $break|2 + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i64.const 1 + i64.add + local.set $1 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + call $~lib/set/Set#get:size + i32.const 50 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 26 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|3 + i64.const 0 + local.set $1 + loop $repeat|3 + local.get $1 + i64.const 50 + i64.lt_u + i32.eqz + br_if $break|3 + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i64.const 1 + i64.add + local.set $1 + br $repeat|3 + unreachable + end + unreachable + end + local.get $0 + call $~lib/set/Set#get:size + i32.const 50 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 36 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/set/Set#clear + local.get $0 + call $~lib/set/Set#get:size + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/set/Set#clear (; 92 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end + i32.store + local.get $0 + i32.const 4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + end + i32.store offset=8 + local.get $0 + i32.const 4 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + ) + (func $~lib/set/Set#constructor (; 93 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 25 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/set/Set#clear + local.get $0 + ) + (func $~lib/set/Set#find (; 94 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 + if + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + f32.load + local.get $1 + f32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 + end + end + end + i32.const 0 + ) + (func $~lib/set/Set#has (; 95 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (local $2 f32) + local.get $0 + local.get $1 + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 + end + call $~lib/set/Set#find + i32.const 0 + i32.ne + ) + (func $~lib/set/Set#rehash (; 96 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 f32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.const 1 + i32.add + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $3 + local.get $2 + f64.convert_i32_s + f64.const 2.6666666666666665 + f64.mul + i32.trunc_f64_s + local.set $4 + i32.const 0 + local.get $4 + block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) + i32.const 8 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 + local.get $0 + i32.load offset=8 + local.set $6 + local.get $6 + local.get $0 + i32.load offset=16 + block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) + i32.const 8 + end + i32.mul + i32.add + local.set $7 + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne + if + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + f32.load + f32.store + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + f32.load + local.set $11 + local.get $11 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=4 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) + i32.const 8 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end + i32.add + local.set $6 + br $continue|0 + end + end + end + local.get $0 + local.tee $9 + local.get $3 + local.get $9 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store local.get $0 local.get $1 + i32.store offset=4 + local.get $0 + local.tee $9 + local.get $5 + local.get $9 + i32.load offset=8 + call $~lib/rt/purerc/__retainRelease + i32.store offset=8 + local.get $0 + local.get $4 + i32.store offset=12 + local.get $0 + local.get $0 + i32.load offset=20 + i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + ) + (func $~lib/set/Set#add (; 97 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (local $2 f32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 + local.get $0 local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - local.tee $3 + local.get $3 call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -4830,20 +7999,23 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $4 - i32.const 1 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $5 + i32.const 1 + i32.add + i32.store offset=16 + local.get $5 + end + block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) + i32.const 8 + end + i32.mul i32.add - i32.store offset=16 + local.set $4 local.get $4 - i32.const 3 - i32.shl - local.get $2 - i32.add - local.tee $2 local.get $1 f32.store local.get $0 @@ -4852,40 +8024,55 @@ i32.const 1 i32.add i32.store offset=20 - local.get $2 local.get $0 i32.load + local.get $3 local.get $0 i32.load offset=4 - local.get $3 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $5 + local.get $4 + local.get $5 i32.load i32.store offset=4 - local.get $0 - local.get $2 + local.get $5 + local.get $4 i32.store end ) - (func $~lib/set/Set#delete (; 59 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) - (local $2 i32) + (func $~lib/set/Set#get:size (; 98 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/set/Set#delete (; 99 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (local $2 f32) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 local.get $1 - local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 + end call $~lib/set/Set#find - local.tee $2 + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $2 - local.get $2 + local.get $3 + local.get $3 i32.load offset=4 i32.const 1 i32.or @@ -4900,15 +8087,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $3 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $5 local.get $0 i32.load offset=20 - local.tee $2 - i32.const 4 - local.get $2 + local.tee $6 + local.get $5 + local.get $6 i32.gt_u select i32.ge_u @@ -4927,272 +8116,319 @@ end if local.get $0 - local.get $3 + local.get $4 call $~lib/set/Set#rehash end + i32.const 1 ) - (func $std/set/testNumeric (; 60 ;) (type $FUNCSIG$v) - (local $0 f32) - (local $1 i32) + (func $std/set/testNumeric (; 100 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 f32) + i32.const 0 call $~lib/set/Set#constructor - local.set $1 - loop $repeat|0 - local.get $0 - f32.const 100 - f32.lt - if + local.set $0 + block $break|0 + f32.const 0 + local.set $1 + loop $repeat|0 local.get $1 + f32.const 100 + f32.lt + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - f32.const 1 - f32.add - local.set $0 - br $repeat|0 - else - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + f32.const 1 + f32.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable end - f32.const 50 - local.set $0 - loop $repeat|1 - local.get $0 - f32.const 100 - f32.lt - if + block $break|1 + f32.const 50 + local.set $1 + loop $repeat|1 local.get $1 + f32.const 100 + f32.lt + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 16 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - f32.const 1 - f32.add - local.set $0 - br $repeat|1 - else - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + f32.const 1 + f32.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable end - f32.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - f32.const 50 - f32.lt - if + block $break|2 + f32.const 0 + local.set $1 + loop $repeat|2 local.get $1 + f32.const 50 + f32.lt + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 24 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - f32.const 1 - f32.add - local.set $0 - br $repeat|2 - end + f32.const 1 + f32.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable end - f32.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - f32.const 50 - f32.lt - if + block $break|3 + f32.const 0 + local.set $1 + loop $repeat|3 local.get $1 + f32.const 50 + f32.lt + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 32 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 - call $~lib/set/Set#add local.get $1 + call $~lib/set/Set#delete + drop local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 34 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - f32.const 1 - f32.add - local.set $0 - br $repeat|3 - end + f32.const 1 + f32.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/set/Set#clear - local.get $1 - i32.load offset=20 - if - i32.const 0 - i32.const 136 - i32.const 42 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/set/Set#constructor (; 61 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 24 - call $~lib/util/runtime/allocate - i32.const 26 - call $~lib/util/runtime/register - local.tee $0 + local.get $0 + call $~lib/set/Set#clear + local.get $0 + call $~lib/set/Set#get:size i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/purerc/__release + ) + (func $~lib/set/Set#clear (; 101 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.tee $1 + block (result i32) + local.get $1 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store local.get $0 - i32.const 0 + i32.const 4 + i32.const 1 + i32.sub i32.store offset=4 local.get $0 - i32.const 0 + local.tee $1 + block (result i32) + local.get $1 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor + end i32.store offset=8 local.get $0 - i32.const 0 + i32.const 4 i32.store offset=12 local.get $0 i32.const 0 @@ -5200,62 +8436,105 @@ local.get $0 i32.const 0 i32.store offset=20 - local.get $0 - call $~lib/set/Set#clear + ) + (func $~lib/set/Set#constructor (; 102 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + block (result i32) + local.get $0 + i32.eqz + if + i32.const 24 + i32.const 26 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + end + call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 62 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 103 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (local $3 i32) local.get $0 i32.load + local.get $2 local.get $0 i32.load offset=4 - local.get $2 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add i32.load - local.set $0 - loop $continue|0 - local.get $0 - if - local.get $0 - i32.load offset=8 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $0 - f64.load - local.get $1 - f64.eq - end + local.set $3 + block $break|0 + loop $continue|0 + local.get $3 if - local.get $0 - return + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + f64.load + local.get $1 + f64.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $continue|0 end - local.get $0 - i32.load offset=8 - i32.const -2 - i32.and - local.set $0 - br $continue|0 end end i32.const 0 ) - (func $~lib/set/Set#has (; 63 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/set/Set#has (; 104 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (local $2 f64) local.get $0 local.get $1 - local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 64 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 105 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5263,113 +8542,160 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 f64) + (local $12 i32) + (local $13 i32) local.get $1 i32.const 1 i32.add - local.tee $4 - i32.const 2 - i32.shl + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $4 + local.set $3 + local.get $2 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $6 - i32.const 4 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor local.set $4 + i32.const 0 + local.get $4 + block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) + i32.const 16 + end + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 local.get $0 i32.load offset=8 - local.tee $2 + local.set $6 + local.get $6 local.get $0 i32.load offset=16 - i32.const 4 - i32.shl + block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) + i32.const 16 + end + i32.mul i32.add local.set $7 - local.get $4 - local.set $3 - loop $continue|0 - local.get $2 - local.get $7 - i32.ne - if - local.get $2 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz + local.get $5 + local.set $8 + block $break|0 + loop $continue|0 + local.get $6 + local.get $7 + i32.ne if - local.get $3 - local.get $2 - f64.load - f64.store - local.get $3 - local.get $2 - f64.load - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - local.get $1 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 i32.and - i32.const 2 - i32.shl - local.get $5 + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + f64.load + f64.store + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + f64.load + local.set $11 + local.get $11 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 + end + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=8 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) + i32.const 16 + end + i32.add + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end i32.add - local.tee $8 - i32.load - i32.store offset=8 - local.get $8 - local.get $3 - i32.store - local.get $3 - i32.const 16 - i32.add - local.set $3 + local.set $6 + br $continue|0 end - local.get $2 - i32.const 16 - i32.add - local.set $2 - br $continue|0 end end local.get $0 + local.tee $9 + local.get $3 + local.get $9 i32.load - drop - local.get $0 - local.get $5 + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + local.tee $9 + local.get $5 + local.get $9 i32.load offset=8 - drop - local.get $0 - local.get $4 + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 - local.get $6 + local.get $4 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 65 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) - (local $2 i32) + (func $~lib/set/Set#add (; 106 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (local $2 f64) (local $3 i32) (local $4 i32) + (local $5 i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 local.get $0 local.get $1 - local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - local.tee $3 + local.get $3 call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -5403,20 +8729,23 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $4 - i32.const 1 + block (result i32) + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $5 + i32.const 1 + i32.add + i32.store offset=16 + local.get $5 + end + block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) + i32.const 16 + end + i32.mul i32.add - i32.store offset=16 + local.set $4 local.get $4 - i32.const 4 - i32.shl - local.get $2 - i32.add - local.tee $2 local.get $1 f64.store local.get $0 @@ -5425,40 +8754,55 @@ i32.const 1 i32.add i32.store offset=20 - local.get $2 local.get $0 i32.load + local.get $3 local.get $0 i32.load offset=4 - local.get $3 i32.and - i32.const 2 - i32.shl + i32.const 4 + i32.mul i32.add - local.tee $0 + local.set $5 + local.get $4 + local.get $5 i32.load i32.store offset=8 - local.get $0 - local.get $2 + local.get $5 + local.get $4 i32.store end ) - (func $~lib/set/Set#delete (; 66 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) - (local $2 i32) + (func $~lib/set/Set#get:size (; 107 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=20 + ) + (func $~lib/set/Set#delete (; 108 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (local $2 f64) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 local.get $1 - local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + local.get $2 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.3 + end call $~lib/set/Set#find - local.tee $2 + local.set $3 + local.get $3 i32.eqz if + i32.const 0 return end - local.get $2 - local.get $2 + local.get $3 + local.get $3 i32.load offset=8 i32.const 1 i32.or @@ -5473,15 +8817,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.tee $3 + local.set $4 + local.get $4 i32.const 1 i32.add i32.const 4 + local.tee $5 local.get $0 i32.load offset=20 - local.tee $2 - i32.const 4 - local.get $2 + local.tee $6 + local.get $5 + local.get $6 i32.gt_u select i32.ge_u @@ -5500,429 +8846,289 @@ end if local.get $0 - local.get $3 + local.get $4 call $~lib/set/Set#rehash end + i32.const 1 ) - (func $std/set/testNumeric (; 67 ;) (type $FUNCSIG$v) - (local $0 f64) - (local $1 i32) + (func $std/set/testNumeric (; 109 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 f64) + i32.const 0 call $~lib/set/Set#constructor - local.set $1 - loop $repeat|0 - local.get $0 - f64.const 100 - f64.lt - if + local.set $0 + block $break|0 + f64.const 0 + local.set $1 + loop $repeat|0 local.get $1 + f64.const 100 + f64.lt + i32.eqz + br_if $break|0 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 8 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - f64.const 1 - f64.add - local.set $0 - br $repeat|0 - else - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + f64.const 1 + f64.add + local.set $1 + br $repeat|0 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable end - f64.const 50 - local.set $0 - loop $repeat|1 - local.get $0 - f64.const 100 - f64.lt - if + block $break|1 + f64.const 50 + local.set $1 + loop $repeat|1 local.get $1 + f64.const 100 + f64.lt + i32.eqz + br_if $break|1 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 16 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#add - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - local.get $0 - f64.const 1 - f64.add - local.set $0 - br $repeat|1 - else - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + f64.const 1 + f64.add + local.set $1 + br $repeat|1 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 100 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable end - f64.const 0 - local.set $0 - loop $repeat|2 - local.get $0 - f64.const 50 - f64.lt - if + block $break|2 + f64.const 0 + local.set $1 + loop $repeat|2 local.get $1 + f64.const 50 + f64.lt + i32.eqz + br_if $break|2 local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 24 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - f64.const 1 - f64.add - local.set $0 - br $repeat|2 - end + f64.const 1 + f64.add + local.set $1 + br $repeat|2 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable end - f64.const 0 - local.set $0 - loop $repeat|3 - local.get $0 - f64.const 50 - f64.lt - if + block $break|3 + f64.const 0 + local.set $1 + loop $repeat|3 local.get $1 + f64.const 50 + f64.lt + i32.eqz + br_if $break|3 local.get $0 + local.get $1 call $~lib/set/Set#has + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 i32.const 32 i32.const 4 call $~lib/builtins/abort unreachable end - local.get $1 local.get $0 - call $~lib/set/Set#add local.get $1 + call $~lib/set/Set#delete + drop local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz + i32.eqz if i32.const 0 - i32.const 136 + i32.const 232 i32.const 34 i32.const 4 call $~lib/builtins/abort unreachable end local.get $1 - local.get $0 - call $~lib/set/Set#delete - local.get $1 - local.get $0 - call $~lib/set/Set#has - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - else - local.get $0 - f64.const 1 - f64.add - local.set $0 - br $repeat|3 - end + f64.const 1 + f64.add + local.set $1 + br $repeat|3 unreachable end + unreachable end - local.get $1 - i32.load offset=20 + local.get $0 + call $~lib/set/Set#get:size i32.const 50 - i32.ne + i32.eq + i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/set/Set#clear - local.get $1 - i32.load offset=20 - if - i32.const 0 - i32.const 136 - i32.const 42 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/runtime/runtime.instanceof (; 68 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.const 16 - i32.sub - i32.load - local.tee $0 - if (result i32) - local.get $0 - i32.const 160 - i32.load - i32.le_u - else - i32.const 0 - end - if - loop $continue|0 - local.get $0 - local.get $1 - i32.eq - if - i32.const 1 - return - end - local.get $0 - i32.const 3 - i32.shl - i32.const 160 - i32.add - i32.load offset=4 - local.tee $0 - br_if $continue|0 - end - end + call $~lib/set/Set#clear + local.get $0 + call $~lib/set/Set#get:size i32.const 0 - ) - (func $~lib/runtime/runtime.flags (; 69 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - if (result i32) - local.get $0 - i32.const 160 - i32.load - i32.gt_u - else - i32.const 1 - end - if (result i32) - unreachable - else - local.get $0 - i32.const 3 - i32.shl - i32.const 160 - i32.add - i32.load - end - ) - (func $~lib/runtime/runtime.newObject (; 70 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - call $~lib/util/runtime/allocate - local.get $1 - call $~lib/util/runtime/register - ) - (func $~lib/runtime/runtime.newString (; 71 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 1 - i32.shl - i32.const 16 - call $~lib/runtime/runtime.newObject - ) - (func $~lib/runtime/runtime.newArrayBuffer (; 72 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 15 - call $~lib/runtime/runtime.newObject - ) - (func $~lib/runtime/runtime.newArray (; 73 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - local.tee $2 - if (result i32) - local.get $2 - i32.const 160 - i32.load - i32.gt_u - else - i32.const 1 - end - if (result i32) - unreachable - else - local.get $2 - i32.const 3 - i32.shl - i32.const 160 - i32.add - i32.load - end - local.tee $0 - i32.const 16 - i32.div_u - i32.const 31 - i32.and - local.set $4 - local.get $1 - if (result i32) - local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - else - i32.const 0 - call $~lib/runtime/runtime.newArrayBuffer - local.set $1 - i32.const 0 - end - local.set $3 - local.get $2 - i32.const 16 - call $~lib/runtime/runtime.newObject - local.tee $2 - i32.load - drop - local.get $2 - local.get $1 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - local.get $3 - i32.store offset=8 - local.get $2 - local.get $3 - local.get $4 - i32.shr_u - i32.store offset=12 - local.get $0 - i32.const 1024 - i32.and + i32.eq + i32.eqz if - local.get $1 - local.get $3 - i32.add - local.set $0 - loop $continue|0 - local.get $1 - local.get $0 - i32.lt_u - if - local.get $1 - i32.load - drop - local.get $1 - i32.const 4 - i32.add - local.set $1 - br $continue|0 - end - end + i32.const 0 + i32.const 232 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable end - local.get $2 + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/runtime/runtime.retain (; 74 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/runtime/runtime.collect (; 75 ;) (type $FUNCSIG$v) - nop - ) - (func $start (; 76 ;) (type $FUNCSIG$v) - i32.const 392 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (func $start:std/set (; 110 ;) (type $FUNCSIG$v) call $std/set/testNumeric call $std/set/testNumeric call $std/set/testNumeric @@ -5933,10 +9139,1175 @@ call $std/set/testNumeric call $std/set/testNumeric call $std/set/testNumeric + ) + (func $start (; 111 ;) (type $FUNCSIG$v) + call $start:std/set + ) + (func $~lib/rt/purerc/increment (; 112 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 113 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 114 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 115 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 328 + i32.const 384 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 116 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/purerc/growRoots (; 117 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 i32.const 0 - call $~lib/util/runtime/allocate - i32.const 28 - call $~lib/util/runtime/register - global.set $~lib/runtime/ROOT + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 118 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 119 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__retainRelease (; 120 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.ne + if + global.get $~lib/builtins/HEAP_BASE + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + local.get $2 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + end + local.get $0 + ) + (func $~lib/rt/purerc/__release (; 121 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/purerc/markGray (; 122 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 123 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 124 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 125 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 126 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/set/Set#__visit_impl (; 127 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 128 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 129 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 130 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 131 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 132 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 133 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 134 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 135 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 136 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/builtins/__visit_members (; 137 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$28 + block $switch$1$case$27 + block $switch$1$case$26 + block $switch$1$case$25 + block $switch$1$case$24 + block $switch$1$case$23 + block $switch$1$case$22 + block $switch$1$case$21 + block $switch$1$case$20 + block $switch$1$case$19 + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$19 $switch$1$case$20 $switch$1$case$21 $switch$1$case$22 $switch$1$case$23 $switch$1$case$24 $switch$1$case$25 $switch$1$case$26 $switch$1$case$27 $switch$1$case$28 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 138 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/set.ts b/tests/compiler/std/set.ts index d31b40cd..76c61b97 100644 --- a/tests/compiler/std/set.ts +++ b/tests/compiler/std/set.ts @@ -1,5 +1,3 @@ -import "collector/dummy"; - function testNumeric(): void { var set = new Set(); diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index 02b1cb55..87ae76e2 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -1,12 +1,12 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$iij (func (param i32 i64) (result i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$iiji (func (param i32 i64 i32) (result i32))) @@ -18,506 +18,1670 @@ (type $FUNCSIG$iidi (func (param i32 f64 i32) (result i32))) (type $FUNCSIG$vid (func (param i32 f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00(\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00") - (data (i32.const 64) "\10\00\00\00&\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 120) "\10\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00s\00t\00d\00/\00s\00e\00t\00.\00t\00s\00") - (data (i32.const 160) "\1c\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\1a\00\00\00\00\00\00\00\1a\00\00\00\00\00\00\00*\00\00\00\00\00\00\00*\00\00\00\00\00\00\00J\00\00\00\00\00\00\00J\00\00\00\00\00\00\00\8a\00\00\00\00\00\00\00\8a\00\00\00\00\00\00\00J\00\00\00\00\00\00\00\8a\00\00\00\00\00\00\00I\00\00\00\0e\00\00\00\08\00\00\00\00\00\00\00") + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\10\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 56) "&\00\00\00\01\00\00\00\10\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 160) "(\00\00\00\01\00\00\00\10\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\10\00\00\00\14\00\00\00s\00t\00d\00/\00s\00e\00t\00.\00t\00s\00") + (data (i32.const 256) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 312) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 368) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00") + (data (i32.const 424) "\1a\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\1a\00\00\00\00\00\00\00\1a\00\00\00\00\00\00\00*\00\00\00\00\00\00\00*\00\00\00\00\00\00\00J\00\00\00\00\00\00\00J\00\00\00\00\00\00\00\8a\00\00\00\00\00\00\00\8a\00\00\00\00\00\00\00J\00\00\00\00\00\00\00\8a\00\00\00\00\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/util/runtime/HEADER_SIZE i32 (i32.const 16)) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/util/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) - (global $~lib/ASC_NO_ASSERT i32 (i32.const 0)) - (global $~lib/util/runtime/MAX_BYTELENGTH i32 (i32.const 1073741808)) - (global $~lib/runtime/ROOT (mut i32) (i32.const 0)) - (global $~lib/runtime/RTTI_BASE i32 (i32.const 160)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 392)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/END (mut i32) (i32.const 0)) + (global $~lib/rt/purerc/ROOTS (mut i32) (i32.const 0)) + (global $~lib/builtins/RTTI_BASE i32 (i32.const 424)) + (global $~lib/builtins/HEAP_BASE i32 (i32.const 640)) (export "memory" (memory $0)) - (export "$.instanceof" (func $~lib/runtime/runtime.instanceof)) - (export "$.flags" (func $~lib/runtime/runtime.flags)) - (export "$.newObject" (func $~lib/runtime/runtime.newObject)) - (export "$.newString" (func $~lib/runtime/runtime.newString)) - (export "$.newArrayBuffer" (func $~lib/runtime/runtime.newArrayBuffer)) - (export "$.newArray" (func $~lib/runtime/runtime.newArray)) - (export "$.retain" (func $~lib/runtime/runtime.retain)) - (export "$.release" (func $~lib/runtime/runtime.release)) - (export "$.collect" (func $~lib/runtime/runtime.collect)) (start $start) - (func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/removeBlock (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 i32.const 1 - i32.const 32 - local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 275 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 277 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 290 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $8 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $8 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $8 + local.set $9 + local.get $11 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store offset=4 + end + local.get $8 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end ) - (func $~lib/allocator/arena/__mem_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/insertBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 203 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 205 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + end + local.set $3 + local.get $3 + i32.load + local.set $6 + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 226 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $3 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 241 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 258 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + local.set $7 + local.get $3 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $1 + local.set $7 + local.get $12 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 6 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 384 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 394 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 406 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 7 ;) (type $FUNCSIG$v) + (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 - local.get $2 - local.get $3 - i32.gt_u - select + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/builtins/HEAP_BASE + i32.const 15 i32.add - i32.const 7 - i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 + local.set $0 current_memory - local.set $5 - local.get $4 - local.get $5 + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and i32.const 16 - i32.shl - i32.gt_u - if - local.get $4 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 local.get $1 i32.sub - i32.const 65535 + grow_memory + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $4 + loop $repeat|0 + local.get $4 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + current_memory + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 446 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 336 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl i32.add - i32.const 65535 + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 i32.const -1 i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $2 - local.get $5 - local.tee $3 local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $4 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 349 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $5 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $5 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $5 + local.get $6 + i32.ctz + local.set $4 + local.get $8 + local.get $5 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + current_memory + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if local.get $3 grow_memory i32.const 0 i32.lt_s if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end + unreachable end end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/memory/memory.allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + current_memory + local.set $7 local.get $0 - call $~lib/allocator/arena/__mem_allocate - return - ) - (func $~lib/util/runtime/allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - call $~lib/util/runtime/adjust - call $~lib/memory/memory.allocate - local.set $1 - local.get $1 - global.get $~lib/util/runtime/HEADER_MAGIC - i32.store - local.get $1 - local.get $0 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.store offset=8 - local.get $1 - i32.const 0 - i32.store offset=12 - local.get $1 - global.get $~lib/util/runtime/HEADER_SIZE - i32.add - ) - (func $~lib/collector/dummy/__ref_register (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/util/runtime/register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $0 - global.get $~lib/memory/HEAP_BASE - i32.gt_u - i32.eqz - if - i32.const 0 - i32.const 24 - i32.const 129 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.sub - local.set $2 local.get $2 - i32.load - global.get $~lib/util/runtime/HEADER_MAGIC - i32.eq - i32.eqz - if - i32.const 0 - i32.const 24 - i32.const 131 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $2 - local.get $1 - i32.store - local.get $0 - call $~lib/collector/dummy/__ref_register - local.get $0 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop ) - (func $~lib/memory/memory.fill (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/prepareBlock (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i64) - block $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 363 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 476 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 478 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 i32.eqz if br $~lib/util/memory/memset|inlined.0 end - local.get $0 - local.get $1 + local.get $5 + local.get $4 i32.store8 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 1 i32.sub - local.get $1 + local.get $4 i32.store8 - local.get $2 + local.get $3 i32.const 2 i32.le_u if br $~lib/util/memory/memset|inlined.0 end - local.get $0 + local.get $5 i32.const 1 i32.add - local.get $1 + local.get $4 i32.store8 - local.get $0 + local.get $5 i32.const 2 i32.add - local.get $1 + local.get $4 i32.store8 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 2 i32.sub - local.get $1 + local.get $4 i32.store8 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 3 i32.sub - local.get $1 + local.get $4 i32.store8 - local.get $2 + local.get $3 i32.const 6 i32.le_u if br $~lib/util/memory/memset|inlined.0 end - local.get $0 + local.get $5 i32.const 3 i32.add - local.get $1 + local.get $4 i32.store8 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 4 i32.sub - local.get $1 + local.get $4 i32.store8 - local.get $2 + local.get $3 i32.const 8 i32.le_u if br $~lib/util/memory/memset|inlined.0 end i32.const 0 - local.get $0 + local.get $5 i32.sub i32.const 3 i32.and - local.set $5 - local.get $0 + local.set $6 local.get $5 + local.get $6 i32.add - local.set $0 - local.get $2 - local.get $5 + local.set $5 + local.get $3 + local.get $6 i32.sub - local.set $2 - local.get $2 + local.set $3 + local.get $3 i32.const -4 i32.and - local.set $2 + local.set $3 i32.const -1 i32.const 255 i32.div_u - local.get $1 + local.get $4 i32.const 255 i32.and i32.mul - local.set $4 - local.get $0 - local.get $4 + local.set $7 + local.get $5 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 4 i32.sub - local.get $4 + local.get $7 i32.store - local.get $2 + local.get $3 i32.const 8 i32.le_u if br $~lib/util/memory/memset|inlined.0 end - local.get $0 + local.get $5 i32.const 4 i32.add - local.get $4 + local.get $7 i32.store - local.get $0 + local.get $5 i32.const 8 i32.add - local.get $4 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 12 i32.sub - local.get $4 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 8 i32.sub - local.get $4 + local.get $7 i32.store - local.get $2 + local.get $3 i32.const 24 i32.le_u if br $~lib/util/memory/memset|inlined.0 end - local.get $0 + local.get $5 i32.const 12 i32.add - local.get $4 + local.get $7 i32.store - local.get $0 + local.get $5 i32.const 16 i32.add - local.get $4 + local.get $7 i32.store - local.get $0 + local.get $5 i32.const 20 i32.add - local.get $4 + local.get $7 i32.store - local.get $0 + local.get $5 i32.const 24 i32.add - local.get $4 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 28 i32.sub - local.get $4 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 24 i32.sub - local.get $4 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 20 i32.sub - local.get $4 + local.get $7 i32.store - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.add i32.const 16 i32.sub - local.get $4 + local.get $7 i32.store i32.const 24 - local.get $0 + local.get $5 i32.const 4 i32.and i32.add - local.set $5 - local.get $0 + local.set $6 local.get $5 + local.get $6 i32.add - local.set $0 - local.get $2 - local.get $5 + local.set $5 + local.get $3 + local.get $6 i32.sub - local.set $2 - local.get $4 + local.set $3 + local.get $7 i64.extend_i32_u - local.get $4 + local.get $7 i64.extend_i32_u i64.const 32 i64.shl i64.or - local.set $6 + local.set $8 block $break|0 loop $continue|0 - local.get $2 + local.get $3 i32.const 32 i32.ge_u if - block - local.get $0 - local.get $6 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $6 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $6 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $6 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 br $continue|0 end end end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 - global.get $~lib/util/runtime/MAX_BYTELENGTH + i32.const 1073741808 i32.gt_u if - i32.const 0 - i32.const 80 - i32.const 54 - i32.const 43 + i32.const 24 + i32.const 72 + i32.const 56 + i32.const 42 call $~lib/builtins/abort unreachable end local.get $1 - call $~lib/util/runtime/allocate + i32.const 15 + call $~lib/rt/tlsf/__alloc local.set $2 local.get $2 i32.const 0 local.get $1 call $~lib/memory/memory.fill local.get $2 - i32.const 15 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/collector/dummy/__ref_link (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - nop - ) - (func $~lib/collector/dummy/__ref_unlink (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - nop - ) - (func $~lib/set/Set#clear (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -527,27 +1691,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 32 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -560,15 +1710,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 17 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -594,14 +1744,14 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash8 (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash8 (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const -2128831035 local.get $0 i32.xor i32.const 16777619 i32.mul ) - (func $~lib/set/Set#find (; 14 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 19 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -618,43 +1768,41 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load8_s - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i32.load8_s + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -673,7 +1821,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 21 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -729,59 +1877,57 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load8_s + i32.store8 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load8_s - i32.store8 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load8_s - local.set $11 - local.get $11 - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load - i32.store offset=4 - local.get $12 - local.get $8 - i32.store - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end + i32.add + local.set $6 br $continue|0 end end @@ -789,25 +1935,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $12 local.get $9 i32.load - local.tee $11 - i32.ne - if (result i32) - local.get $11 - if - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -815,25 +1945,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $11 local.get $9 i32.load offset=8 - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $11 - else - local.get $11 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -842,12 +1956,15 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 22 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $2 @@ -899,17 +2016,15 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $2 block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $2 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $2 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 @@ -935,21 +2050,21 @@ i32.const 4 i32.mul i32.add - local.set $5 + local.set $2 local.get $4 - local.get $5 + local.get $2 i32.load i32.store offset=4 - local.get $5 + local.get $2 local.get $4 i32.store end ) - (func $~lib/set/Set#get:size (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1025,7 +2140,7 @@ end i32.const 1 ) - (func $std/set/testNumeric (; 20 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 25 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -1040,35 +2155,33 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1086,8 +2199,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable @@ -1101,34 +2214,32 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1146,8 +2257,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable @@ -1161,36 +2272,34 @@ i32.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 24 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1208,8 +2317,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable @@ -1223,52 +2332,50 @@ i32.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 34 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1286,8 +2393,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable @@ -1301,40 +2408,26 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 42 + i32.const 232 + i32.const 40 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#clear (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -1344,27 +2437,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 32 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -1377,15 +2456,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 18 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -1411,7 +2490,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 23 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 28 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -1428,41 +2507,39 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 + i32.load8_u + local.get $1 + i32.const 255 i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load8_u - local.get $1 - i32.const 255 - i32.and - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -1479,7 +2556,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1535,59 +2612,57 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load8_u + i32.store8 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load8_u - i32.store8 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load8_u - local.set $11 - local.get $11 - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load - i32.store offset=4 - local.get $12 - local.get $8 - i32.store - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end + i32.add + local.set $6 br $continue|0 end end @@ -1595,25 +2670,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $12 local.get $9 i32.load - local.tee $11 - i32.ne - if (result i32) - local.get $11 - if - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -1621,25 +2680,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $11 local.get $9 i32.load offset=8 - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $11 - else - local.get $11 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -1648,12 +2691,15 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 26 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $2 @@ -1703,17 +2749,15 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $2 block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $2 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $2 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 @@ -1739,21 +2783,21 @@ i32.const 4 i32.mul i32.add - local.set $5 + local.set $2 local.get $4 - local.get $5 + local.get $2 i32.load i32.store offset=4 - local.get $5 + local.get $2 local.get $4 i32.store end ) - (func $~lib/set/Set#get:size (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1827,7 +2871,7 @@ end i32.const 1 ) - (func $std/set/testNumeric (; 29 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 34 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -1842,35 +2886,33 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1888,8 +2930,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable @@ -1903,34 +2945,32 @@ i32.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1948,8 +2988,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable @@ -1963,36 +3003,34 @@ i32.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 24 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2010,8 +3048,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable @@ -2025,52 +3063,50 @@ i32.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 34 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2088,8 +3124,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable @@ -2103,40 +3139,26 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 42 + i32.const 232 + i32.const 40 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#clear (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -2146,27 +3168,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 32 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -2179,15 +3187,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 19 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -2213,7 +3221,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash16 (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash16 (; 37 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -2235,7 +3243,7 @@ local.set $1 local.get $1 ) - (func $~lib/set/Set#find (; 33 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 38 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -2252,43 +3260,41 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load16_s - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i32.load16_s + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -2307,7 +3313,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 40 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2363,59 +3369,57 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load16_s + i32.store16 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load16_s - i32.store16 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load16_s - local.set $11 - local.get $11 - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load - i32.store offset=4 - local.get $12 - local.get $8 - i32.store - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end + i32.add + local.set $6 br $continue|0 end end @@ -2423,25 +3427,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $12 local.get $9 i32.load - local.tee $11 - i32.ne - if (result i32) - local.get $11 - if - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -2449,25 +3437,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $11 local.get $9 i32.load offset=8 - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $11 - else - local.get $11 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -2476,12 +3448,15 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 36 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 41 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $2 @@ -2533,17 +3508,15 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $2 block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $2 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $2 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 @@ -2569,21 +3542,21 @@ i32.const 4 i32.mul i32.add - local.set $5 + local.set $2 local.get $4 - local.get $5 + local.get $2 i32.load i32.store offset=4 - local.get $5 + local.get $2 local.get $4 i32.store end ) - (func $~lib/set/Set#get:size (; 37 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2659,7 +3632,7 @@ end i32.const 1 ) - (func $std/set/testNumeric (; 39 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 44 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -2674,35 +3647,33 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2720,8 +3691,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable @@ -2735,34 +3706,32 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2780,8 +3749,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable @@ -2795,36 +3764,34 @@ i32.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 24 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2842,8 +3809,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable @@ -2857,52 +3824,50 @@ i32.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 34 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2920,8 +3885,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable @@ -2935,40 +3900,26 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 42 + i32.const 232 + i32.const 40 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#clear (; 40 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 45 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -2978,27 +3929,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 32 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -3011,15 +3948,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 41 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 46 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 20 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -3045,7 +3982,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 42 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 47 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -3062,41 +3999,39 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 + i32.load16_u + local.get $1 + i32.const 65535 i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load16_u - local.get $1 - i32.const 65535 - i32.and - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -3113,7 +4048,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 44 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 49 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3169,59 +4104,57 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load16_u + i32.store16 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load16_u - i32.store16 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load16_u - local.set $11 - local.get $11 - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load - i32.store offset=4 - local.get $12 - local.get $8 - i32.store - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end + i32.add + local.set $6 br $continue|0 end end @@ -3229,25 +4162,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $12 local.get $9 i32.load - local.tee $11 - i32.ne - if (result i32) - local.get $11 - if - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -3255,25 +4172,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $11 local.get $9 i32.load offset=8 - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $11 - else - local.get $11 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -3282,12 +4183,15 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 45 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 50 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $2 @@ -3337,17 +4241,15 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $2 block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $2 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $2 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 @@ -3373,21 +4275,21 @@ i32.const 4 i32.mul i32.add - local.set $5 + local.set $2 local.get $4 - local.get $5 + local.get $2 i32.load i32.store offset=4 - local.get $5 + local.get $2 local.get $4 i32.store end ) - (func $~lib/set/Set#get:size (; 46 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 51 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 52 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3461,7 +4363,7 @@ end i32.const 1 ) - (func $std/set/testNumeric (; 48 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 53 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -3476,35 +4378,33 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3522,8 +4422,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable @@ -3537,34 +4437,32 @@ i32.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3582,8 +4480,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable @@ -3597,36 +4495,34 @@ i32.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 24 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3644,8 +4540,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable @@ -3659,52 +4555,50 @@ i32.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 34 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3722,8 +4616,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable @@ -3737,40 +4631,26 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 42 + i32.const 232 + i32.const 40 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#clear (; 49 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 54 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -3780,27 +4660,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 32 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -3813,15 +4679,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 50 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 55 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 21 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -3847,7 +4713,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash32 (; 51 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 56 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -3889,7 +4755,7 @@ local.set $1 local.get $1 ) - (func $~lib/set/Set#find (; 52 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 57 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -3906,39 +4772,37 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load - local.get $1 - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i32.load + local.get $1 + i32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -3953,7 +4817,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 54 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 59 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4009,59 +4873,57 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load + i32.store + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load - i32.store - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load - local.set $11 - local.get $11 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load - i32.store offset=4 - local.get $12 - local.get $8 - i32.store - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end + i32.add + local.set $6 br $continue|0 end end @@ -4069,25 +4931,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $12 local.get $9 i32.load - local.tee $11 - i32.ne - if (result i32) - local.get $11 - if - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -4095,25 +4941,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $11 local.get $9 i32.load offset=8 - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $11 - else - local.get $11 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -4122,12 +4952,15 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 55 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 60 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $2 @@ -4175,17 +5008,15 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $2 block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $2 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $2 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 @@ -4211,21 +5042,21 @@ i32.const 4 i32.mul i32.add - local.set $5 + local.set $2 local.get $4 - local.get $5 + local.get $2 i32.load i32.store offset=4 - local.get $5 + local.get $2 local.get $4 i32.store end ) - (func $~lib/set/Set#get:size (; 56 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 61 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 57 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 62 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4297,7 +5128,7 @@ end i32.const 1 ) - (func $std/set/testNumeric (; 58 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 63 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -4312,35 +5143,33 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4358,8 +5187,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable @@ -4373,34 +5202,32 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4418,8 +5245,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable @@ -4433,36 +5260,34 @@ i32.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 24 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4480,8 +5305,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable @@ -4495,52 +5320,50 @@ i32.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 34 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4558,8 +5381,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable @@ -4573,40 +5396,26 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 42 + i32.const 232 + i32.const 40 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#clear (; 59 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 64 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -4616,27 +5425,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 32 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -4649,15 +5444,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 60 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 65 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 22 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -4683,7 +5478,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 66 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -4700,39 +5495,37 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load - local.get $1 - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i32.load + local.get $1 + i32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 62 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 67 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -4747,7 +5540,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 63 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 68 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4803,59 +5596,57 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load + i32.store + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load - i32.store - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load - local.set $11 - local.get $11 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load - i32.store offset=4 - local.get $12 - local.get $8 - i32.store - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end + i32.add + local.set $6 br $continue|0 end end @@ -4863,25 +5654,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $12 local.get $9 i32.load - local.tee $11 - i32.ne - if (result i32) - local.get $11 - if - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -4889,25 +5664,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $11 local.get $9 i32.load offset=8 - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $11 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $11 - else - local.get $11 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -4916,12 +5675,15 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 64 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 69 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $2 @@ -4969,17 +5731,15 @@ end local.get $0 i32.load offset=8 - local.set $2 - local.get $2 block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $2 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $2 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 @@ -5005,21 +5765,21 @@ i32.const 4 i32.mul i32.add - local.set $5 + local.set $2 local.get $4 - local.get $5 + local.get $2 i32.load i32.store offset=4 - local.get $5 + local.get $2 local.get $4 i32.store end ) - (func $~lib/set/Set#get:size (; 65 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 70 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 66 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 71 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5091,7 +5851,7 @@ end i32.const 1 ) - (func $std/set/testNumeric (; 67 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 72 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -5106,35 +5866,33 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5152,8 +5910,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable @@ -5167,34 +5925,32 @@ i32.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5212,8 +5968,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable @@ -5227,36 +5983,34 @@ i32.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 24 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5274,8 +6028,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable @@ -5289,52 +6043,50 @@ i32.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 34 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5352,8 +6104,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable @@ -5367,40 +6119,26 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 42 + i32.const 232 + i32.const 40 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#clear (; 68 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 73 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -5410,27 +6148,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 64 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -5443,15 +6167,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 69 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 74 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 23 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -5477,7 +6201,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash64 (; 70 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/hash64 (; 75 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -5565,7 +6289,7 @@ local.set $3 local.get $3 ) - (func $~lib/set/Set#find (; 71 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 76 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -5582,39 +6306,37 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i64.load - local.get $1 - i64.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i64.load + local.get $1 + i64.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 72 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#has (; 77 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) local.get $0 local.get $1 @@ -5629,7 +6351,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 73 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 78 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5686,59 +6408,57 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i64.load + i64.store + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i64.load - i64.store - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i64.load - local.set $11 - local.get $11 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load - i32.store offset=8 - local.get $13 - local.get $8 - i32.store - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 16 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=8 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end + i32.add + local.set $6 br $continue|0 end end @@ -5746,25 +6466,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $13 local.get $9 i32.load - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $13 - else - local.get $13 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -5772,25 +6476,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $12 local.get $9 i32.load offset=8 - local.tee $13 - i32.ne - if (result i32) - local.get $13 - if - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -5799,13 +6487,16 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 74 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/set/Set#add (; 79 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) (local $2 i64) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $2 @@ -5853,17 +6544,15 @@ end local.get $0 i32.load offset=8 - local.set $5 - local.get $5 block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $6 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - local.get $6 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 16 @@ -5889,21 +6578,21 @@ i32.const 4 i32.mul i32.add - local.set $6 + local.set $5 local.get $4 - local.get $6 + local.get $5 i32.load i32.store offset=8 - local.get $6 + local.get $5 local.get $4 i32.store end ) - (func $~lib/set/Set#get:size (; 75 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 80 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 76 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#delete (; 81 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) (local $4 i32) @@ -5976,7 +6665,7 @@ end i32.const 1 ) - (func $std/set/testNumeric (; 77 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 82 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i64) i32.const 0 @@ -5991,35 +6680,33 @@ i64.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6037,8 +6724,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable @@ -6052,34 +6739,32 @@ i64.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6097,8 +6782,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable @@ -6112,36 +6797,34 @@ i64.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 24 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6159,8 +6842,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable @@ -6174,52 +6857,50 @@ i64.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 34 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6237,8 +6918,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable @@ -6252,40 +6933,26 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 42 + i32.const 232 + i32.const 40 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#clear (; 78 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 83 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -6295,27 +6962,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 64 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -6328,15 +6981,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 79 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 84 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 24 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -6362,7 +7015,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 80 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 85 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -6379,39 +7032,37 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i64.load - local.get $1 - i64.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i64.load + local.get $1 + i64.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 81 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#has (; 86 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) local.get $0 local.get $1 @@ -6426,7 +7077,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 82 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 87 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6483,59 +7134,57 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i64.load + i64.store + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i64.load - i64.store - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - i64.load - local.set $11 - local.get $11 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load - i32.store offset=8 - local.get $13 - local.get $8 - i32.store - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 16 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=8 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end + i32.add + local.set $6 br $continue|0 end end @@ -6543,25 +7192,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $13 local.get $9 i32.load - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $13 - else - local.get $13 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -6569,25 +7202,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $12 local.get $9 i32.load offset=8 - local.tee $13 - i32.ne - if (result i32) - local.get $13 - if - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -6596,13 +7213,16 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 83 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/set/Set#add (; 88 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) (local $2 i64) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $2 @@ -6650,17 +7270,15 @@ end local.get $0 i32.load offset=8 - local.set $5 - local.get $5 block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $6 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - local.get $6 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 16 @@ -6686,21 +7304,21 @@ i32.const 4 i32.mul i32.add - local.set $6 + local.set $5 local.get $4 - local.get $6 + local.get $5 i32.load i32.store offset=8 - local.get $6 + local.get $5 local.get $4 i32.store end ) - (func $~lib/set/Set#get:size (; 84 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 89 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 85 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#delete (; 90 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) (local $4 i32) @@ -6773,7 +7391,7 @@ end i32.const 1 ) - (func $std/set/testNumeric (; 86 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 91 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i64) i32.const 0 @@ -6788,35 +7406,33 @@ i64.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6834,8 +7450,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable @@ -6849,34 +7465,32 @@ i64.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6894,8 +7508,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable @@ -6909,36 +7523,34 @@ i64.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 24 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6956,8 +7568,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable @@ -6971,52 +7583,50 @@ i64.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 34 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -7034,8 +7644,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable @@ -7049,40 +7659,26 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 42 + i32.const 232 + i32.const 40 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#clear (; 87 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 92 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -7092,27 +7688,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 32 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -7125,15 +7707,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 88 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 93 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 25 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -7159,7 +7741,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 89 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 94 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -7176,39 +7758,37 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - f32.load - local.get $1 - f32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + f32.load + local.get $1 + f32.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 90 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/set/Set#has (; 95 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) (local $2 f32) local.get $0 local.get $1 @@ -7224,7 +7804,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 91 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 96 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7281,60 +7861,58 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + f32.load + f32.store + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 f32.load - f32.store - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - f32.load - local.set $11 - local.get $11 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load - i32.store offset=4 - local.get $13 - local.get $8 - i32.store - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=4 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end + i32.add + local.set $6 br $continue|0 end end @@ -7342,25 +7920,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $13 local.get $9 i32.load - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $13 - else - local.get $13 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -7368,25 +7930,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $12 local.get $9 i32.load offset=8 - local.tee $13 - i32.ne - if (result i32) - local.get $13 - if - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -7395,13 +7941,16 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 92 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (func $~lib/set/Set#add (; 97 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) (local $2 f32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $2 @@ -7450,17 +7999,15 @@ end local.get $0 i32.load offset=8 - local.set $5 - local.get $5 block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $6 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - local.get $6 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 @@ -7486,21 +8033,21 @@ i32.const 4 i32.mul i32.add - local.set $6 + local.set $5 local.get $4 - local.get $6 + local.get $5 i32.load i32.store offset=4 - local.get $6 + local.get $5 local.get $4 i32.store end ) - (func $~lib/set/Set#get:size (; 93 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 98 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 94 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/set/Set#delete (; 99 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) (local $2 f32) (local $3 i32) (local $4 i32) @@ -7574,7 +8121,7 @@ end i32.const 1 ) - (func $std/set/testNumeric (; 95 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 100 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 f32) i32.const 0 @@ -7589,35 +8136,33 @@ f32.lt i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -7635,8 +8180,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable @@ -7650,34 +8195,32 @@ f32.lt i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -7695,8 +8238,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable @@ -7710,36 +8253,34 @@ f32.lt i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 24 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -7757,8 +8298,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable @@ -7772,52 +8313,50 @@ f32.lt i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 34 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -7835,8 +8374,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable @@ -7850,40 +8389,26 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 42 + i32.const 232 + i32.const 40 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#clear (; 96 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 101 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.tee $1 - i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $2 - local.get $1 - i32.load - local.tee $3 - i32.ne - if (result i32) - local.get $3 - if - local.get $3 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $2 - else - local.get $2 + i32.load + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store local.get $0 @@ -7893,27 +8418,13 @@ i32.store offset=4 local.get $0 local.tee $1 - i32.const 0 - i32.const 64 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 - local.get $1 - i32.load offset=8 - local.tee $2 - i32.ne - if (result i32) - local.get $2 - if - local.get $2 - local.get $1 - call $~lib/collector/dummy/__ref_unlink - end - local.get $3 + block (result i32) local.get $1 - call $~lib/collector/dummy/__ref_link - local.get $3 - else - local.get $3 + i32.load offset=8 + call $~lib/rt/purerc/__release + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor end i32.store offset=8 local.get $0 @@ -7926,15 +8437,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 97 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 102 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/util/runtime/allocate i32.const 26 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain local.set $0 end local.get $0 @@ -7960,7 +8471,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 98 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 103 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load @@ -7977,39 +8488,37 @@ loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - f64.load - local.get $1 - f64.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + f64.load + local.get $1 + f64.eq + else + i32.const 0 end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 99 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/set/Set#has (; 104 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 f64) local.get $0 local.get $1 @@ -8025,7 +8534,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 100 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 105 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8082,60 +8591,58 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + f64.load + f64.store + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 f64.load - f64.store - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $9 - f64.load - local.set $11 - local.get $11 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load - i32.store offset=8 - local.get $13 - local.get $8 - i32.store - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 16 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=8 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end + i32.add + local.set $6 br $continue|0 end end @@ -8143,25 +8650,9 @@ local.get $0 local.tee $9 local.get $3 - local.tee $13 local.get $9 i32.load - local.tee $12 - i32.ne - if (result i32) - local.get $12 - if - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $13 - else - local.get $13 - end + call $~lib/rt/purerc/__retainRelease i32.store local.get $0 local.get $1 @@ -8169,25 +8660,9 @@ local.get $0 local.tee $9 local.get $5 - local.tee $12 local.get $9 i32.load offset=8 - local.tee $13 - i32.ne - if (result i32) - local.get $13 - if - local.get $13 - local.get $9 - call $~lib/collector/dummy/__ref_unlink - end - local.get $12 - local.get $9 - call $~lib/collector/dummy/__ref_link - local.get $12 - else - local.get $12 - end + call $~lib/rt/purerc/__retainRelease i32.store offset=8 local.get $0 local.get $4 @@ -8196,13 +8671,16 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release ) - (func $~lib/set/Set#add (; 101 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (func $~lib/set/Set#add (; 106 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) (local $2 f64) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $2 @@ -8251,17 +8729,15 @@ end local.get $0 i32.load offset=8 - local.set $5 - local.get $5 block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $6 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - local.get $6 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 16 @@ -8287,21 +8763,21 @@ i32.const 4 i32.mul i32.add - local.set $6 + local.set $5 local.get $4 - local.get $6 + local.get $5 i32.load i32.store offset=8 - local.get $6 + local.get $5 local.get $4 i32.store end ) - (func $~lib/set/Set#get:size (; 102 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 107 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 103 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/set/Set#delete (; 108 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 f64) (local $3 i32) (local $4 i32) @@ -8375,7 +8851,7 @@ end i32.const 1 ) - (func $std/set/testNumeric (; 104 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 109 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 f64) i32.const 0 @@ -8390,35 +8866,33 @@ f64.lt i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 8 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 10 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f64.const 1 @@ -8436,8 +8910,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 232 + i32.const 10 i32.const 2 call $~lib/builtins/abort unreachable @@ -8451,34 +8925,32 @@ f64.lt i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 18 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f64.const 1 @@ -8496,8 +8968,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 232 + i32.const 18 i32.const 2 call $~lib/builtins/abort unreachable @@ -8511,36 +8983,34 @@ f64.lt i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 24 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 26 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f64.const 1 @@ -8558,8 +9028,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 232 + i32.const 26 i32.const 2 call $~lib/builtins/abort unreachable @@ -8573,52 +9043,50 @@ f64.lt i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 32 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 34 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 36 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f64.const 1 @@ -8636,8 +9104,8 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 38 + i32.const 232 + i32.const 36 i32.const 2 call $~lib/builtins/abort unreachable @@ -8651,24 +9119,16 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 42 + i32.const 232 + i32.const 40 i32.const 2 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/purerc/__release ) - (func $start:std/set (; 105 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (func $start:std/set (; 110 ;) (type $FUNCSIG$v) call $std/set/testNumeric call $std/set/testNumeric call $std/set/testNumeric @@ -8680,49 +9140,102 @@ call $std/set/testNumeric call $std/set/testNumeric ) - (func $~lib/runtime/runtime.instanceof (; 106 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $start (; 111 ;) (type $FUNCSIG$v) + call $start:std/set + ) + (func $~lib/rt/purerc/increment (; 112 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.sub + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/purerc/__retain (; 113 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 114 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 i32.load local.set $2 - global.get $~lib/runtime/RTTI_BASE - local.set $3 local.get $2 - if (result i32) - local.get $2 - local.get $3 - i32.load - i32.le_u - else - i32.const 0 - end + i32.const 1 + i32.and + i32.eqz + i32.eqz if - loop $continue|0 - local.get $2 - local.get $1 - i32.eq - if - i32.const 1 - return - end - local.get $3 - local.get $2 - i32.const 8 - i32.mul - i32.add - i32.load offset=4 - local.tee $2 - br_if $continue|0 - end + i32.const 0 + i32.const 128 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable end - i32.const 0 + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree ) - (func $~lib/runtime/runtime.flags (; 107 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/common/__typeinfo (; 115 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - global.get $~lib/runtime/RTTI_BASE + global.get $~lib/builtins/RTTI_BASE local.set $1 local.get $0 i32.eqz @@ -8734,183 +9247,1067 @@ i32.load i32.gt_u end - if (result i32) + if + i32.const 328 + i32.const 384 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort unreachable - else - local.get $1 - local.get $0 - i32.const 8 - i32.mul - i32.add - i32.load end - ) - (func $~lib/runtime/runtime.newObject (; 108 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - call $~lib/util/runtime/allocate local.get $1 - call $~lib/util/runtime/register - ) - (func $~lib/runtime/runtime.newString (; 109 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 1 - i32.shl - i32.const 16 - call $~lib/runtime/runtime.newObject + i32.const 8 + i32.mul + i32.add + i32.load ) - (func $~lib/runtime/runtime.newArrayBuffer (; 110 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 15 - call $~lib/runtime/runtime.newObject - ) - (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 111 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.sub - i32.load offset=4 - ) - (func $~lib/runtime/runtime.newArray (; 112 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/memory/memory.copy (; 116 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $0 - call $~lib/runtime/runtime.flags - local.set $2 - local.get $2 - i32.const 16 - i32.div_u - i32.const 31 - i32.and - local.set $3 - local.get $1 - i32.eqz - if - i32.const 0 - local.tee $4 - call $~lib/runtime/runtime.newArrayBuffer - local.set $1 - else + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 local.get $1 - call $~lib/arraybuffer/ArrayBuffer#get:byteLength local.set $4 - end - local.get $0 - i32.const 16 - call $~lib/runtime/runtime.newObject - local.set $5 - local.get $5 - local.tee $6 - local.get $1 - local.tee $7 - local.get $6 - i32.load - local.tee $8 - i32.ne - if (result i32) - local.get $8 - if - local.get $8 - local.get $6 - call $~lib/collector/dummy/__ref_unlink - end - local.get $7 - local.get $6 - call $~lib/collector/dummy/__ref_link - local.get $7 - else - local.get $7 - end - i32.store - local.get $5 - local.get $1 - i32.store offset=4 - local.get $5 - local.get $4 - i32.store offset=8 - local.get $5 - local.get $4 - local.get $3 - i32.shr_u - i32.store offset=12 - local.get $2 - i32.const 1024 - i32.and - if - local.get $1 - local.set $6 - local.get $6 + local.get $2 + local.set $3 + local.get $5 local.get $4 - i32.add - local.set $8 - block $break|0 - loop $continue|0 - local.get $6 - local.get $8 - i32.lt_u - if - block - local.get $6 - i32.load - local.set $7 - local.get $7 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and if - local.get $7 - local.get $5 - call $~lib/collector/dummy/__ref_link + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 end - local.get $6 - i32.const 4 - i32.add - local.set $6 end - br $continue|0 + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end end end end end - local.get $5 ) - (func $~lib/runtime/Root#constructor (; 113 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/purerc/growRoots (; 117 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 118 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 119 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz i32.eqz if i32.const 0 - call $~lib/util/runtime/allocate - i32.const 28 - call $~lib/util/runtime/register - local.set $0 + i32.const 272 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__retainRelease (; 120 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.ne + if + global.get $~lib/builtins/HEAP_BASE + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + local.get $2 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end end local.get $0 ) - (func $~lib/runtime/runtime.retain (; 114 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/purerc/__release (; 121 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 - global.get $~lib/runtime/ROOT - call $~lib/collector/dummy/__ref_link + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end ) - (func $~lib/runtime/runtime.release (; 115 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/purerc/markGray (; 122 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) local.get $0 - global.get $~lib/runtime/ROOT - call $~lib/collector/dummy/__ref_unlink + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end ) - (func $~lib/collector/dummy/__ref_collect (; 116 ;) (type $FUNCSIG$v) - nop - ) - (func $~lib/runtime/runtime.collect (; 117 ;) (type $FUNCSIG$v) - call $~lib/collector/dummy/__ref_collect - ) - (func $~lib/runtime/runtime#constructor (; 118 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - unreachable - ) - (func $start (; 119 ;) (type $FUNCSIG$v) - call $start:std/set + (func $~lib/rt/purerc/scanBlack (; 123 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and i32.const 0 - call $~lib/runtime/Root#constructor - global.set $~lib/runtime/ROOT + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members ) - (func $null (; 120 ;) (type $FUNCSIG$v) + (func $~lib/rt/purerc/scan (; 124 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 125 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 126 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 272 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/set/Set#__visit_impl (; 127 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 128 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 129 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 130 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 131 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 132 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 133 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 134 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 135 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/set/Set#__visit_impl (; 136 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/purerc/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + ) + (func $~lib/builtins/__visit_members (; 137 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$case$28 + block $switch$1$case$27 + block $switch$1$case$26 + block $switch$1$case$25 + block $switch$1$case$24 + block $switch$1$case$23 + block $switch$1$case$22 + block $switch$1$case$21 + block $switch$1$case$20 + block $switch$1$case$19 + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$19 $switch$1$case$20 $switch$1$case$21 $switch$1$case$22 $switch$1$case$23 $switch$1$case$24 $switch$1$case$25 $switch$1$case$26 $switch$1$case$27 $switch$1$case$28 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 138 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/string.json b/tests/compiler/std/string.json index b1da366f..9f7878d4 100644 --- a/tests/compiler/std/string.json +++ b/tests/compiler/std/string.json @@ -1,5 +1,6 @@ { "asc_flags": [ - "--runtime none" + "--runtime half", + "--use ASC_RTRACE=1" ] } \ No newline at end of file diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 203a3b56..abb0cbb5 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -2,584 +2,1746 @@ (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$v (func)) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) + (type $FUNCSIG$dii (func (param i32 i32) (result f64))) (type $FUNCSIG$di (func (param i32) (result f64))) + (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$viji (func (param i32 i64 i32))) (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$iid (func (param i32 f64) (result i32))) + (type $FUNCSIG$jii (func (param i32 i32) (result i64))) (type $FUNCSIG$iijijiji (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) - (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) - (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) - (type $FUNCSIG$vii (func (param i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00 ") - (data (i32.const 24) "h\00i\00,\00 \00I\00\'\00m\00 \00a\00 \00s\00t\00r\00i\00n\00g") - (data (i32.const 56) "\10\00\00\00\1a") - (data (i32.const 72) "s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 104) "\10") - (data (i32.const 120) "\10\00\00\00\02") - (data (i32.const 144) "\10\00\00\00\02") - (data (i32.const 160) "a") - (data (i32.const 168) "\10\00\00\00(") - (data (i32.const 184) "~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s") - (data (i32.const 224) "\10\00\00\00\02") - (data (i32.const 240) "6") - (data (i32.const 248) "\10\00\00\00\1c") - (data (i32.const 264) "~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 296) "\10\00\00\00\04") - (data (i32.const 312) "4\d8\06\df") - (data (i32.const 320) "\10\00\00\00\04") - (data (i32.const 336) "h\00i") - (data (i32.const 344) "\10\00\00\00\08") - (data (i32.const 360) "n\00u\00l\00l") - (data (i32.const 368) "\10\00\00\00\0c") - (data (i32.const 384) "s\00t\00r\00i\00n\00g") - (data (i32.const 400) "\10\00\00\00\06") - (data (i32.const 416) "I\00\'\00m") - (data (i32.const 424) "\10\00\00\00\02") - (data (i32.const 440) " ") - (data (i32.const 448) "\10\00\00\00\06") - (data (i32.const 464) " \00 \00 ") - (data (i32.const 472) "\10\00\00\00\06") - (data (i32.const 488) "a\00b\00c") - (data (i32.const 496) "\10\00\00\00\n") - (data (i32.const 512) " \00 \00a\00b\00c") - (data (i32.const 528) "\10\00\00\00\06") - (data (i32.const 544) "1\002\003") - (data (i32.const 552) "\10\00\00\00\0c") - (data (i32.const 568) "1\002\003\00a\00b\00c") - (data (i32.const 584) "\10\00\00\00\10") - (data (i32.const 600) "1\002\003\001\002\00a\00b\00c") - (data (i32.const 616) "\10\00\00\00\n") - (data (i32.const 632) "a\00b\00c\00 \00 ") - (data (i32.const 648) "\10\00\00\00\0c") - (data (i32.const 664) "a\00b\00c\00a\00b\00c") - (data (i32.const 680) "\10\00\00\00\10") - (data (i32.const 696) "a\00b\00c\00a\00b\00c\00a\00b") - (data (i32.const 712) "\10\00\00\00\02") - (data (i32.const 728) ",") - (data (i32.const 736) "\10\00\00\00\02") - (data (i32.const 752) "x") - (data (i32.const 760) "\10\00\00\00\06") - (data (i32.const 776) ",\00 \00I") - (data (i32.const 784) "\10\00\00\00\02") - (data (i32.const 800) "g") - (data (i32.const 808) "\10\00\00\00\02") - (data (i32.const 824) "i") - (data (i32.const 832) "\10\00\00\00\02") - (data (i32.const 848) "0") - (data (i32.const 856) "\10\00\00\00\02") - (data (i32.const 872) "1") - (data (i32.const 880) "\10\00\00\00\n") - (data (i32.const 896) "0\00b\001\000\001") - (data (i32.const 912) "\10\00\00\00\n") - (data (i32.const 928) "0\00o\007\000\007") - (data (i32.const 944) "\10\00\00\00\n") - (data (i32.const 960) "0\00x\00f\000\00f") - (data (i32.const 976) "\10\00\00\00\n") - (data (i32.const 992) "0\00x\00F\000\00F") - (data (i32.const 1008) "\10\00\00\00\06") - (data (i32.const 1024) "0\001\001") - (data (i32.const 1032) "\10\00\00\00\08") - (data (i32.const 1048) "0\00x\001\00g") - (data (i32.const 1056) "\10\00\00\00\06") - (data (i32.const 1072) "0\00.\001") - (data (i32.const 1080) "\10\00\00\00\06") - (data (i32.const 1096) ".\002\005") - (data (i32.const 1104) "\10\00\00\00\10") - (data (i32.const 1120) ".\001\00f\00o\00o\00b\00a\00r") - (data (i32.const 1136) "\10\00\00\00\02") - (data (i32.const 1152) "b") - (data (i32.const 1160) "\10\00\00\00\04") - (data (i32.const 1176) "a\00b") - (data (i32.const 1184) "\10\00\00\00\08") - (data (i32.const 1200) "k\00e\00y\001") - (data (i32.const 1208) "\10\00\00\00\08") - (data (i32.const 1224) "k\00e\00y\002") - (data (i32.const 1232) "\10\00\00\00\06") - (data (i32.const 1248) "k\00e\001") - (data (i32.const 1256) "\10\00\00\00\06") - (data (i32.const 1272) "k\00e\002") - (data (i32.const 1280) "\10\00\00\00\n") - (data (i32.const 1296) "k\00e\00y\001\002") - (data (i32.const 1312) "\10\00\00\00\n") - (data (i32.const 1328) "k\00e\00y\001\001") - (data (i32.const 1344) "\10\00\00\00\0e") - (data (i32.const 1360) "\a40\ed0\cf0\cb0\db0\d80\c80") - (data (i32.const 1376) "\10\00\00\00\0e") - (data (i32.const 1392) "\a60\f00\ce0\aa0\af0\e40\de0") - (data (i32.const 1408) "\10\00\00\00\16") - (data (i32.const 1424) "D\00\19 f\00h\00u\00a\00s\00c\00a\00i\00l") - (data (i32.const 1448) "\10\00\00\00\14") - (data (i32.const 1464) "D\00\19 \1f\1eu\00a\00s\00c\00a\00i\00l") - (data (i32.const 1488) "\10\00\00\00\04") - (data (i32.const 1504) "b\00a") - (data (i32.const 1512) "\10\00\00\00\04") - (data (i32.const 1528) "a\00a") - (data (i32.const 1536) "\10\00\00\00\06") - (data (i32.const 1552) "a\00a\00a") - (data (i32.const 1560) "\10\00\00\00\10") - (data (i32.const 1576) "a\00b\00a\00b\00a\00b\00a\00b") - (data (i32.const 1592) "\10\00\00\00\n") - (data (i32.const 1608) "a\00a\00a\00a\00a") - (data (i32.const 1624) "\10\00\00\00\0c") - (data (i32.const 1640) "a\00a\00a\00a\00a\00a") - (data (i32.const 1656) "\10\00\00\00\0e") - (data (i32.const 1672) "a\00a\00a\00a\00a\00a\00a") - (data (i32.const 1688) "\10\00\00\00\1c") - (data (i32.const 1704) "a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n") - (data (i32.const 1736) "\10\00\00\00\02") - (data (i32.const 1752) "n") - (data (i32.const 1760) "\10\00\00\00\n") - (data (i32.const 1776) "j\00k\00l\00m\00n") - (data (i32.const 1792) "\10\00\00\00\n") - (data (i32.const 1808) "c\00d\00e\00f\00g") - (data (i32.const 1824) "\10\00\00\00\n") - (data (i32.const 1840) "d\00e\00f\00g\00h") - (data (i32.const 1856) "\10\00\00\00\1a") - (data (i32.const 1872) "a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m") - (data (i32.const 1904) "\10\00\00\00\1a") - (data (i32.const 1920) "~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 1952) "\10\00\00\00\n") - (data (i32.const 1968) "a\00,\00b\00,\00c") - (data (i32.const 1984) "\10\00\00\00\02") - (data (i32.const 2000) ".") - (data (i32.const 2008) "\10\00\00\00\02") - (data (i32.const 2024) "c") - (data (i32.const 2032) "\10\00\00\00\0e") - (data (i32.const 2048) "a\00,\00 \00b\00,\00 \00c") - (data (i32.const 2064) "\10\00\00\00\04") - (data (i32.const 2080) ",\00 ") - (data (i32.const 2088) "\10\00\00\00\0c") - (data (i32.const 2104) "a\00,\00b\00,\00,\00c") - (data (i32.const 2120) "\10\00\00\00\0c") - (data (i32.const 2136) ",\00a\00,\00b\00,\00c") - (data (i32.const 2152) "\10\00\00\00\0c") - (data (i32.const 2168) "a\00,\00b\00,\00c\00,") - (data (i32.const 2184) "\0f\00\00\00\90\01") - (data (i32.const 2200) "0\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009") - (data (i32.const 2600) "\13\00\00\00\10") - (data (i32.const 2616) "\98\08\00\00\98\08\00\00\90\01\00\00d") - (data (i32.const 2632) "\10\00\00\00\02") - (data (i32.const 2648) "8") - (data (i32.const 2656) "\10\00\00\00\n") - (data (i32.const 2672) "-\001\000\000\000") - (data (i32.const 2688) "\10\00\00\00\08") - (data (i32.const 2704) "1\002\003\004") - (data (i32.const 2712) "\10\00\00\00\n") - (data (i32.const 2728) "1\002\003\004\005") - (data (i32.const 2744) "\10\00\00\00\0c") - (data (i32.const 2760) "1\002\003\004\005\006") - (data (i32.const 2776) "\10\00\00\00\0e") - (data (i32.const 2792) "1\001\001\001\001\001\001") - (data (i32.const 2808) "\10\00\00\00\0e") - (data (i32.const 2824) "1\002\003\004\005\006\007") - (data (i32.const 2840) "\10\00\00\00\14") - (data (i32.const 2856) "2\001\004\007\004\008\003\006\004\006") - (data (i32.const 2880) "\10\00\00\00\14") - (data (i32.const 2896) "2\001\004\007\004\008\003\006\004\007") - (data (i32.const 2920) "\10\00\00\00\16") - (data (i32.const 2936) "-\002\001\004\007\004\008\003\006\004\008") - (data (i32.const 2960) "\10\00\00\00\04") - (data (i32.const 2976) "-\001") - (data (i32.const 2984) "\10\00\00\00\08") - (data (i32.const 3000) "1\000\000\000") - (data (i32.const 3008) "\10\00\00\00\14") - (data (i32.const 3024) "2\001\004\007\004\008\003\006\004\008") - (data (i32.const 3048) "\10\00\00\00\14") - (data (i32.const 3064) "4\002\009\004\009\006\007\002\009\005") - (data (i32.const 3088) "\10\00\00\00\10") - (data (i32.const 3104) "9\009\009\009\009\009\009\009") - (data (i32.const 3120) "\10\00\00\00\12") - (data (i32.const 3136) "1\000\000\000\000\000\000\000\000") - (data (i32.const 3160) "\10\00\00\00\16") - (data (i32.const 3176) "6\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3200) "\10\00\00\00\18") - (data (i32.const 3216) "8\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3240) "\10\00\00\00\1e") - (data (i32.const 3256) "9\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3288) "\10\00\00\00 ") - (data (i32.const 3304) "9\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3336) "\10\00\00\00\"") - (data (i32.const 3352) "1\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3392) "\10\00\00\00(") - (data (i32.const 3408) "1\008\004\004\006\007\004\004\000\007\003\007\000\009\005\005\001\006\001\005") - (data (i32.const 3448) "\10\00\00\00\n") - (data (i32.const 3464) "-\001\002\003\004") - (data (i32.const 3480) "\10\00\00\00\16") - (data (i32.const 3496) "-\004\002\009\004\009\006\007\002\009\005") - (data (i32.const 3520) "\10\00\00\00\18") - (data (i32.const 3536) "-\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3560) "\10\00\00\00\1a") - (data (i32.const 3576) "-\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3608) "\10\00\00\00 ") - (data (i32.const 3624) "-\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3656) "\10\00\00\00$") - (data (i32.const 3672) "-\001\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3712) "\10\00\00\00&") - (data (i32.const 3728) "9\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\007") - (data (i32.const 3768) "\10\00\00\00(") - (data (i32.const 3784) "-\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\008") - (data (i32.const 3824) "\10\00\00\00\06") - (data (i32.const 3840) "0\00.\000") - (data (i32.const 3848) "\10\00\00\00\06") - (data (i32.const 3864) "N\00a\00N") - (data (i32.const 3872) "\10\00\00\00\12") - (data (i32.const 3888) "-\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 3912) "\10\00\00\00\10") - (data (i32.const 3928) "I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 3944) "\0f\00\00\00\b8\02") - (data (i32.const 3960) "\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8 (; 16 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) - (local $1 i32) - (local $2 i32) + (func $~lib/memory/memory.copy (; 24 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - (local $4 f64) - (local $5 f64) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/memory/memory.repeat (; 25 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + i32.const 0 + local.set $4 + local.get $2 + local.get $3 + i32.mul + local.set $5 + block $break|0 + loop $continue|0 + local.get $4 + local.get $5 + i32.lt_u + if + local.get $0 + local.get $4 + i32.add + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $4 + local.get $2 + i32.add + local.set $4 + br $continue|0 + end + end + end + ) + (func $~lib/string/String#padStart (; 26 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $2 + i32.const 0 + i32.ne i32.eqz if + i32.const 0 + i32.const 312 + i32.const 288 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $3 + local.get $1 + i32.const 1 + i32.shl + local.set $4 + local.get $2 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $5 + local.get $4 + local.get $3 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $5 + i32.eqz + end + if + local.get $0 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $2 + call $~lib/rt/purerc/__release + local.get $6 + return + end + local.get $4 + local.get $3 + i32.sub + local.set $7 + local.get $4 + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $8 + local.get $7 + local.get $5 + i32.gt_u + if + local.get $7 + i32.const 2 + i32.sub + local.get $5 + i32.div_u + local.set $6 + local.get $6 + local.get $5 + i32.mul + local.set $9 + local.get $7 + local.get $9 + i32.sub + local.set $10 + local.get $8 + local.get $2 + local.get $5 + local.get $6 + call $~lib/memory/memory.repeat + local.get $8 + local.get $9 + i32.add + local.get $2 + local.get $10 + call $~lib/memory/memory.copy + else + local.get $8 + local.get $2 + local.get $7 + call $~lib/memory/memory.copy + end + local.get $8 + local.get $7 + i32.add + local.get $0 + local.get $3 + call $~lib/memory/memory.copy + local.get $8 + call $~lib/rt/purerc/__retain + local.set $10 + local.get $2 + call $~lib/rt/purerc/__release + local.get $10 + ) + (func $~lib/string/String#padEnd (; 27 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $2 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 312 + i32.const 309 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $3 + local.get $1 + i32.const 1 + i32.shl + local.set $4 + local.get $2 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $5 + local.get $4 + local.get $3 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $5 + i32.eqz + end + if + local.get $0 + call $~lib/rt/purerc/__retain + local.set $6 + local.get $2 + call $~lib/rt/purerc/__release + local.get $6 + return + end + local.get $4 + local.get $3 + i32.sub + local.set $7 + local.get $4 + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $8 + local.get $8 + local.get $0 + local.get $3 + call $~lib/memory/memory.copy + local.get $7 + local.get $5 + i32.gt_u + if + local.get $7 + i32.const 2 + i32.sub + local.get $5 + i32.div_u + local.set $6 + local.get $6 + local.get $5 + i32.mul + local.set $9 + local.get $7 + local.get $9 + i32.sub + local.set $10 + local.get $8 + local.get $3 + i32.add + local.get $2 + local.get $5 + local.get $6 + call $~lib/memory/memory.repeat + local.get $8 + local.get $3 + i32.add + local.get $9 + i32.add + local.get $2 + local.get $10 + call $~lib/memory/memory.copy + else + local.get $8 + local.get $3 + i32.add + local.get $2 + local.get $7 + call $~lib/memory/memory.copy + end + local.get $8 + call $~lib/rt/purerc/__retain + local.set $10 + local.get $2 + call $~lib/rt/purerc/__release + local.get $10 + ) + (func $~lib/string/String#lastIndexOf (; 28 ;) (type $FUNCSIG$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) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 312 + i32.const 156 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 0 + i32.eq + if + i32.const 408 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + end + local.get $0 + call $~lib/string/String#get:length + local.set $3 + local.get $1 + call $~lib/string/String#get:length + local.set $4 + local.get $4 + i32.eqz + if + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $3 + i32.eqz + if + local.get $1 + call $~lib/rt/purerc/__release + i32.const -1 + return + end + local.get $2 + local.tee $5 + i32.const 0 + local.tee $6 + local.get $5 + local.get $6 + i32.gt_s + select + local.tee $5 + local.get $3 + local.get $4 + i32.sub + local.tee $6 + local.get $5 + local.get $6 + i32.lt_s + select + local.set $7 + block $break|0 + local.get $7 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 0 + i32.ge_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $5 + local.get $1 + i32.const 0 + local.get $4 + call $~lib/util/string/compareImpl + i32.eqz + if + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 + return + end + local.get $5 + i32.const 1 + i32.sub + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/rt/purerc/__release + i32.const -1 + ) + (func $~lib/util/string/parse (; 29 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 f64) + (local $6 i32) + (local $7 f64) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/string/String#get:length + local.set $2 + local.get $2 + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/__release f64.const nan:0x8000000000000 return end local.get $0 + local.set $3 + local.get $3 i32.load16_u - local.tee $1 + local.set $4 + local.get $4 i32.const 45 i32.eq - if (result f64) + if local.get $2 i32.const 1 i32.sub local.tee $2 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release f64.const nan:0x8000000000000 return end - local.get $0 + local.get $3 i32.const 2 i32.add - local.tee $0 + local.tee $3 i32.load16_u - local.set $1 + local.set $4 f64.const -1 + local.set $5 else - local.get $1 + local.get $4 i32.const 43 i32.eq if @@ -1326,554 +2677,783 @@ local.tee $2 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release f64.const nan:0x8000000000000 return end - local.get $0 + local.get $3 i32.const 2 i32.add - local.tee $0 + local.tee $3 i32.load16_u - local.set $1 + local.set $4 + f64.const 1 + local.set $5 + else + f64.const 1 + local.set $5 end - f64.const 1 end - local.set $5 - local.get $2 - i32.const 2 - i32.gt_s - i32.const 0 local.get $1 - i32.const 48 - i32.eq - select - if (result i32) - block $break|0 (result i32) - block $case6|0 - block $case5|0 - block $case3|0 - block $case1|0 - local.get $0 - i32.const 2 - i32.add - i32.load16_u - local.tee $1 - i32.const 66 - i32.eq - br_if $case1|0 - local.get $1 - i32.const 98 - i32.eq - br_if $case1|0 - local.get $1 - i32.const 79 - i32.eq - br_if $case3|0 - local.get $1 - i32.const 111 - i32.eq - br_if $case3|0 - local.get $1 - i32.const 88 - i32.eq - br_if $case5|0 - local.get $1 - i32.const 120 - i32.eq - br_if $case5|0 - br $case6|0 + i32.eqz + if + local.get $4 + i32.const 48 + i32.eq + if (result i32) + local.get $2 + i32.const 2 + i32.gt_s + else + i32.const 0 + end + if + block $break|0 + block $case6|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $3 + i32.const 2 + i32.add + i32.load16_u + local.set $6 + local.get $6 + i32.const 66 + i32.eq + br_if $case0|0 + local.get $6 + i32.const 98 + i32.eq + br_if $case1|0 + local.get $6 + i32.const 79 + i32.eq + br_if $case2|0 + local.get $6 + i32.const 111 + i32.eq + br_if $case3|0 + local.get $6 + i32.const 88 + i32.eq + br_if $case4|0 + local.get $6 + i32.const 120 + i32.eq + br_if $case5|0 + br $case6|0 + end + end + block + local.get $3 + i32.const 4 + i32.add + local.set $3 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + i32.const 2 + local.set $1 + br $break|0 + unreachable + end + unreachable + end + end + block + local.get $3 + i32.const 4 + i32.add + local.set $3 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + i32.const 8 + local.set $1 + br $break|0 + unreachable + end + unreachable end - local.get $0 + end + block + local.get $3 i32.const 4 i32.add - local.set $0 + local.set $3 local.get $2 i32.const 2 i32.sub local.set $2 - i32.const 2 + i32.const 16 + local.set $1 br $break|0 + unreachable end - local.get $0 - i32.const 4 - i32.add - local.set $0 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - i32.const 8 - br $break|0 + unreachable end - local.get $0 - i32.const 4 - i32.add - local.set $0 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - i32.const 16 - br $break|0 + i32.const 10 + local.set $1 end + else i32.const 10 + local.set $1 end else - i32.const 10 - end - local.set $3 - loop $continue|1 - block $break|1 - local.get $2 - local.tee $1 + local.get $1 + i32.const 2 + i32.lt_s + if (result i32) i32.const 1 - i32.sub - local.set $2 + else local.get $1 + i32.const 36 + i32.gt_s + end + if + local.get $0 + call $~lib/rt/purerc/__release + f64.const nan:0x8000000000000 + return + end + end + f64.const 0 + local.set $7 + block $break|1 + loop $continue|1 + block (result i32) + local.get $2 + local.tee $6 + i32.const 1 + i32.sub + local.set $2 + local.get $6 + end if - local.get $0 + local.get $3 i32.load16_u - local.tee $1 + local.set $4 + local.get $4 i32.const 48 i32.ge_s if (result i32) - local.get $1 + local.get $4 i32.const 57 i32.le_s else i32.const 0 end - if (result i32) - local.get $1 + if + local.get $4 i32.const 48 i32.sub + local.set $4 else - local.get $1 - i32.const 90 - i32.le_s - i32.const 0 - local.get $1 + local.get $4 i32.const 65 i32.ge_s - select if (result i32) - local.get $1 - i32.const 55 - i32.sub - else - local.get $1 - i32.const 122 + local.get $4 + i32.const 90 i32.le_s + else i32.const 0 - local.get $1 + end + if + local.get $4 + i32.const 65 + i32.const 10 + i32.sub + i32.sub + local.set $4 + else + local.get $4 i32.const 97 i32.ge_s - select - i32.eqz - br_if $break|1 - local.get $1 - i32.const 87 - i32.sub + if (result i32) + local.get $4 + i32.const 122 + i32.le_s + else + i32.const 0 + end + if + local.get $4 + i32.const 97 + i32.const 10 + i32.sub + i32.sub + local.set $4 + else + br $break|1 + end end end - local.tee $1 - local.get $3 - i32.ge_s - br_if $break|1 local.get $4 - local.get $3 - f64.convert_i32_s - f64.mul + local.get $1 + i32.ge_s + if + br $break|1 + end + local.get $7 local.get $1 f64.convert_i32_s + f64.mul + local.get $4 + f64.convert_i32_s f64.add - local.set $4 - local.get $0 + local.set $7 + local.get $3 i32.const 2 i32.add - local.set $0 + local.set $3 br $continue|1 end end end + local.get $0 + call $~lib/rt/purerc/__release local.get $5 - local.get $4 + local.get $7 f64.mul ) - (func $~lib/string/parseFloat (; 17 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (func $~lib/string/parseInt (; 30 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release + local.get $0 + local.get $1 + call $~lib/util/string/parse + ) + (func $~lib/string/parseFloat (; 31 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) (local $1 i32) (local $2 i32) - (local $3 f64) + (local $3 i32) (local $4 f64) (local $5 f64) + (local $6 i32) + (local $7 f64) local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $2 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/string/String#get:length + local.set $1 + local.get $1 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release f64.const nan:0x8000000000000 return end local.get $0 + local.set $2 + local.get $2 i32.load16_u - local.tee $1 + local.set $3 + local.get $3 i32.const 45 i32.eq - if (result f64) - local.get $2 + if + local.get $1 i32.const 1 i32.sub - local.tee $2 + local.tee $1 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release f64.const nan:0x8000000000000 return end - local.get $0 + local.get $2 i32.const 2 i32.add - local.tee $0 + local.tee $2 i32.load16_u - drop + local.set $3 f64.const -1 + local.set $4 else - local.get $1 + local.get $3 i32.const 43 i32.eq if - local.get $2 + local.get $1 i32.const 1 i32.sub - local.tee $2 + local.tee $1 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release f64.const nan:0x8000000000000 return end - local.get $0 + local.get $2 i32.const 2 i32.add - local.tee $0 + local.tee $2 i32.load16_u - drop + local.set $3 + f64.const 1 + local.set $4 + else + f64.const 1 + local.set $4 end - f64.const 1 end + f64.const 0 local.set $5 - loop $continue|0 - block $break|0 - local.get $2 - local.tee $1 - i32.const 1 - i32.sub - local.set $2 - local.get $1 + block $break|0 + loop $continue|0 + block (result i32) + local.get $1 + local.tee $6 + i32.const 1 + i32.sub + local.set $1 + local.get $6 + end if - local.get $0 + local.get $2 i32.load16_u - local.tee $1 + local.set $3 + local.get $3 i32.const 46 i32.eq if - local.get $0 + local.get $2 i32.const 2 i32.add - local.set $0 + local.set $2 f64.const 0.1 - local.set $4 - loop $continue|1 - block $break|1 - local.get $2 - local.tee $1 - i32.const 1 - i32.sub - local.set $2 - local.get $1 + local.set $7 + block $break|1 + loop $continue|1 + block (result i32) + local.get $1 + local.tee $6 + i32.const 1 + i32.sub + local.set $1 + local.get $6 + end if - local.get $0 + local.get $2 i32.load16_u - local.tee $1 + local.set $3 + local.get $3 i32.const 69 i32.eq if (result i32) i32.const 1 else - local.get $1 + local.get $3 i32.const 101 i32.eq end if i32.const 0 - i32.const 264 - i32.const 583 - i32.const 10 - call $~lib/builtins/abort - unreachable + i32.eqz + if + i32.const 0 + i32.const 312 + i32.const 572 + i32.const 10 + call $~lib/builtins/abort + unreachable + end end - local.get $1 + local.get $3 i32.const 48 i32.sub - local.tee $1 + local.set $3 + local.get $3 i32.const 9 i32.gt_u - br_if $break|1 + if + br $break|1 + end + local.get $5 local.get $3 - local.get $1 f64.convert_i32_s - local.get $4 + local.get $7 f64.mul f64.add - local.set $3 - local.get $4 + local.set $5 + local.get $7 f64.const 0.1 f64.mul - local.set $4 - local.get $0 + local.set $7 + local.get $2 i32.const 2 i32.add - local.set $0 + local.set $2 br $continue|1 end end end br $break|0 end - local.get $1 + local.get $3 i32.const 48 i32.sub - local.tee $1 + local.set $3 + local.get $3 i32.const 10 i32.ge_u - br_if $break|0 - local.get $3 + if + br $break|0 + end + local.get $5 f64.const 10 f64.mul - local.get $1 + local.get $3 f64.convert_i32_s f64.add - local.set $3 - local.get $0 + local.set $5 + local.get $2 i32.const 2 i32.add - local.set $0 + local.set $2 br $continue|0 end end end + local.get $0 + call $~lib/rt/purerc/__release + local.get $4 local.get $5 - local.get $3 f64.mul ) - (func $~lib/string/String#concat (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $1 - i32.const 360 + call $~lib/rt/purerc/__retain + drop local.get $1 - select - local.tee $3 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $4 + i32.const 0 + i32.eq + if + i32.const 408 + local.get $1 + call $~lib/rt/purerc/__retainRelease + local.set $1 + end local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.const 1 i32.shl - local.tee $1 + local.set $2 + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $3 + local.get $2 + local.get $3 i32.add - local.tee $2 - i32.eqz + local.set $4 + local.get $4 + i32.const 0 + i32.eq if i32.const 120 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end - local.get $2 - call $~lib/util/runtime/allocate - local.tee $2 + local.get $4 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $6 + local.get $6 local.get $0 - local.get $1 + local.get $2 call $~lib/memory/memory.copy - local.get $1 + local.get $6 local.get $2 i32.add + local.get $1 local.get $3 - local.get $4 call $~lib/memory/memory.copy - local.get $2 - i32.const 16 - call $~lib/util/runtime/register + local.get $6 + local.set $5 + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 ) - (func $~lib/string/String.__concat (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 - i32.const 360 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 + i32.const 408 + local.get $0 + i32.const 0 + i32.ne select local.get $1 call $~lib/string/String#concat + local.set $2 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 ) - (func $~lib/string/String.__ne (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__ne (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release local.get $0 local.get $1 call $~lib/string/String.__eq i32.eqz ) - (func $~lib/string/String.__gt (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__gt (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - i32.const 1 - local.get $1 - i32.eqz - i32.const 1 + (local $4 i32) + (local $5 i32) local.get $0 - i32.eqz + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 i32.eq - select - select + if (result i32) + i32.const 1 + else + local.get $0 + i32.const 0 + i32.eq + end + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end - local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.set $2 local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $3 - i32.eqz - if - i32.const 0 - return - end + call $~lib/string/String#get:length + local.set $2 + local.get $1 + call $~lib/string/String#get:length + local.set $3 local.get $2 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + i32.const 0 + return + end + local.get $3 + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 i32.const 0 local.get $1 - local.get $3 + i32.const 0 local.get $2 + local.tee $4 local.get $3 - local.get $2 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select call $~lib/util/string/compareImpl i32.const 0 i32.gt_s ) - (func $~lib/string/String.__lt (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__lt (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - i32.const 1 - local.get $1 - i32.eqz - i32.const 1 + (local $4 i32) + (local $5 i32) local.get $0 - i32.eqz + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 local.get $1 i32.eq - select - select + if (result i32) + i32.const 1 + else + local.get $0 + i32.const 0 + i32.eq + end + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.set $2 local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $3 + call $~lib/string/String#get:length + local.set $3 + local.get $3 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end local.get $2 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 i32.const 0 local.get $1 + i32.const 0 local.get $2 + local.tee $4 local.get $3 - local.get $2 - local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select call $~lib/util/string/compareImpl i32.const 0 i32.lt_s ) - (func $~lib/string/String.__gte (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__gte (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release local.get $0 local.get $1 call $~lib/string/String.__lt i32.eqz ) - (func $~lib/string/String.__lte (; 24 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 120 + (func $~lib/string/String.__lte (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 + local.get $1 call $~lib/string/String.__gt i32.eqz ) - (func $~lib/string/String#repeat (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#repeat (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 + i32.const 0 + i32.ne i32.eqz if i32.const 0 - i32.const 264 - i32.const 337 + i32.const 312 + i32.const 330 i32.const 4 call $~lib/builtins/abort unreachable end local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.set $2 local.get $1 i32.const 0 @@ -1890,20 +3470,25 @@ i64.gt_u end if - i32.const 0 - i32.const 264 - i32.const 342 + i32.const 1600 + i32.const 312 + i32.const 335 i32.const 6 call $~lib/builtins/abort unreachable end - local.get $2 - i32.eqz - i32.const 1 local.get $1 - select + i32.const 0 + i32.eq + if (result i32) + i32.const 1 + else + local.get $2 + i32.eqz + end if i32.const 120 + call $~lib/rt/purerc/__retain return end local.get $1 @@ -1911,15 +3496,18 @@ i32.eq if local.get $0 + call $~lib/rt/purerc/__retain return end - local.get $1 local.get $2 + local.get $1 i32.mul i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.tee $3 + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $3 + local.get $3 local.get $0 local.get $2 i32.const 1 @@ -1927,17 +3515,17 @@ local.get $1 call $~lib/memory/memory.repeat local.get $3 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/string/String#slice (; 26 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#slice (; 40 ;) (type $FUNCSIG$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) + (local $8 i32) local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.set $3 local.get $1 i32.const 0 @@ -1946,21 +3534,24 @@ local.get $1 local.get $3 i32.add - local.tee $1 - i32.const 0 - local.get $1 + local.tee $4 i32.const 0 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select else local.get $1 + local.tee $4 local.get $3 - local.get $1 - local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select end - local.set $1 + local.set $6 local.get $2 i32.const 0 i32.lt_s @@ -1968,475 +3559,950 @@ local.get $2 local.get $3 i32.add - local.tee $2 - i32.const 0 - local.get $2 + local.tee $4 i32.const 0 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select else local.get $2 + local.tee $4 local.get $3 - local.get $2 - local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select end - local.get $1 + local.set $7 + local.get $7 + local.get $6 i32.sub - local.tee $2 + local.set $3 + local.get $3 i32.const 0 i32.le_s if i32.const 120 + call $~lib/rt/purerc/__retain return end - local.get $2 - i32.const 1 - i32.shl - local.tee $2 - call $~lib/util/runtime/allocate - local.tee $3 - local.get $1 + local.get $3 i32.const 1 i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $8 + local.get $8 local.get $0 + local.get $6 + i32.const 1 + i32.shl i32.add - local.get $2 - call $~lib/memory/memory.copy local.get $3 - i32.const 16 - call $~lib/util/runtime/register - ) - (func $~lib/util/runtime/makeArray (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - i32.const 16 - call $~lib/util/runtime/allocate - i32.const 17 - call $~lib/util/runtime/register - local.set $1 - local.get $0 - i32.const 2 + i32.const 1 i32.shl - local.tee $2 - call $~lib/util/runtime/allocate - i32.const 15 - call $~lib/util/runtime/register - local.tee $3 - local.set $4 - local.get $1 - i32.load - drop - local.get $1 - local.get $4 - i32.store - local.get $1 - local.get $3 - i32.store offset=4 - local.get $1 - local.get $2 - i32.store offset=8 - local.get $1 - local.get $0 - i32.store offset=12 - local.get $1 + call $~lib/memory/memory.copy + local.get $8 + call $~lib/rt/purerc/__retain ) - (func $~lib/memory/memory.fill (; 28 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - block $~lib/util/memory/memset|inlined.0 - local.get $1 - i32.eqz - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + (func $~lib/rt/purerc/increment (; 41 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 + i32.const 2016 + i32.const 103 i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 1 - i32.add + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if i32.const 0 - i32.store8 - local.get $0 - i32.const 2 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $1 - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.tee $1 - i32.sub - local.set $2 - local.get $0 - local.get $1 - i32.add - local.tee $0 - i32.const 0 - i32.store - local.get $2 - i32.const -4 - i32.and - local.tee $1 - local.get $0 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 4 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 8 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 12 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 16 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 20 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 24 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - local.get $0 - i32.add - local.set $0 - local.get $1 - local.get $2 - i32.sub - local.set $1 - loop $continue|0 - local.get $1 - i32.const 32 - i32.ge_u - if - local.get $0 - i64.const 0 - i64.store - local.get $0 - i32.const 8 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 16 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 24 - i32.add - i64.const 0 - i64.store - local.get $1 - i32.const 32 - i32.sub - local.set $1 - local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 - end - end + i32.const 2016 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable end ) - (func $~lib/util/runtime/reallocate (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/rt/purerc/__retain (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 + ) + (func $~lib/rt/common/__allocArray (; 43 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 16 + local.get $2 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $0 + local.get $1 + i32.shl + local.set $5 + local.get $5 + i32.const 15 + call $~lib/rt/tlsf/__alloc + local.set $6 + local.get $4 + local.get $6 + call $~lib/rt/purerc/__retain + i32.store + local.get $4 + local.get $6 + i32.store offset=4 + local.get $4 + local.get $5 + i32.store offset=8 + local.get $4 + local.get $0 + i32.store offset=12 + local.get $3 + if + local.get $6 + local.get $3 + local.get $5 + call $~lib/memory/memory.copy + end + local.get $4 + ) + (func $~lib/rt/tlsf/reallocateBlock (; 44 ;) (type $FUNCSIG$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) + (local $8 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $1 + i32.load + local.set $4 + local.get $4 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 491 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const -4 + i32.and + i32.le_u + if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + block $~lib/rt/tlsf/GETRIGHT|inlined.4 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $6 + local.get $6 + i32.load + local.set $7 + local.get $7 + i32.const 1 + i32.and + if + local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $7 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $5 + local.get $5 + local.get $3 + i32.ge_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return + end + end + local.get $0 + local.get $2 + call $~lib/rt/tlsf/allocateBlock + local.set $8 + local.get $8 + local.get $1 + i32.load offset=4 + i32.store offset=4 + local.get $8 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $8 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + local.get $8 + ) + (func $~lib/rt/tlsf/__realloc (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 552 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 553 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT local.get $0 i32.const 16 i32.sub - local.tee $4 - i32.load offset=4 - local.tee $2 local.get $1 - i32.lt_u - if - i32.const 1 - i32.const 32 - local.get $1 - i32.const 15 - i32.add - i32.clz - i32.sub - i32.shl - local.tee $3 - local.set $5 - i32.const 1 - i32.const 32 - local.get $2 - i32.const 15 - i32.add - i32.clz - i32.sub - i32.shl - i32.const 0 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 46 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 local.get $0 - i32.const 6928 - i32.gt_u - select + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 local.get $3 - i32.lt_u + i32.eqz if - local.get $5 - call $~lib/allocator/arena/__mem_allocate - local.tee $3 - local.get $4 - i32.load - i32.store - local.get $3 - i32.const 0 - i32.store offset=8 - local.get $3 - i32.const 0 - i32.store offset=12 - local.get $3 - i32.const 16 - i32.add - local.tee $5 - local.get $0 - local.get $2 - call $~lib/memory/memory.copy - local.get $2 - local.get $5 - i32.add - local.get $1 - local.get $2 - i32.sub - call $~lib/memory/memory.fill - local.get $4 - i32.load - i32.const -1520547049 - i32.eq - if - local.get $0 - i32.const 6928 - i32.le_u + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u if - i32.const 0 - i32.const 184 - i32.const 89 + local.get $5 + local.get $8 + i64.store + local.get $5 i32.const 8 - call $~lib/builtins/abort - unreachable + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $continue|0 end end - local.get $3 - local.set $4 - local.get $5 - local.set $0 - else - local.get $0 - local.get $2 - i32.add - local.get $1 - local.get $2 - i32.sub - call $~lib/memory/memory.fill end end - local.get $4 - local.get $1 - i32.store offset=4 - local.get $0 ) - (func $~lib/array/ensureCapacity (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) + (func $~lib/array/ensureSize (; 47 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - local.get $1 + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 i32.load offset=8 - i32.const 2 + local.set $3 + local.get $1 + local.get $3 + local.get $2 i32.shr_u i32.gt_u if local.get $1 - i32.const 268435452 + i32.const 1073741808 + local.get $2 + i32.shr_u i32.gt_u if - i32.const 0 - i32.const 1920 + i32.const 1600 + i32.const 2072 i32.const 14 - i32.const 64 + i32.const 47 call $~lib/builtins/abort unreachable end local.get $0 i32.load - local.tee $2 - local.get $1 - i32.const 2 - i32.shl - local.tee $3 - call $~lib/util/runtime/reallocate - local.set $1 + local.set $4 local.get $1 local.get $2 + i32.shl + local.set $5 + local.get $4 + local.get $5 + call $~lib/rt/tlsf/__realloc + local.set $6 + local.get $6 + local.get $3 + i32.add + i32.const 0 + local.get $5 + local.get $3 + i32.sub + call $~lib/memory/memory.fill + local.get $6 + local.get $4 i32.ne if local.get $0 - i32.load - drop - local.get $0 - local.get $1 + local.get $6 + call $~lib/rt/purerc/__retain i32.store local.get $0 - local.get $1 + local.get $6 i32.store offset=4 end local.get $0 - local.get $3 + local.get $5 i32.store offset=8 end ) - (func $~lib/array/Array<~lib/string/String>#push (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/tlsf/freeBlock (; 48 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 49 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 2120 + i32.const 2176 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/purerc/growRoots (; 50 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR local.get $0 - local.get $0 - i32.load offset=12 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 51 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 i32.const 1 i32.add - local.tee $3 - call $~lib/array/ensureCapacity + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 52 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 2016 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 2016 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__retainRelease (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.ne + if + global.get $~lib/builtins/HEAP_BASE + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + local.get $2 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + end + local.get $0 + ) + (func $~lib/array/Array<~lib/string/String>#push (; 54 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.add + local.set $3 + local.get $0 + local.get $3 + i32.const 2 + call $~lib/array/ensureSize local.get $0 i32.load offset=4 local.get $2 i32.const 2 i32.shl i32.add - local.tee $2 - i32.load + local.set $4 + local.get $4 local.get $1 - i32.ne - if - local.get $2 - local.get $1 - i32.store - end + local.get $4 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store local.get $0 local.get $3 i32.store offset=12 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/string/String#split (; 32 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#split (; 55 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2445,242 +4511,341 @@ (local $8 i32) (local $9 i32) (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 + i32.const 0 + i32.ne i32.eqz if i32.const 0 - i32.const 264 - i32.const 364 + i32.const 312 + i32.const 357 i32.const 4 call $~lib/builtins/abort unreachable end - block $folding-inner0 - local.get $2 - i32.eqz - br_if $folding-inner0 + local.get $2 + i32.eqz + if + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $3 local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $1 + i32.const 0 + i32.eq + if + block (result i32) + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $3 + local.get $3 + i32.load offset=4 + local.set $4 + local.get $4 + local.get $0 + call $~lib/rt/purerc/__retain + i32.store + local.get $3 + end + call $~lib/rt/purerc/__retain + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + return + end + local.get $0 + call $~lib/string/String#get:length + local.set $5 + local.get $1 + call $~lib/string/String#get:length + local.set $6 + local.get $2 + i32.const 0 + i32.lt_s + if + global.get $~lib/builtins/i32.MAX_VALUE + local.set $2 + end + local.get $6 + i32.eqz + if + local.get $5 i32.eqz if - i32.const 1 - call $~lib/util/runtime/makeArray - local.tee $1 - i32.load offset=4 - local.get $0 - i32.store + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $4 local.get $1 + call $~lib/rt/purerc/__release + local.get $4 return end - local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.set $3 - i32.const 2147483647 + local.get $5 + local.tee $4 local.get $2 - local.get $2 - i32.const 0 + local.tee $3 + local.get $4 + local.get $3 i32.lt_s select local.set $5 - local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $8 - if - local.get $3 - i32.eqz - if - i32.const 1 - call $~lib/util/runtime/makeArray - local.tee $0 - i32.load offset=4 - i32.const 120 - i32.store - local.get $0 - return - end - else - local.get $3 - i32.eqz - br_if $folding-inner0 - local.get $3 - local.get $5 - local.get $3 - local.get $5 - i32.lt_s - select - local.tee $4 - call $~lib/util/runtime/makeArray - local.tee $3 - i32.load offset=4 - local.set $5 - i32.const 0 - local.set $1 - loop $repeat|0 - local.get $1 - local.get $4 - i32.lt_s - if - i32.const 2 - call $~lib/util/runtime/allocate - local.tee $2 - local.get $1 - i32.const 1 - i32.shl - local.get $0 - i32.add - i32.load16_u - i32.store16 - local.get $1 - i32.const 2 - i32.shl - local.get $5 - i32.add - local.get $2 - i32.store - local.get $2 - i32.const 16 - call $~lib/util/runtime/register - drop - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $repeat|0 - end - end - local.get $3 - return - end + local.get $5 + i32.const 2 + i32.const 17 i32.const 0 - call $~lib/util/runtime/makeArray - local.set $2 - loop $continue|1 - local.get $0 - local.get $1 - local.get $4 - call $~lib/string/String#indexOf - local.tee $7 - i32.const -1 - i32.ne - if + call $~lib/rt/common/__allocArray + local.set $4 + local.get $4 + i32.load offset=4 + local.set $3 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 local.get $7 - local.get $4 - i32.sub - local.tee $6 - i32.const 0 - i32.gt_s - if - local.get $6 - i32.const 1 - i32.shl - local.tee $6 - call $~lib/util/runtime/allocate - local.tee $9 - local.get $4 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $6 - call $~lib/memory/memory.copy - local.get $2 - local.get $9 - i32.const 16 - call $~lib/util/runtime/register - call $~lib/array/Array<~lib/string/String>#push - else - local.get $2 - i32.const 120 - call $~lib/array/Array<~lib/string/String>#push - end local.get $5 - local.get $10 + i32.lt_s + i32.eqz + br_if $break|0 + i32.const 2 + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $8 + local.get $8 + local.get $0 + local.get $7 + i32.const 1 + i32.shl + i32.add + i32.load16_u + i32.store16 + local.get $3 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $8 + call $~lib/rt/purerc/__retain + drop + local.get $7 i32.const 1 i32.add - local.tee $10 - i32.eq - if - local.get $2 - return - end - local.get $7 - local.get $8 - i32.add - local.set $4 - br $continue|1 + local.set $7 + br $repeat|0 + unreachable end + unreachable end local.get $4 + call $~lib/rt/purerc/__retain + local.set $8 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 + return + else + local.get $5 i32.eqz if i32.const 1 - call $~lib/util/runtime/makeArray - local.tee $1 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + local.set $3 + local.get $3 i32.load offset=4 - local.tee $2 - i32.load - local.get $0 - i32.ne - if - local.get $2 - local.get $0 - i32.store - end + i32.const 120 + i32.store + local.get $3 + call $~lib/rt/purerc/__retain + local.set $4 local.get $1 + call $~lib/rt/purerc/__release + local.get $4 return end - local.get $3 - local.get $4 - i32.sub - local.tee $1 - i32.const 0 - i32.gt_s - if - local.get $1 - i32.const 1 - i32.shl - local.tee $1 - call $~lib/util/runtime/allocate - local.tee $3 - local.get $4 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $1 - call $~lib/memory/memory.copy - local.get $2 - local.get $3 - i32.const 16 - call $~lib/util/runtime/register - call $~lib/array/Array<~lib/string/String>#push - else - local.get $2 - i32.const 120 - call $~lib/array/Array<~lib/string/String>#push - end - local.get $2 - return end i32.const 0 - call $~lib/util/runtime/makeArray + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $9 + i32.const 0 + local.set $10 + i32.const 0 + local.set $11 + i32.const 0 + local.set $12 + block $break|1 + loop $continue|1 + local.get $0 + local.get $1 + local.get $11 + call $~lib/string/String#indexOf + local.tee $10 + i32.const -1 + i32.ne + if + local.get $10 + local.get $11 + i32.sub + local.set $3 + local.get $3 + i32.const 0 + i32.gt_s + if + local.get $3 + i32.const 1 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $4 + local.get $0 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $3 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $4 + call $~lib/array/Array<~lib/string/String>#push + drop + else + local.get $9 + i32.const 120 + call $~lib/array/Array<~lib/string/String>#push + drop + end + local.get $12 + i32.const 1 + i32.add + local.tee $12 + local.get $2 + i32.eq + if + local.get $9 + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + return + end + local.get $10 + local.get $6 + i32.add + local.set $11 + br $continue|1 + end + end + end + local.get $11 + i32.eqz + if + local.get $9 + local.get $0 + call $~lib/array/Array<~lib/string/String>#push + drop + local.get $9 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 + return + end + local.get $5 + local.get $11 + i32.sub + local.set $13 + local.get $13 + i32.const 0 + i32.gt_s + if + local.get $13 + i32.const 1 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $3 + local.get $3 + local.get $0 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $13 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $3 + call $~lib/array/Array<~lib/string/String>#push + drop + else + local.get $9 + i32.const 120 + call $~lib/array/Array<~lib/string/String>#push + drop + end + local.get $9 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array<~lib/string/String>#__get (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#get:length (; 56 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 57 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/purerc/__retain + ) + (func $~lib/array/Array<~lib/string/String>#__get (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=12 i32.ge_u if - i32.const 0 - i32.const 1920 - i32.const 96 + i32.const 2232 + i32.const 2072 + i32.const 97 i32.const 45 call $~lib/builtins/abort unreachable @@ -2692,123 +4857,152 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 1920 - i32.const 99 + i32.const 2120 + i32.const 2072 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable end local.get $0 - i32.load offset=4 local.get $1 - i32.const 2 - i32.shl - i32.add - i32.load + call $~lib/array/Array<~lib/string/String>#__unchecked_get ) - (func $~lib/util/number/decimalCount32 (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/decimalCount32 (; 59 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) local.get $0 i32.const 100000 i32.lt_u - if (result i32) + if local.get $0 i32.const 100 i32.lt_u - if (result i32) + if i32.const 1 i32.const 2 local.get $0 i32.const 10 i32.lt_u select + return else - i32.const 3 i32.const 4 i32.const 5 local.get $0 i32.const 10000 i32.lt_u select + local.set $1 + i32.const 3 + local.get $1 local.get $0 i32.const 1000 i32.lt_u select + return end + unreachable + unreachable else local.get $0 i32.const 10000000 i32.lt_u - if (result i32) + if i32.const 6 i32.const 7 local.get $0 i32.const 1000000 i32.lt_u select + return else - i32.const 8 i32.const 9 i32.const 10 local.get $0 i32.const 1000000000 i32.lt_u select + local.set $1 + i32.const 8 + local.get $1 local.get $0 i32.const 100000000 i32.lt_u select + return end + unreachable + unreachable end + unreachable + unreachable ) - (func $~lib/util/number/utoa32_lut (; 35 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/number/utoa32_lut (; 60 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - i32.const 2620 - i32.load + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + (local $9 i64) + i32.const 2840 + i32.load offset=4 local.set $3 - loop $continue|0 - local.get $1 - i32.const 10000 - i32.ge_u - if + block $break|0 + loop $continue|0 local.get $1 i32.const 10000 - i32.rem_u - local.set $4 - local.get $1 - i32.const 10000 - i32.div_u - local.set $1 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - br $continue|0 + i32.ge_u + if + local.get $1 + i32.const 10000 + i32.div_u + local.set $4 + local.get $1 + i32.const 10000 + i32.rem_u + local.set $5 + local.get $4 + local.set $1 + local.get $5 + i32.const 100 + i32.div_u + local.set $6 + local.get $5 + i32.const 100 + i32.rem_u + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $8 + local.get $3 + local.get $7 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $9 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $8 + local.get $9 + i64.const 32 + i64.shl + i64.or + i64.store + br $continue|0 + end end end local.get $1 @@ -2817,26 +5011,31 @@ if local.get $1 i32.const 100 - i32.rem_u - local.set $4 + i32.div_u + local.set $7 local.get $1 i32.const 100 - i32.div_u + i32.rem_u + local.set $6 + local.get $7 local.set $1 local.get $2 i32.const 2 i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $4 + local.set $2 + local.get $3 + local.get $6 i32.const 2 i32.shl - local.get $3 i32.add i32.load + local.set $5 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $5 i32.store end local.get $1 @@ -2846,45 +5045,58 @@ local.get $2 i32.const 2 i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add + local.set $2 + local.get $3 local.get $1 i32.const 2 i32.shl - local.get $3 i32.add i32.load + local.set $5 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $5 i32.store else local.get $2 i32.const 1 i32.sub + local.set $2 + i32.const 48 + local.get $1 + i32.add + local.set $5 + local.get $0 + local.get $2 i32.const 1 i32.shl - local.get $0 - i32.add - local.get $1 - i32.const 48 i32.add + local.get $5 i32.store16 end ) - (func $~lib/util/number/itoa32 (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (; 61 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 i32.eqz if - i32.const 848 + i32.const 896 + call $~lib/rt/purerc/__retain return end local.get $0 i32.const 0 i32.lt_s - local.tee $1 + local.set $1 + local.get $1 if i32.const 0 local.get $0 @@ -2895,190 +5107,258 @@ call $~lib/util/number/decimalCount32 local.get $1 i32.add - local.tee $3 + local.set $2 + local.get $2 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.tee $2 - local.get $0 - local.get $3 - call $~lib/util/number/utoa32_lut + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $3 + block $~lib/util/number/utoa32_core|inlined.0 + local.get $3 + local.set $6 + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/number/utoa32_lut + end local.get $1 if - local.get $2 + local.get $3 i32.const 45 i32.store16 end - local.get $2 - i32.const 16 - call $~lib/util/runtime/register + local.get $3 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/utoa32 (; 37 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/utoa32 (; 62 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 i32.eqz if - i32.const 848 + i32.const 896 + call $~lib/rt/purerc/__retain return end local.get $0 call $~lib/util/number/decimalCount32 - local.tee $1 + local.set $1 + local.get $1 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.tee $2 - local.get $0 - local.get $1 - call $~lib/util/number/utoa32_lut - local.get $2 i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc + local.set $2 + block $~lib/util/number/utoa32_core|inlined.1 + local.get $2 + local.set $5 + local.get $0 + local.set $4 + local.get $1 + local.set $3 + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/number/utoa32_lut + end + local.get $2 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/decimalCount64 (; 38 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/decimalCount64 (; 63 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (local $1 i32) local.get $0 i64.const 1000000000000000 i64.lt_u - if (result i32) + if local.get $0 i64.const 1000000000000 i64.lt_u - if (result i32) + if i32.const 11 i32.const 12 local.get $0 i64.const 100000000000 i64.lt_u select + return else - i32.const 13 i32.const 14 i32.const 15 local.get $0 i64.const 100000000000000 i64.lt_u select + local.set $1 + i32.const 13 + local.get $1 local.get $0 i64.const 10000000000000 i64.lt_u select + return end + unreachable + unreachable else local.get $0 i64.const 100000000000000000 i64.lt_u - if (result i32) + if i32.const 16 i32.const 17 local.get $0 i64.const 10000000000000000 i64.lt_u select + return else - i32.const 18 i32.const 19 i32.const 20 local.get $0 i64.const -8446744073709551616 i64.lt_u select + local.set $1 + i32.const 18 + local.get $1 local.get $0 i64.const 1000000000000000000 i64.lt_u select + return end + unreachable + unreachable end + unreachable + unreachable ) - (func $~lib/util/number/utoa64_lut (; 39 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/util/number/utoa64_lut (; 64 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i32) - (local $4 i32) + (local $4 i64) (local $5 i32) (local $6 i32) - i32.const 2620 - i32.load + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i64) + (local $13 i64) + i32.const 2840 + i32.load offset=4 local.set $3 - loop $continue|0 - local.get $1 - i64.const 100000000 - i64.ge_u - if - local.get $1 + block $break|0 + loop $continue|0 local.get $1 i64.const 100000000 - i64.div_u - local.tee $1 - i64.const 100000000 - i64.mul - i64.sub - i32.wrap_i64 - local.tee $4 - i32.const 10000 - i32.div_u - local.tee $5 - i32.const 100 - i32.div_u - local.set $6 - local.get $5 - i32.const 100 - i32.rem_u - local.set $5 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $4 - i32.const 10000 - i32.rem_u - local.tee $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $6 - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - local.get $5 - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - br $continue|0 + i64.ge_u + if + local.get $1 + i64.const 100000000 + i64.div_u + local.set $4 + local.get $1 + local.get $4 + i64.const 100000000 + i64.mul + i64.sub + i32.wrap_i64 + local.set $5 + local.get $4 + local.set $1 + local.get $5 + i32.const 10000 + i32.div_u + local.set $6 + local.get $5 + i32.const 10000 + i32.rem_u + local.set $7 + local.get $6 + i32.const 100 + i32.div_u + local.set $8 + local.get $6 + i32.const 100 + i32.rem_u + local.set $9 + local.get $7 + i32.const 100 + i32.div_u + local.set $10 + local.get $7 + i32.const 100 + i32.rem_u + local.set $11 + local.get $3 + local.get $10 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $12 + local.get $3 + local.get $11 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $13 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $12 + local.get $13 + i64.const 32 + i64.shl + i64.or + i64.store + local.get $3 + local.get $8 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $12 + local.get $3 + local.get $9 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $13 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $12 + local.get $13 + i64.const 32 + i64.shl + i64.or + i64.store + br $continue|0 + end end end local.get $0 @@ -3087,14 +5367,19 @@ local.get $2 call $~lib/util/number/utoa32_lut ) - (func $~lib/util/number/utoa64 (; 40 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/utoa64 (; 65 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i64) local.get $0 i64.eqz if - i32.const 848 + i32.const 896 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -3103,513 +5388,754 @@ if local.get $0 i32.wrap_i64 - local.tee $1 + local.set $2 + local.get $2 call $~lib/util/number/decimalCount32 - local.tee $3 + local.set $3 + local.get $3 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.tee $2 - local.get $1 - local.get $3 - call $~lib/util/number/utoa32_lut + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $1 + block $~lib/util/number/utoa32_core|inlined.2 + local.get $1 + local.set $6 + local.get $2 + local.set $5 + local.get $3 + local.set $4 + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/number/utoa32_lut + end else local.get $0 call $~lib/util/number/decimalCount64 - local.tee $1 + local.set $3 + local.get $3 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.tee $2 - local.get $0 - local.get $1 - call $~lib/util/number/utoa64_lut + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $1 + block $~lib/util/number/utoa64_core|inlined.0 + local.get $1 + local.set $4 + local.get $0 + local.set $7 + local.get $3 + local.set $2 + local.get $4 + local.get $7 + local.get $2 + call $~lib/util/number/utoa64_lut + end end - local.get $2 - i32.const 16 - call $~lib/util/runtime/register + local.get $1 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/itoa64 (; 41 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/itoa64 (; 66 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) local.get $0 i64.eqz if - i32.const 848 + i32.const 896 + call $~lib/rt/purerc/__retain return end - block (result i32) - local.get $0 + local.get $0 + i64.const 0 + i64.lt_s + local.set $1 + local.get $1 + if i64.const 0 - i64.lt_s - local.tee $1 - if - i64.const 0 - local.get $0 - i64.sub - local.set $0 - end local.get $0 - i64.const 4294967295 - i64.le_u + i64.sub + local.set $0 end + local.get $0 + i64.const 4294967295 + i64.le_u if local.get $0 i32.wrap_i64 - local.tee $2 + local.set $3 + local.get $3 call $~lib/util/number/decimalCount32 local.get $1 i32.add - local.tee $4 + local.set $4 + local.get $4 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.tee $3 - local.get $2 - local.get $4 - call $~lib/util/number/utoa32_lut + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $2 + block $~lib/util/number/utoa32_core|inlined.3 + local.get $2 + local.set $7 + local.get $3 + local.set $6 + local.get $4 + local.set $5 + local.get $7 + local.get $6 + local.get $5 + call $~lib/util/number/utoa32_lut + end else local.get $0 call $~lib/util/number/decimalCount64 local.get $1 i32.add - local.tee $2 + local.set $4 + local.get $4 i32.const 1 i32.shl - call $~lib/util/runtime/allocate - local.tee $3 - local.get $0 - local.get $2 - call $~lib/util/number/utoa64_lut + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $2 + block $~lib/util/number/utoa64_core|inlined.1 + local.get $2 + local.set $5 + local.get $0 + local.set $8 + local.get $4 + local.set $3 + local.get $5 + local.get $8 + local.get $3 + call $~lib/util/number/utoa64_lut + end end local.get $1 if - local.get $3 + local.get $2 i32.const 45 i32.store16 end - local.get $3 - i32.const 16 - call $~lib/util/runtime/register + local.get $2 + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/genDigits (; 42 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (func $~lib/builtins/isFinite (; 67 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.eq + ) + (func $~lib/builtins/isNaN (; 68 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/array/Array#__unchecked_get (; 69 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + i64.load + ) + (func $~lib/array/Array#__unchecked_get (; 70 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.shl + i32.add + i32.load16_s + ) + (func $~lib/util/number/genDigits (; 71 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) (local $7 i32) - (local $8 i32) + (local $8 i64) (local $9 i64) (local $10 i64) - (local $11 i64) + (local $11 i32) (local $12 i32) - (local $13 i32) - (local $14 i64) - local.get $3 - local.get $1 - i64.sub - local.set $9 - i64.const 1 + (local $13 i64) + (local $14 i32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i32) + (local $19 i64) + (local $20 i32) + (local $21 i64) + (local $22 i64) + (local $23 i64) + (local $24 i64) + (local $25 i32) + (local $26 i32) i32.const 0 local.get $4 i32.sub - local.tee $12 + local.set $7 + i64.const 1 + local.get $7 i64.extend_i32_s - local.tee $1 i64.shl - local.tee $10 + local.set $8 + local.get $8 i64.const 1 i64.sub - local.tee $14 - local.get $3 - i64.and - local.set $11 + local.set $9 local.get $3 local.get $1 + i64.sub + local.set $10 + local.get $4 + local.set $11 + local.get $3 + local.get $7 + i64.extend_i32_s i64.shr_u i32.wrap_i64 - local.tee $7 - call $~lib/util/number/decimalCount32 - local.set $4 - i32.const 4988 - i32.load + local.set $12 + local.get $3 + local.get $9 + i64.and local.set $13 - loop $continue|0 - local.get $4 - i32.const 0 - i32.gt_s - if - block $break|1 - block $case10|1 - block $case9|1 - block $case8|1 - block $case7|1 - block $case6|1 - block $case5|1 - block $case4|1 - block $case3|1 - block $case2|1 - block $case1|1 - local.get $4 - i32.const 10 - i32.ne - if - local.get $4 - i32.const 9 - i32.eq - br_if $case1|1 - block $tablify|0 - local.get $4 + local.get $12 + call $~lib/util/number/decimalCount32 + local.set $14 + local.get $6 + local.set $15 + i32.const 5208 + i32.load offset=4 + local.set $16 + block $break|0 + loop $continue|0 + local.get $14 + i32.const 0 + i32.gt_s + if + block $break|1 + block $case10|1 + block $case9|1 + block $case8|1 + block $case7|1 + block $case6|1 + block $case5|1 + block $case4|1 + block $case3|1 + block $case2|1 + block $case1|1 + block $case0|1 + local.get $14 + local.set $18 + local.get $18 + i32.const 10 + i32.eq + br_if $case0|1 + local.get $18 + i32.const 9 + i32.eq + br_if $case1|1 + local.get $18 + i32.const 8 + i32.eq + br_if $case2|1 + local.get $18 + i32.const 7 + i32.eq + br_if $case3|1 + local.get $18 + i32.const 6 + i32.eq + br_if $case4|1 + local.get $18 + i32.const 5 + i32.eq + br_if $case5|1 + local.get $18 + i32.const 4 + i32.eq + br_if $case6|1 + local.get $18 + i32.const 3 + i32.eq + br_if $case7|1 + local.get $18 + i32.const 2 + i32.eq + br_if $case8|1 + local.get $18 i32.const 1 - i32.sub - br_table $case9|1 $case8|1 $case7|1 $case6|1 $case5|1 $case4|1 $case3|1 $case2|1 $tablify|0 + i32.eq + br_if $case9|1 + br $case10|1 end - br $case10|1 + block + local.get $12 + i32.const 1000000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 1000000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 1000000000 - i32.div_u - local.set $8 - local.get $7 - i32.const 1000000000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 100000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 100000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 100000000 - i32.div_u - local.set $8 - local.get $7 - i32.const 100000000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 10000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 10000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 10000000 - i32.div_u - local.set $8 - local.get $7 - i32.const 10000000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 1000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 1000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 1000000 - i32.div_u - local.set $8 - local.get $7 - i32.const 1000000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 100000 + i32.div_u + local.set $17 + local.get $12 + i32.const 100000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 100000 - i32.div_u - local.set $8 - local.get $7 - i32.const 100000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 10000 + i32.div_u + local.set $17 + local.get $12 + i32.const 10000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 10000 - i32.div_u - local.set $8 - local.get $7 - i32.const 10000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 1000 + i32.div_u + local.set $17 + local.get $12 + i32.const 1000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 1000 - i32.div_u - local.set $8 - local.get $7 - i32.const 1000 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 100 + i32.div_u + local.set $17 + local.get $12 + i32.const 100 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 100 - i32.div_u - local.set $8 - local.get $7 - i32.const 100 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + i32.const 10 + i32.div_u + local.set $17 + local.get $12 + i32.const 10 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - i32.const 10 - i32.div_u - local.set $8 - local.get $7 - i32.const 10 - i32.rem_u - local.set $7 - br $break|1 + block + local.get $12 + local.set $17 + i32.const 0 + local.set $12 + br $break|1 + unreachable + end + unreachable end - local.get $7 - local.set $8 - i32.const 0 - local.set $7 - br $break|1 + block + i32.const 0 + local.set $17 + br $break|1 + unreachable + end + unreachable end - i32.const 0 - local.set $8 - end - local.get $6 - local.get $8 - i32.or - if - local.get $6 - local.tee $2 + local.get $17 + local.get $15 + i32.or + if + local.get $0 + block (result i32) + local.get $15 + local.tee $18 + i32.const 1 + i32.add + local.set $15 + local.get $18 + end + i32.const 1 + i32.shl + i32.add + i32.const 48 + local.get $17 + i32.const 65535 + i32.and + i32.add + i32.store16 + end + local.get $14 i32.const 1 - i32.add - local.set $6 - local.get $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $8 - i32.const 65535 - i32.and - i32.const 48 - i32.add - i32.store16 - end - local.get $4 - i32.const 1 - i32.sub - local.set $4 - local.get $7 - i64.extend_i32_u - local.get $12 - i64.extend_i32_s - i64.shl - local.get $11 - i64.add - local.tee $1 - local.get $5 - i64.le_u - if - global.get $~lib/util/number/_K - local.get $4 - i32.add - global.set $~lib/util/number/_K - local.get $4 - i32.const 2 - i32.shl - local.get $13 - i32.add - i64.load32_u + i32.sub + local.set $14 local.get $12 + i64.extend_i32_u + local.get $7 i64.extend_i32_s i64.shl - local.set $3 - local.get $6 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add - local.tee $2 - i32.load16_u - local.set $4 - loop $continue|2 - local.get $5 - local.get $1 - i64.sub - local.get $3 - i64.ge_u - i32.const 0 - local.get $1 - local.get $9 - i64.lt_u - select - if (result i32) - i32.const 1 - local.get $9 - local.get $1 - i64.sub - local.get $1 - local.get $3 - i64.add - local.get $9 - i64.sub - i64.gt_u - local.get $1 - local.get $3 - i64.add - local.get $9 - i64.lt_u - select - else - i32.const 0 - end - if - local.get $4 + local.get $13 + i64.add + local.set $19 + local.get $19 + local.get $5 + i64.le_u + if + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + block $~lib/util/number/grisuRound|inlined.0 + local.get $0 + local.set $20 + local.get $15 + local.set $18 + local.get $5 + local.set $24 + local.get $19 + local.set $23 + local.get $16 + local.get $14 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.get $7 + i64.extend_i32_s + i64.shl + local.set $22 + local.get $10 + local.set $21 + local.get $20 + local.get $18 i32.const 1 i32.sub - local.set $4 - local.get $1 - local.get $3 - i64.add - local.set $1 - br $continue|2 + i32.const 1 + i32.shl + i32.add + local.set $25 + local.get $25 + i32.load16_u + local.set $26 + block $break|2 + loop $continue|2 + local.get $23 + local.get $21 + i64.lt_u + if (result i32) + local.get $24 + local.get $23 + i64.sub + local.get $22 + i64.ge_u + else + i32.const 0 + end + if (result i32) + local.get $23 + local.get $22 + i64.add + local.get $21 + i64.lt_u + if (result i32) + i32.const 1 + else + local.get $21 + local.get $23 + i64.sub + local.get $23 + local.get $22 + i64.add + local.get $21 + i64.sub + i64.gt_u + end + else + i32.const 0 + end + if + local.get $26 + i32.const 1 + i32.sub + local.set $26 + local.get $23 + local.get $22 + i64.add + local.set $23 + br $continue|2 + end + end + end + local.get $25 + local.get $26 + i32.store16 end + local.get $15 + return end - local.get $2 - local.get $4 - i32.store16 - local.get $6 - return + br $continue|0 end - br $continue|0 end end - loop $continue|3 (result i32) - local.get $5 - i64.const 10 - i64.mul - local.set $5 - local.get $11 - i64.const 10 - i64.mul - local.tee $3 - local.get $12 - i64.extend_i32_s - i64.shr_u - local.tee $1 - local.get $6 - i64.extend_i32_s - i64.or - i64.const 0 - i64.ne - if - local.get $6 - local.tee $2 + block $break|3 + loop $continue|3 i32.const 1 - i32.add - local.set $6 - local.get $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $1 - i32.wrap_i64 - i32.const 65535 - i32.and - i32.const 48 - i32.add - i32.store16 - end - local.get $4 - i32.const 1 - i32.sub - local.set $4 - local.get $3 - local.get $14 - i64.and - local.tee $11 - local.get $5 - i64.ge_u - br_if $continue|3 - global.get $~lib/util/number/_K - local.get $4 - i32.add - global.set $~lib/util/number/_K - local.get $11 - local.set $1 - i32.const 0 - local.get $4 - i32.sub - i32.const 2 - i32.shl - local.get $13 - i32.add - i64.load32_u - local.get $9 - i64.mul - local.set $3 - local.get $6 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add - local.tee $2 - i32.load16_u - local.set $4 - loop $continue|4 - local.get $5 - local.get $1 - i64.sub - local.get $10 - i64.ge_u - i32.const 0 - local.get $1 - local.get $3 - i64.lt_u - select - if (result i32) - i32.const 1 - local.get $3 - local.get $1 - i64.sub - local.get $1 - local.get $10 - i64.add - local.get $3 - i64.sub - i64.gt_u - local.get $1 - local.get $10 - i64.add - local.get $3 - i64.lt_u - select - else - i32.const 0 - end if - local.get $4 + local.get $13 + i64.const 10 + i64.mul + local.set $13 + local.get $5 + i64.const 10 + i64.mul + local.set $5 + local.get $13 + local.get $7 + i64.extend_i32_s + i64.shr_u + local.set $19 + local.get $19 + local.get $15 + i64.extend_i32_s + i64.or + i64.const 0 + i64.ne + if + local.get $0 + block (result i32) + local.get $15 + local.tee $17 + i32.const 1 + i32.add + local.set $15 + local.get $17 + end + i32.const 1 + i32.shl + i32.add + i32.const 48 + local.get $19 + i32.wrap_i64 + i32.const 65535 + i32.and + i32.add + i32.store16 + end + local.get $13 + local.get $9 + i64.and + local.set $13 + local.get $14 i32.const 1 i32.sub - local.set $4 - local.get $1 - local.get $10 - i64.add - local.set $1 - br $continue|4 + local.set $14 + local.get $13 + local.get $5 + i64.lt_u + if + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + local.get $10 + local.get $16 + i32.const 0 + local.get $14 + i32.sub + i32.const 2 + i32.shl + i32.add + i64.load32_u + i64.mul + local.set $10 + block $~lib/util/number/grisuRound|inlined.1 + local.get $0 + local.set $26 + local.get $15 + local.set $17 + local.get $5 + local.set $24 + local.get $13 + local.set $23 + local.get $8 + local.set $22 + local.get $10 + local.set $21 + local.get $26 + local.get $17 + i32.const 1 + i32.sub + i32.const 1 + i32.shl + i32.add + local.set $25 + local.get $25 + i32.load16_u + local.set $18 + block $break|4 + loop $continue|4 + local.get $23 + local.get $21 + i64.lt_u + if (result i32) + local.get $24 + local.get $23 + i64.sub + local.get $22 + i64.ge_u + else + i32.const 0 + end + if (result i32) + local.get $23 + local.get $22 + i64.add + local.get $21 + i64.lt_u + if (result i32) + i32.const 1 + else + local.get $21 + local.get $23 + i64.sub + local.get $23 + local.get $22 + i64.add + local.get $21 + i64.sub + i64.gt_u + end + else + i32.const 0 + end + if + local.get $18 + i32.const 1 + i32.sub + local.set $18 + local.get $23 + local.get $22 + i64.add + local.set $23 + br $continue|4 + end + end + end + local.get $25 + local.get $18 + i32.store16 + end + local.get $15 + return + end + br $continue|3 end end - local.get $2 - local.get $4 - i32.store16 - local.get $6 end + local.get $15 ) - (func $~lib/util/number/prettify (; 43 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 72 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) local.get $2 i32.eqz if + local.get $0 local.get $1 i32.const 1 i32.shl - local.get $0 i32.add - i32.const 3145774 + i32.const 46 + i32.const 48 + i32.const 16 + i32.shl + i32.or i32.store local.get $1 i32.const 2 @@ -3617,10 +6143,11 @@ return end local.get $1 - local.get $1 local.get $2 i32.add - local.tee $3 + local.set $3 + local.get $1 + local.get $3 i32.le_s if (result i32) local.get $3 @@ -3629,56 +6156,69 @@ else i32.const 0 end - if (result i32) - loop $repeat|0 - block $break|0 - local.get $1 + if + block $break|0 + local.get $1 + local.set $4 + loop $repeat|0 + local.get $4 local.get $3 - i32.ge_s + i32.lt_s + i32.eqz br_if $break|0 - local.get $1 + local.get $0 + local.get $4 i32.const 1 i32.shl - local.get $0 i32.add i32.const 48 i32.store16 - local.get $1 + local.get $4 i32.const 1 i32.add - local.set $1 + local.set $4 br $repeat|0 + unreachable end + unreachable end + local.get $0 local.get $3 i32.const 1 i32.shl - local.get $0 i32.add - i32.const 3145774 + i32.const 46 + i32.const 48 + i32.const 16 + i32.shl + i32.or i32.store local.get $3 i32.const 2 i32.add + return else - local.get $3 - i32.const 21 - i32.le_s - i32.const 0 local.get $3 i32.const 0 i32.gt_s - select if (result i32) + local.get $3 + i32.const 21 + i32.le_s + else + i32.const 0 + end + if + local.get $0 local.get $3 i32.const 1 i32.shl - local.get $0 i32.add - local.tee $0 + local.set $4 + local.get $4 i32.const 2 i32.add - local.get $0 + local.get $4 i32.const 0 local.get $2 i32.sub @@ -3686,28 +6226,36 @@ i32.shl call $~lib/memory/memory.copy local.get $0 + local.get $3 + i32.const 1 + i32.shl + i32.add i32.const 46 i32.store16 local.get $1 i32.const 1 i32.add + return else - local.get $3 - i32.const 0 - i32.le_s - i32.const 0 i32.const -6 local.get $3 i32.lt_s - select if (result i32) + local.get $3 + i32.const 0 + i32.le_s + else + i32.const 0 + end + if i32.const 2 local.get $3 i32.sub - local.tee $3 + local.set $4 + local.get $0 + local.get $4 i32.const 1 i32.shl - local.get $0 i32.add local.get $0 local.get $1 @@ -3715,87 +6263,111 @@ i32.shl call $~lib/memory/memory.copy local.get $0 - i32.const 3014704 + i32.const 48 + i32.const 46 + i32.const 16 + i32.shl + i32.or i32.store - i32.const 2 - local.set $2 - loop $repeat|1 - block $break|1 - local.get $2 - local.get $3 - i32.ge_s + block $break|1 + i32.const 2 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $4 + i32.lt_s + i32.eqz br_if $break|1 - local.get $2 + local.get $0 + local.get $5 i32.const 1 i32.shl - local.get $0 i32.add i32.const 48 i32.store16 - local.get $2 + local.get $5 i32.const 1 i32.add - local.set $2 + local.set $5 br $repeat|1 + unreachable end + unreachable end local.get $1 - local.get $3 + local.get $4 i32.add + return else local.get $1 i32.const 1 i32.eq - if (result i32) + if local.get $0 i32.const 101 i32.store16 offset=2 - local.get $0 - i32.const 4 - i32.add - local.tee $0 - block (result i32) + block $~lib/util/number/genExponent|inlined.0 (result i32) + local.get $0 + i32.const 4 + i32.add + local.set $5 local.get $3 i32.const 1 i32.sub - local.tee $1 + local.set $4 + local.get $4 i32.const 0 i32.lt_s - local.tee $2 + local.set $6 + local.get $6 if i32.const 0 - local.get $1 + local.get $4 i32.sub - local.set $1 + local.set $4 end - local.get $1 + local.get $4 + call $~lib/util/number/decimalCount32 + i32.const 1 + i32.add + local.set $7 + block $~lib/util/number/utoa32_core|inlined.4 + local.get $5 + local.set $10 + local.get $4 + local.set $9 + local.get $7 + local.set $8 + local.get $10 + local.get $9 + local.get $8 + call $~lib/util/number/utoa32_lut + end + local.get $5 + i32.const 45 + i32.const 43 + local.get $6 + select + i32.store16 + local.get $7 end - local.get $1 - call $~lib/util/number/decimalCount32 - i32.const 1 - i32.add - local.tee $1 - call $~lib/util/number/utoa32_lut - local.get $0 - i32.const 45 - i32.const 43 - local.get $2 - select - i32.store16 + local.set $1 local.get $1 i32.const 2 i32.add + return else + local.get $1 + i32.const 1 + i32.shl + local.set $7 local.get $0 i32.const 4 i32.add local.get $0 i32.const 2 i32.add - local.get $1 - i32.const 1 - i32.shl - local.tee $2 + local.get $7 i32.const 2 i32.sub call $~lib/memory/memory.copy @@ -3803,511 +6375,944 @@ i32.const 46 i32.store16 offset=2 local.get $0 - local.get $2 + local.get $7 i32.add - local.tee $0 i32.const 101 i32.store16 offset=2 - local.get $0 - i32.const 4 - i32.add - local.tee $2 - block (result i32) + local.get $1 + block $~lib/util/number/genExponent|inlined.1 (result i32) + local.get $0 + local.get $7 + i32.add + i32.const 4 + i32.add + local.set $4 local.get $3 i32.const 1 i32.sub - local.tee $0 + local.set $6 + local.get $6 i32.const 0 i32.lt_s - local.tee $3 + local.set $5 + local.get $5 if i32.const 0 - local.get $0 + local.get $6 i32.sub - local.set $0 + local.set $6 end - local.get $0 + local.get $6 + call $~lib/util/number/decimalCount32 + i32.const 1 + i32.add + local.set $8 + block $~lib/util/number/utoa32_core|inlined.5 + local.get $4 + local.set $11 + local.get $6 + local.set $10 + local.get $8 + local.set $9 + local.get $11 + local.get $10 + local.get $9 + call $~lib/util/number/utoa32_lut + end + local.get $4 + i32.const 45 + i32.const 43 + local.get $5 + select + i32.store16 + local.get $8 end - local.get $0 - call $~lib/util/number/decimalCount32 - i32.const 1 i32.add - local.tee $0 - call $~lib/util/number/utoa32_lut - local.get $2 - i32.const 45 - i32.const 43 - local.get $3 - select - i32.store16 - local.get $0 + local.set $1 local.get $1 - i32.add i32.const 2 i32.add + return end + unreachable end + unreachable end + unreachable end + unreachable + unreachable ) - (func $~lib/util/number/dtoa_core (; 44 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) - (local $2 i64) - (local $3 i32) - (local $4 i64) - (local $5 i64) + (func $~lib/util/number/dtoa_core (; 73 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (local $2 i32) + (local $3 f64) + (local $4 i32) + (local $5 i32) (local $6 i64) (local $7 i32) (local $8 i64) (local $9 i64) - (local $10 i32) + (local $10 i64) (local $11 i32) + (local $12 i64) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 f64) + (local $17 i64) + (local $18 i64) + (local $19 i64) + (local $20 i64) + (local $21 i64) + (local $22 i64) + (local $23 i64) + (local $24 i64) + (local $25 i64) + (local $26 i32) + (local $27 i64) + (local $28 i32) local.get $1 f64.const 0 f64.lt - local.tee $10 + local.set $2 + local.get $2 if - local.get $0 - i32.const 45 - i32.store16 local.get $1 f64.neg local.set $1 + local.get $0 + i32.const 45 + i32.store16 end - local.get $1 - i64.reinterpret_f64 - local.tee $2 - i64.const 9218868437227405312 - i64.and - i64.const 52 - i64.shr_u - i32.wrap_i64 - local.tee $11 - i32.const 0 - i32.ne - local.set $7 - local.get $2 - i64.const 4503599627370495 - i64.and - local.get $7 - i64.extend_i32_u - i64.const 52 - i64.shl - i64.add - local.tee $5 - i64.const 1 - i64.shl - i64.const 1 - i64.add - local.tee $2 - i64.clz - i32.wrap_i64 - local.set $3 - local.get $2 - local.get $3 - i64.extend_i32_s - i64.shl - global.set $~lib/util/number/_frc_plus - local.get $11 - i32.const 1 - local.get $7 - select - i32.const 1075 - i32.sub - local.tee $7 - i32.const 1 - i32.sub - local.get $3 - i32.sub - local.set $3 - local.get $5 - local.get $5 - i64.const 4503599627370496 - i64.eq - i32.const 1 - i32.add - local.tee $11 - i64.extend_i32_s - i64.shl - i64.const 1 - i64.sub - local.get $7 - local.get $11 - i32.sub - local.get $3 - i32.sub - i64.extend_i32_s - i64.shl - global.set $~lib/util/number/_frc_minus - local.get $3 - global.set $~lib/util/number/_exp - i32.const 348 - i32.const -61 - global.get $~lib/util/number/_exp - i32.sub - f64.convert_i32_s - f64.const 0.30102999566398114 - f64.mul - f64.const 347 - f64.add - local.tee $1 - i32.trunc_f64_s - local.tee $3 - local.get $3 - f64.convert_i32_s - local.get $1 - f64.ne - i32.add - i32.const 3 - i32.shr_s - i32.const 1 - i32.add - local.tee $3 - i32.const 3 - i32.shl - i32.sub - global.set $~lib/util/number/_K - i32.const 4676 - i32.load - local.get $3 - i32.const 3 - i32.shl - i32.add - i64.load - global.set $~lib/util/number/_frc_pow - i32.const 4900 - i32.load - local.get $3 - i32.const 1 - i32.shl - i32.add - i32.load16_s - global.set $~lib/util/number/_exp_pow - global.get $~lib/util/number/_frc_pow - local.tee $6 - i64.const 4294967295 - i64.and - local.set $2 - global.get $~lib/util/number/_frc_plus - local.tee $8 - i64.const 4294967295 - i64.and - local.tee $4 - local.get $6 - i64.const 32 - i64.shr_u - local.tee $6 - i64.mul - local.get $8 - i64.const 32 - i64.shr_u - local.tee $8 - local.get $2 - i64.mul - local.get $2 - local.get $4 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.tee $4 - i64.const 4294967295 - i64.and - i64.add - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u - local.get $6 - local.get $8 - i64.mul - local.get $4 - i64.const 32 - i64.shr_u - i64.add - i64.add - i64.const 1 - i64.sub - local.tee $8 - local.get $6 - global.get $~lib/util/number/_frc_minus - local.tee $4 - i64.const 4294967295 - i64.and - local.tee $9 - i64.mul - local.get $4 - i64.const 32 - i64.shr_u - local.tee $4 - local.get $2 - i64.mul - local.get $2 - local.get $9 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.tee $9 - i64.const 4294967295 - i64.and - i64.add - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u - local.get $4 - local.get $6 - i64.mul - local.get $9 - i64.const 32 - i64.shr_u - i64.add - i64.add - i64.const 1 - i64.add - i64.sub - local.set $4 - local.get $10 - i32.const 1 - i32.shl + block $~lib/util/number/grisu2|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $3 + i64.reinterpret_f64 + local.set $6 + local.get $6 + i64.const 9218868437227405312 + i64.and + i64.const 52 + i64.shr_u + i32.wrap_i64 + local.set $7 + local.get $6 + i64.const 4503599627370495 + i64.and + local.set $8 + local.get $7 + i32.const 0 + i32.ne + i64.extend_i32_u + i64.const 52 + i64.shl + local.get $8 + i64.add + local.set $9 + local.get $7 + i32.const 1 + local.get $7 + i32.const 0 + i32.ne + select + i32.const 1023 + i32.const 52 + i32.add + i32.sub + local.set $7 + block $~lib/util/number/normalizedBoundaries|inlined.0 + local.get $9 + local.set $10 + local.get $7 + local.set $11 + local.get $10 + i64.const 1 + i64.shl + i64.const 1 + i64.add + local.set $12 + local.get $11 + i32.const 1 + i32.sub + local.set $13 + local.get $12 + i64.clz + i32.wrap_i64 + local.set $14 + local.get $12 + local.get $14 + i64.extend_i32_s + i64.shl + local.set $12 + local.get $13 + local.get $14 + i32.sub + local.set $13 + i32.const 1 + local.get $10 + i64.const 4503599627370496 + i64.eq + i32.add + local.set $15 + local.get $12 + global.set $~lib/util/number/_frc_plus + local.get $10 + local.get $15 + i64.extend_i32_s + i64.shl + i64.const 1 + i64.sub + local.get $11 + local.get $15 + i32.sub + local.get $13 + i32.sub + i64.extend_i32_s + i64.shl + global.set $~lib/util/number/_frc_minus + local.get $13 + global.set $~lib/util/number/_exp + end + block $~lib/util/number/getCachedPower|inlined.0 + global.get $~lib/util/number/_exp + local.set $15 + i32.const -61 + local.get $15 + i32.sub + f64.convert_i32_s + f64.const 0.30102999566398114 + f64.mul + f64.const 347 + f64.add + local.set $16 + local.get $16 + i32.trunc_f64_s + local.set $14 + local.get $14 + local.get $14 + f64.convert_i32_s + local.get $16 + f64.ne + i32.add + local.set $14 + local.get $14 + i32.const 3 + i32.shr_s + i32.const 1 + i32.add + local.set $13 + i32.const 348 + local.get $13 + i32.const 3 + i32.shl + i32.sub + global.set $~lib/util/number/_K + i32.const 4896 + local.get $13 + call $~lib/array/Array#__unchecked_get + global.set $~lib/util/number/_frc_pow + i32.const 5120 + local.get $13 + call $~lib/array/Array#__unchecked_get + global.set $~lib/util/number/_exp_pow + end + local.get $9 + i64.clz + i32.wrap_i64 + local.set $13 + local.get $9 + local.get $13 + i64.extend_i32_s + i64.shl + local.set $9 + local.get $7 + local.get $13 + i32.sub + local.set $7 + global.get $~lib/util/number/_frc_pow + local.set $12 + global.get $~lib/util/number/_exp_pow + local.set $14 + block $~lib/util/number/umul64f|inlined.0 (result i64) + local.get $9 + local.set $17 + local.get $12 + local.set $10 + local.get $17 + i64.const 4294967295 + i64.and + local.set $18 + local.get $10 + i64.const 4294967295 + i64.and + local.set $19 + local.get $17 + i64.const 32 + i64.shr_u + local.set $20 + local.get $10 + i64.const 32 + i64.shr_u + local.set $21 + local.get $18 + local.get $19 + i64.mul + local.set $22 + local.get $20 + local.get $19 + i64.mul + local.get $22 + i64.const 32 + i64.shr_u + i64.add + local.set $23 + local.get $18 + local.get $21 + i64.mul + local.get $23 + i64.const 4294967295 + i64.and + i64.add + local.set $24 + local.get $24 + i64.const 2147483647 + i64.add + local.set $24 + local.get $23 + i64.const 32 + i64.shr_u + local.set $23 + local.get $24 + i64.const 32 + i64.shr_u + local.set $24 + local.get $20 + local.get $21 + i64.mul + local.get $23 + i64.add + local.get $24 + i64.add + end + local.set $24 + block $~lib/util/number/umul64e|inlined.0 (result i32) + local.get $7 + local.set $11 + local.get $14 + local.set $15 + local.get $11 + local.get $15 + i32.add + i32.const 64 + i32.add + end + local.set $15 + block $~lib/util/number/umul64f|inlined.1 (result i64) + global.get $~lib/util/number/_frc_plus + local.set $22 + local.get $12 + local.set $23 + local.get $22 + i64.const 4294967295 + i64.and + local.set $21 + local.get $23 + i64.const 4294967295 + i64.and + local.set $20 + local.get $22 + i64.const 32 + i64.shr_u + local.set $19 + local.get $23 + i64.const 32 + i64.shr_u + local.set $18 + local.get $21 + local.get $20 + i64.mul + local.set $10 + local.get $19 + local.get $20 + i64.mul + local.get $10 + i64.const 32 + i64.shr_u + i64.add + local.set $17 + local.get $21 + local.get $18 + i64.mul + local.get $17 + i64.const 4294967295 + i64.and + i64.add + local.set $25 + local.get $25 + i64.const 2147483647 + i64.add + local.set $25 + local.get $17 + i64.const 32 + i64.shr_u + local.set $17 + local.get $25 + i64.const 32 + i64.shr_u + local.set $25 + local.get $19 + local.get $18 + i64.mul + local.get $17 + i64.add + local.get $25 + i64.add + end + i64.const 1 + i64.sub + local.set $25 + block $~lib/util/number/umul64e|inlined.1 (result i32) + global.get $~lib/util/number/_exp + local.set $26 + local.get $14 + local.set $11 + local.get $26 + local.get $11 + i32.add + i32.const 64 + i32.add + end + local.set $11 + block $~lib/util/number/umul64f|inlined.2 (result i64) + global.get $~lib/util/number/_frc_minus + local.set $10 + local.get $12 + local.set $17 + local.get $10 + i64.const 4294967295 + i64.and + local.set $18 + local.get $17 + i64.const 4294967295 + i64.and + local.set $19 + local.get $10 + i64.const 32 + i64.shr_u + local.set $20 + local.get $17 + i64.const 32 + i64.shr_u + local.set $21 + local.get $18 + local.get $19 + i64.mul + local.set $23 + local.get $20 + local.get $19 + i64.mul + local.get $23 + i64.const 32 + i64.shr_u + i64.add + local.set $22 + local.get $18 + local.get $21 + i64.mul + local.get $22 + i64.const 4294967295 + i64.and + i64.add + local.set $27 + local.get $27 + i64.const 2147483647 + i64.add + local.set $27 + local.get $22 + i64.const 32 + i64.shr_u + local.set $22 + local.get $27 + i64.const 32 + i64.shr_u + local.set $27 + local.get $20 + local.get $21 + i64.mul + local.get $22 + i64.add + local.get $27 + i64.add + end + i64.const 1 + i64.add + local.set $27 + local.get $25 + local.get $27 + i64.sub + local.set $22 + local.get $5 + local.get $24 + local.get $15 + local.get $25 + local.get $11 + local.get $22 + local.get $4 + call $~lib/util/number/genDigits + end + local.set $28 local.get $0 - i32.add - local.get $0 - local.get $6 - local.get $5 - local.get $5 - i64.clz - i32.wrap_i64 - local.tee $0 - i64.extend_i32_s - i64.shl - local.tee $5 - i64.const 4294967295 - i64.and - local.tee $9 - i64.mul - local.get $5 - i64.const 32 - i64.shr_u - local.tee $5 local.get $2 - i64.mul - local.get $2 - local.get $9 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.tee $2 - i64.const 4294967295 - i64.and - i64.add - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u - local.get $5 - local.get $6 - i64.mul - local.get $2 - i64.const 32 - i64.shr_u - i64.add - i64.add - global.get $~lib/util/number/_exp_pow - local.tee $3 - local.get $7 - local.get $0 - i32.sub + i32.const 1 + i32.shl i32.add - i32.const -64 - i32.sub - local.get $8 - global.get $~lib/util/number/_exp - local.get $3 - i32.add - i32.const -64 - i32.sub - local.get $4 - local.get $10 - call $~lib/util/number/genDigits - local.get $10 + local.get $28 + local.get $2 i32.sub global.get $~lib/util/number/_K call $~lib/util/number/prettify - local.get $10 + local.set $28 + local.get $28 + local.get $2 i32.add ) - (func $~lib/string/String#substring (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/string/String#substring (; 74 ;) (type $FUNCSIG$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) + (local $8 i32) + (local $9 i32) + (local $10 i32) local.get $0 + i32.const 0 + i32.ne i32.eqz if i32.const 0 - i32.const 264 - i32.const 203 + i32.const 312 + i32.const 196 i32.const 4 call $~lib/builtins/abort unreachable end - i32.const 0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $2 - i32.const 0 - local.get $2 - i32.lt_s - select - local.tee $3 - local.get $1 - i32.const 0 + call $~lib/string/String#get:length + local.set $3 local.get $1 + local.tee $4 i32.const 0 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - local.tee $1 - local.get $2 - local.get $1 - local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - local.tee $2 - local.get $3 + local.set $6 local.get $2 + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - i32.const 1 - i32.shl - local.tee $1 + local.tee $4 local.get $3 - local.get $2 - local.get $3 - local.get $2 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + local.set $7 + local.get $6 + local.tee $4 + local.get $7 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select i32.const 1 i32.shl - local.tee $3 + local.set $8 + local.get $6 + local.tee $4 + local.get $7 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + i32.const 1 + i32.shl + local.set $9 + local.get $9 + local.get $8 i32.sub - local.tee $2 + local.set $3 + local.get $3 i32.eqz if i32.const 120 + call $~lib/rt/purerc/__retain return end - local.get $3 + local.get $8 + i32.eqz if (result i32) - i32.const 0 - else + local.get $9 local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.const 1 i32.shl - local.get $1 i32.eq + else + i32.const 0 end if local.get $0 + call $~lib/rt/purerc/__retain return end - local.get $2 - call $~lib/util/runtime/allocate - local.tee $1 - local.get $0 local.get $3 - i32.add - local.get $2 - call $~lib/memory/memory.copy - local.get $1 i32.const 16 - call $~lib/util/runtime/register - ) - (func $~lib/util/runtime/discard (; 46 ;) (type $FUNCSIG$vi) (param $0 i32) + call $~lib/rt/tlsf/__alloc + local.set $10 + local.get $10 local.get $0 - i32.const 6928 - i32.le_u + local.get $8 + i32.add + local.get $3 + call $~lib/memory/memory.copy + local.get $10 + call $~lib/rt/purerc/__retain + ) + (func $~lib/rt/tlsf/__free (; 75 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz if i32.const 0 i32.const 184 - i32.const 115 - i32.const 4 + i32.const 560 + i32.const 13 call $~lib/builtins/abort unreachable end local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 561 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 i32.const 16 i32.sub - i32.load - i32.const -1520547049 - i32.ne - if - i32.const 0 - i32.const 184 - i32.const 117 - i32.const 4 - call $~lib/builtins/abort - unreachable - end + call $~lib/rt/tlsf/freeBlock ) - (func $~lib/util/number/dtoa (; 47 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/util/number/dtoa (; 76 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) + (local $3 i32) local.get $0 f64.const 0 f64.eq if - i32.const 3840 + i32.const 4064 + call $~lib/rt/purerc/__retain return end local.get $0 - local.get $0 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if - i32.const 3864 + i32.const 4088 + call $~lib/rt/purerc/__retain return end - i32.const 3888 - i32.const 3928 + i32.const 4112 + i32.const 4152 local.get $0 f64.const 0 f64.lt select + call $~lib/rt/purerc/__retain return end - i32.const 56 - call $~lib/util/runtime/allocate - local.tee $2 + i32.const 28 + i32.const 1 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $1 + local.get $1 local.get $0 call $~lib/util/number/dtoa_core - local.set $1 + local.set $2 local.get $2 + i32.const 28 + i32.eq + if + local.get $1 + call $~lib/rt/purerc/__retain + return + end local.get $1 + i32.const 0 + local.get $2 call $~lib/string/String#substring - local.set $1 - local.get $2 - call $~lib/util/runtime/discard + local.set $3 local.get $1 + call $~lib/rt/tlsf/__free + local.get $3 ) - (func $start:std/string (; 48 ;) (type $FUNCSIG$v) + (func $start:std/string (; 77 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i32) + (local $19 i32) + (local $20 i32) + (local $21 i32) + (local $22 i32) + (local $23 i32) + (local $24 i32) + (local $25 i32) + (local $26 i32) + (local $27 i32) + (local $28 i32) + (local $29 i32) + (local $30 i32) + (local $31 i32) + (local $32 i32) + (local $33 i32) + (local $34 i32) + (local $35 i32) + (local $36 i32) + (local $37 i32) + (local $38 i32) + (local $39 i32) + (local $40 i32) + (local $41 i32) + (local $42 i32) + (local $43 i32) + (local $44 i32) + (local $45 i32) + (local $46 i32) + (local $47 i32) + (local $48 i32) + (local $49 i32) + (local $50 i32) + (local $51 i32) + (local $52 i32) + (local $53 i32) + (local $54 i32) + (local $55 i32) + (local $56 i32) + (local $57 i32) + (local $58 i32) + (local $59 i32) + (local $60 i32) + (local $61 i32) + (local $62 i32) + (local $63 i32) + (local $64 i32) + (local $65 i32) + (local $66 i32) + (local $67 i32) + (local $68 i32) + (local $69 i32) + (local $70 i32) + (local $71 i32) + (local $72 i32) + (local $73 i32) + (local $74 i32) + (local $75 i32) + (local $76 i32) + (local $77 i32) + (local $78 i32) + (local $79 i32) + (local $80 i32) + (local $81 i32) + (local $82 i32) + (local $83 i32) + (local $84 i32) + (local $85 i32) + (local $86 i32) + (local $87 i32) + (local $88 i32) + (local $89 i32) + (local $90 i32) + (local $91 i32) + (local $92 i32) + (local $93 i32) + (local $94 i32) + (local $95 i32) + (local $96 i32) + (local $97 i32) + (local $98 i32) + (local $99 i32) + (local $100 i32) + (local $101 i32) + (local $102 i32) + (local $103 i32) + (local $104 i32) + (local $105 i32) + (local $106 i32) + (local $107 i32) + (local $108 i32) + (local $109 i32) + (local $110 i32) + (local $111 i32) + (local $112 i32) + (local $113 i32) + (local $114 i32) + (local $115 i32) + (local $116 i32) + (local $117 i32) + (local $118 i32) + (local $119 i32) + (local $120 i32) + (local $121 i32) + (local $122 i32) + (local $123 i32) + (local $124 i32) + (local $125 i32) + (local $126 i32) + (local $127 i32) + (local $128 i32) global.get $std/string/str i32.const 24 - i32.ne + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 8 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $std/string/str + call $~lib/string/String#get:length + i32.const 16 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 10 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $std/string/str + i32.const 0 + call $~lib/string/String#charCodeAt + i32.const 104 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 11 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 120 + call $~lib/string/String.__not + i32.eqz + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 13 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 136 + call $~lib/string/String.__not + i32.eqz + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 14 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 160 + call $~lib/string/String.__not + i32.eqz + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 15 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $~lib/string/String.fromCharCode + local.tee $0 + i32.const 136 + call $~lib/string/String.__eq + i32.eqz if i32.const 0 i32.const 72 @@ -4316,14 +7321,28 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - i32.const 16 - i32.ne + i32.const 54 + call $~lib/string/String.fromCharCode + local.tee $1 + i32.const 288 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 18 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 65536 + i32.const 54 + i32.add + call $~lib/string/String.fromCharCode + local.tee $2 + i32.const 288 + call $~lib/string/String.__eq + i32.eqz if i32.const 0 i32.const 72 @@ -4332,36 +7351,26 @@ call $~lib/builtins/abort unreachable end - block $__inlined_func$~lib/string/String#charCodeAt (result i32) - i32.const -1 - i32.const 0 - global.get $std/string/str - local.tee $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - i32.ge_u - br_if $__inlined_func$~lib/string/String#charCodeAt - drop - local.get $0 - i32.load16_u - end - i32.const 104 - i32.ne + i32.const 0 + call $~lib/string/String.fromCodePoint + local.tee $3 + i32.const 136 + call $~lib/string/String.__eq + i32.eqz if i32.const 0 i32.const 72 - i32.const 20 + i32.const 21 i32.const 0 call $~lib/builtins/abort unreachable end - i32.const 108 - i32.load - i32.const 1 - i32.shr_u + i32.const 54 + call $~lib/string/String.fromCodePoint + local.tee $4 + i32.const 288 + call $~lib/string/String.__eq + i32.eqz if i32.const 0 i32.const 72 @@ -4370,46 +7379,35 @@ call $~lib/builtins/abort unreachable end - i32.const 124 - i32.load - i32.const 1 - i32.shr_u + i32.const 119558 + call $~lib/string/String.fromCodePoint + local.tee $5 i32.eqz - i32.eqz - i32.const 1 - i32.ne if - i32.const 0 + i32.const 360 i32.const 72 i32.const 23 i32.const 0 call $~lib/builtins/abort unreachable end - i32.const 148 - i32.load - i32.const 1 - i32.shr_u + global.get $std/string/str + i32.const 384 + i32.const 0 + call $~lib/string/String#startsWith i32.eqz - i32.eqz - i32.const 1 - i32.ne if i32.const 0 i32.const 72 - i32.const 24 + i32.const 25 i32.const 0 call $~lib/builtins/abort unreachable end - i32.const 6928 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - i32.const 0 - call $~lib/string/String.fromCharCode - i32.const 136 - call $~lib/string/String.__eq + global.get $std/string/str + i32.const 432 + global.get $~lib/string/String.MAX_LENGTH + call $~lib/string/String#endsWith i32.eqz if i32.const 0 @@ -4419,10 +7417,25 @@ call $~lib/builtins/abort unreachable end - i32.const 54 - call $~lib/string/String.fromCharCode - i32.const 240 - call $~lib/string/String.__eq + block $~lib/string/String#includes|inlined.0 (result i32) + global.get $std/string/str + local.set $8 + i32.const 464 + call $~lib/rt/purerc/__retain + local.set $7 + i32.const 0 + local.set $6 + local.get $7 + call $~lib/rt/purerc/__release + local.get $8 + local.get $7 + local.get $6 + call $~lib/string/String#indexOf + i32.const -1 + i32.ne + end + i32.const 0 + i32.ne i32.eqz if i32.const 0 @@ -4432,22 +7445,28 @@ call $~lib/builtins/abort unreachable end - i32.const 65590 - call $~lib/string/String.fromCharCode - i32.const 240 + global.get $std/string/str + i32.const 0 + i32.const 488 + call $~lib/string/String#padStart + local.tee $6 + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 72 - i32.const 28 + i32.const 29 i32.const 0 call $~lib/builtins/abort unreachable end - i32.const 0 - call $~lib/string/String.fromCodePoint - i32.const 136 + global.get $std/string/str + i32.const 15 + i32.const 488 + call $~lib/string/String#padStart + local.tee $7 + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -4458,9 +7477,12 @@ call $~lib/builtins/abort unreachable end - i32.const 54 - call $~lib/string/String.fromCodePoint - i32.const 240 + i32.const 120 + i32.const 3 + i32.const 488 + call $~lib/string/String#padStart + local.tee $8 + i32.const 512 call $~lib/string/String.__eq i32.eqz if @@ -4471,19 +7493,45 @@ call $~lib/builtins/abort unreachable end - i32.const 119558 - call $~lib/string/String.fromCodePoint + i32.const 120 + i32.const 10 + i32.const 120 + call $~lib/string/String#padStart + local.tee $9 + i32.const 120 + call $~lib/string/String.__eq i32.eqz if - i32.const 312 + i32.const 0 i32.const 72 i32.const 32 i32.const 0 call $~lib/builtins/abort unreachable end - global.get $std/string/str - call $~lib/string/String#startsWith + i32.const 160 + i32.const 100 + i32.const 120 + call $~lib/string/String#padStart + local.tee $10 + i32.const 160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 33 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 536 + i32.const 5 + i32.const 488 + call $~lib/string/String#padStart + local.tee $11 + i32.const 560 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -4493,8 +7541,13 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - call $~lib/string/String#endsWith + i32.const 536 + i32.const 6 + i32.const 592 + call $~lib/string/String#padStart + local.tee $12 + i32.const 616 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -4504,12 +7557,14 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 416 - i32.const 0 - call $~lib/string/String#indexOf - i32.const -1 - i32.eq + i32.const 536 + i32.const 8 + i32.const 592 + call $~lib/string/String#padStart + local.tee $13 + i32.const 648 + call $~lib/string/String.__eq + i32.eqz if i32.const 0 i32.const 72 @@ -4520,8 +7575,9 @@ end global.get $std/string/str i32.const 0 - i32.const 440 - call $~lib/string/String#padStart + i32.const 488 + call $~lib/string/String#padEnd + local.tee $14 global.get $std/string/str call $~lib/string/String.__eq i32.eqz @@ -4535,8 +7591,9 @@ end global.get $std/string/str i32.const 15 - i32.const 440 - call $~lib/string/String#padStart + i32.const 488 + call $~lib/string/String#padEnd + local.tee $15 global.get $std/string/str call $~lib/string/String.__eq i32.eqz @@ -4550,9 +7607,10 @@ end i32.const 120 i32.const 3 - i32.const 440 - call $~lib/string/String#padStart - i32.const 464 + i32.const 488 + call $~lib/string/String#padEnd + local.tee $16 + i32.const 512 call $~lib/string/String.__eq i32.eqz if @@ -4566,7 +7624,8 @@ i32.const 120 i32.const 10 i32.const 120 - call $~lib/string/String#padStart + call $~lib/string/String#padEnd + local.tee $17 i32.const 120 call $~lib/string/String.__eq i32.eqz @@ -4581,7 +7640,8 @@ i32.const 160 i32.const 100 i32.const 120 - call $~lib/string/String#padStart + call $~lib/string/String#padEnd + local.tee $18 i32.const 160 call $~lib/string/String.__eq i32.eqz @@ -4593,11 +7653,12 @@ call $~lib/builtins/abort unreachable end - i32.const 488 + i32.const 536 i32.const 5 - i32.const 440 - call $~lib/string/String#padStart - i32.const 512 + i32.const 488 + call $~lib/string/String#padEnd + local.tee $19 + i32.const 680 call $~lib/string/String.__eq i32.eqz if @@ -4608,11 +7669,12 @@ call $~lib/builtins/abort unreachable end - i32.const 488 + i32.const 536 i32.const 6 - i32.const 544 - call $~lib/string/String#padStart - i32.const 568 + i32.const 536 + call $~lib/string/String#padEnd + local.tee $20 + i32.const 712 call $~lib/string/String.__eq i32.eqz if @@ -4623,11 +7685,12 @@ call $~lib/builtins/abort unreachable end - i32.const 488 + i32.const 536 i32.const 8 - i32.const 544 - call $~lib/string/String#padStart - i32.const 600 + i32.const 536 + call $~lib/string/String#padEnd + local.tee $21 + i32.const 744 call $~lib/string/String.__eq i32.eqz if @@ -4638,12 +7701,12 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str + i32.const 120 + i32.const 120 i32.const 0 - i32.const 440 - call $~lib/string/String#padEnd - global.get $std/string/str - call $~lib/string/String.__eq + call $~lib/string/String#indexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 @@ -4653,12 +7716,12 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 15 - i32.const 440 - call $~lib/string/String#padEnd - global.get $std/string/str - call $~lib/string/String.__eq + i32.const 120 + i32.const 384 + i32.const 0 + call $~lib/string/String#indexOf + i32.const -1 + i32.eq i32.eqz if i32.const 0 @@ -4668,12 +7731,12 @@ call $~lib/builtins/abort unreachable end - i32.const 120 - i32.const 3 - i32.const 440 - call $~lib/string/String#padEnd - i32.const 464 - call $~lib/string/String.__eq + i32.const 160 + i32.const 160 + i32.const 0 + call $~lib/string/String#indexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 @@ -4683,12 +7746,12 @@ call $~lib/builtins/abort unreachable end - i32.const 120 - i32.const 10 - i32.const 120 - call $~lib/string/String#padEnd - i32.const 120 - call $~lib/string/String.__eq + global.get $std/string/str + global.get $std/string/str + i32.const 0 + call $~lib/string/String#indexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 @@ -4698,12 +7761,12 @@ call $~lib/builtins/abort unreachable end - i32.const 160 - i32.const 100 + global.get $std/string/str i32.const 120 - call $~lib/string/String#padEnd - i32.const 160 - call $~lib/string/String.__eq + i32.const 0 + call $~lib/string/String#indexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 @@ -4713,12 +7776,12 @@ call $~lib/builtins/abort unreachable end - i32.const 488 - i32.const 5 - i32.const 440 - call $~lib/string/String#padEnd - i32.const 632 - call $~lib/string/String.__eq + global.get $std/string/str + i32.const 776 + i32.const 0 + call $~lib/string/String#indexOf + i32.const 2 + i32.eq i32.eqz if i32.const 0 @@ -4728,12 +7791,12 @@ call $~lib/builtins/abort unreachable end - i32.const 488 - i32.const 6 - i32.const 488 - call $~lib/string/String#padEnd - i32.const 664 - call $~lib/string/String.__eq + global.get $std/string/str + i32.const 800 + i32.const 0 + call $~lib/string/String#indexOf + i32.const -1 + i32.eq i32.eqz if i32.const 0 @@ -4743,12 +7806,12 @@ call $~lib/builtins/abort unreachable end - i32.const 488 - i32.const 8 - i32.const 488 - call $~lib/string/String#padEnd - i32.const 696 - call $~lib/string/String.__eq + global.get $std/string/str + i32.const 776 + i32.const 2 + call $~lib/string/String#indexOf + i32.const 2 + i32.eq i32.eqz if i32.const 0 @@ -4758,10 +7821,28 @@ call $~lib/builtins/abort unreachable end - i32.const 120 - i32.const 120 - i32.const 0 + global.get $std/string/str + i32.const 776 + i32.const 3 call $~lib/string/String#indexOf + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 55 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $std/string/str + i32.const 824 + i32.const -1 + call $~lib/string/String#indexOf + i32.const 2 + i32.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4771,23 +7852,12 @@ unreachable end i32.const 120 - i32.const 336 + i32.const 120 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf i32.const 0 - call $~lib/string/String#indexOf - i32.const -1 - i32.ne - if - i32.const 0 - i32.const 72 - i32.const 57 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 160 - i32.const 160 - i32.const 0 - call $~lib/string/String#indexOf + i32.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4796,11 +7866,13 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - local.tee $0 - local.get $0 - i32.const 0 - call $~lib/string/String#indexOf + i32.const 120 + i32.const 384 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf + i32.const -1 + i32.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4811,8 +7883,12 @@ end global.get $std/string/str i32.const 120 - i32.const 0 - call $~lib/string/String#indexOf + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf + global.get $std/string/str + call $~lib/string/String#get:length + i32.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4822,11 +7898,12 @@ unreachable end global.get $std/string/str - i32.const 728 - i32.const 0 - call $~lib/string/String#indexOf + i32.const 776 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf i32.const 2 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4836,11 +7913,12 @@ unreachable end global.get $std/string/str - i32.const 752 - i32.const 0 - call $~lib/string/String#indexOf + i32.const 800 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf i32.const -1 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4850,11 +7928,12 @@ unreachable end global.get $std/string/str - i32.const 728 - i32.const 2 - call $~lib/string/String#indexOf - i32.const 2 - i32.ne + i32.const 848 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf + i32.const 15 + i32.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4864,11 +7943,12 @@ unreachable end global.get $std/string/str - i32.const 728 - i32.const 3 - call $~lib/string/String#indexOf - i32.const -1 - i32.ne + i32.const 776 + i32.const 2 + call $~lib/string/String#lastIndexOf + i32.const 2 + i32.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4879,10 +7959,11 @@ end global.get $std/string/str i32.const 776 - i32.const -1 - call $~lib/string/String#indexOf + i32.const 3 + call $~lib/string/String#lastIndexOf i32.const 2 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4891,10 +7972,28 @@ call $~lib/builtins/abort unreachable end - i32.const 120 - i32.const 120 - i32.const 2147483647 + global.get $std/string/str + i32.const 824 + i32.const -1 call $~lib/string/String#lastIndexOf + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 66 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $std/string/str + i32.const 872 + i32.const 0 + call $~lib/string/String#lastIndexOf + i32.const -1 + i32.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4903,12 +8002,13 @@ call $~lib/builtins/abort unreachable end - i32.const 120 - i32.const 336 - i32.const 2147483647 + global.get $std/string/str + i32.const 384 + i32.const 0 call $~lib/string/String#lastIndexOf - i32.const -1 - i32.ne + i32.const 0 + i32.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4917,31 +8017,12 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 120 - i32.const 2147483647 - call $~lib/string/String#lastIndexOf - global.get $std/string/str - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - i32.ne - if - i32.const 0 - i32.const 72 - i32.const 69 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/str - i32.const 728 - i32.const 2147483647 - call $~lib/string/String#lastIndexOf - i32.const 2 - i32.ne + i32.const 896 + i32.const 0 + call $~lib/string/parseInt + f64.const 0 + f64.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4950,12 +8031,12 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 752 - i32.const 2147483647 - call $~lib/string/String#lastIndexOf - i32.const -1 - i32.ne + i32.const 920 + i32.const 0 + call $~lib/string/parseInt + f64.const 1 + f64.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4964,12 +8045,12 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 800 - i32.const 2147483647 - call $~lib/string/String#lastIndexOf - i32.const 15 - i32.ne + i32.const 944 + i32.const 0 + call $~lib/string/parseInt + f64.const 5 + f64.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4978,12 +8059,12 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 728 - i32.const 2 - call $~lib/string/String#lastIndexOf - i32.const 2 - i32.ne + i32.const 976 + i32.const 0 + call $~lib/string/parseInt + f64.const 455 + f64.eq + i32.eqz if i32.const 0 i32.const 72 @@ -4992,12 +8073,12 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 728 - i32.const 3 - call $~lib/string/String#lastIndexOf - i32.const 2 - i32.ne + i32.const 1008 + i32.const 0 + call $~lib/string/parseInt + f64.const 3855 + f64.eq + i32.eqz if i32.const 0 i32.const 72 @@ -5006,12 +8087,12 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 776 - i32.const -1 - call $~lib/string/String#lastIndexOf - i32.const -1 - i32.ne + i32.const 1040 + i32.const 0 + call $~lib/string/parseInt + f64.const 3855 + f64.eq + i32.eqz if i32.const 0 i32.const 72 @@ -5020,12 +8101,12 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 824 + i32.const 1072 i32.const 0 - call $~lib/string/String#lastIndexOf - i32.const -1 - i32.ne + call $~lib/string/parseInt + f64.const 11 + f64.eq + i32.eqz if i32.const 0 i32.const 72 @@ -5034,10 +8115,12 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 336 + i32.const 1096 i32.const 0 - call $~lib/string/String#lastIndexOf + call $~lib/string/parseInt + f64.const 1 + f64.eq + i32.eqz if i32.const 0 i32.const 72 @@ -5046,10 +8129,63 @@ call $~lib/builtins/abort unreachable end - i32.const 848 - call $~lib/util/string/parse + i32.const 896 + call $~lib/string/parseFloat f64.const 0 - f64.ne + f64.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 79 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 920 + call $~lib/string/parseFloat + f64.const 1 + f64.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 80 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1120 + call $~lib/string/parseFloat + f64.const 0.1 + f64.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 81 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1144 + call $~lib/string/parseFloat + f64.const 0.25 + f64.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 82 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1168 + call $~lib/string/parseFloat + f64.const 0.1 + f64.eq + i32.eqz if i32.const 0 i32.const 72 @@ -5058,82 +8194,46 @@ call $~lib/builtins/abort unreachable end - i32.const 872 - call $~lib/util/string/parse - f64.const 1 - f64.ne - if - i32.const 0 - i32.const 72 - i32.const 84 - i32.const 0 - call $~lib/builtins/abort - unreachable + block + i32.const 160 + i32.const 1200 + call $~lib/string/String.__concat + local.tee $22 + call $~lib/rt/purerc/__retain + local.set $23 + local.get $23 + i32.const 1224 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 87 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $23 + i32.const 160 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 88 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $22 + call $~lib/rt/purerc/__release + local.get $23 + call $~lib/rt/purerc/__release end - i32.const 896 - call $~lib/util/string/parse - f64.const 5 - f64.ne - if - i32.const 0 - i32.const 72 - i32.const 85 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 928 - call $~lib/util/string/parse - f64.const 455 - f64.ne - if - i32.const 0 - i32.const 72 - i32.const 86 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 960 - call $~lib/util/string/parse - f64.const 3855 - f64.ne - if - i32.const 0 - i32.const 72 - i32.const 87 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 992 - call $~lib/util/string/parse - f64.const 3855 - f64.ne - if - i32.const 0 - i32.const 72 - i32.const 88 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1024 - call $~lib/util/string/parse - f64.const 11 - f64.ne - if - i32.const 0 - i32.const 72 - i32.const 89 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1048 - call $~lib/util/string/parse - f64.const 1 - f64.ne + i32.const 120 + i32.const 120 + call $~lib/string/String.__eq + i32.eqz if i32.const 0 i32.const 72 @@ -5142,10 +8242,22 @@ call $~lib/builtins/abort unreachable end - i32.const 848 - call $~lib/string/parseFloat - f64.const 0 - f64.ne + i32.const 120 + global.get $std/string/nullStr + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 91 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $std/string/nullStr + i32.const 120 + call $~lib/string/String.__ne + i32.eqz if i32.const 0 i32.const 72 @@ -5154,10 +8266,10 @@ call $~lib/builtins/abort unreachable end - i32.const 872 - call $~lib/string/parseFloat - f64.const 1 - f64.ne + i32.const 160 + i32.const 1200 + call $~lib/string/String.__ne + i32.eqz if i32.const 0 i32.const 72 @@ -5166,10 +8278,10 @@ call $~lib/builtins/abort unreachable end - i32.const 1072 - call $~lib/string/parseFloat - f64.const 0.1 - f64.ne + i32.const 160 + i32.const 160 + call $~lib/string/String.__eq + i32.eqz if i32.const 0 i32.const 72 @@ -5178,142 +8290,6 @@ call $~lib/builtins/abort unreachable end - i32.const 1096 - call $~lib/string/parseFloat - f64.const 0.25 - f64.ne - if - i32.const 0 - i32.const 72 - i32.const 95 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1120 - call $~lib/string/parseFloat - f64.const 0.1 - f64.ne - if - i32.const 0 - i32.const 72 - i32.const 96 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 160 - i32.const 1152 - call $~lib/string/String.__concat - global.set $std/string/c - global.get $std/string/c - i32.const 1176 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 99 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/c - i32.const 160 - call $~lib/string/String.__ne - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 100 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - i32.const 120 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 101 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - global.get $std/string/nullStr - call $~lib/string/String.__ne - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 102 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/nullStr - i32.const 120 - call $~lib/string/String.__ne - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 103 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 160 - i32.const 1152 - call $~lib/string/String.__ne - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 104 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 160 - i32.const 160 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 105 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1200 - i32.const 1224 - call $~lib/string/String.__ne - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 106 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1200 - i32.const 1200 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 107 - i32.const 0 - call $~lib/builtins/abort - unreachable - end i32.const 1248 i32.const 1272 call $~lib/string/String.__ne @@ -5321,15 +8297,149 @@ if i32.const 0 i32.const 72 - i32.const 108 + i32.const 95 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1248 + i32.const 1248 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 96 i32.const 0 call $~lib/builtins/abort unreachable end i32.const 1296 - i32.const 1328 + i32.const 1320 call $~lib/string/String.__ne i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 97 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1344 + i32.const 1376 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 98 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1408 + i32.const 1408 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 99 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1408 + i32.const 1440 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 100 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1472 + i32.const 1512 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 101 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1200 + i32.const 160 + call $~lib/string/String.__gt + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 103 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1552 + i32.const 160 + call $~lib/string/String.__gt + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 104 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1552 + i32.const 1576 + call $~lib/string/String.__gte + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 105 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1552 + i32.const 1224 + call $~lib/string/String.__gt + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 106 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1552 + i32.const 1224 + call $~lib/string/String.__lt + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 107 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1200 + global.get $std/string/nullStr + call $~lib/string/String.__lt + i32.eqz + i32.eqz if i32.const 0 i32.const 72 @@ -5338,9 +8448,10 @@ call $~lib/builtins/abort unreachable end - i32.const 1360 - i32.const 1360 - call $~lib/string/String.__eq + global.get $std/string/nullStr + i32.const 1200 + call $~lib/string/String.__lt + i32.eqz i32.eqz if i32.const 0 @@ -5350,21 +8461,9 @@ call $~lib/builtins/abort unreachable end - i32.const 1360 - i32.const 1392 - call $~lib/string/String.__ne - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 111 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1424 - i32.const 1464 - call $~lib/string/String.__ne + i32.const 536 + i32.const 120 + call $~lib/string/String.__gt i32.eqz if i32.const 0 @@ -5374,9 +8473,21 @@ call $~lib/builtins/abort unreachable end - i32.const 1152 - i32.const 160 - call $~lib/string/String.__gt + i32.const 120 + i32.const 536 + call $~lib/string/String.__lt + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 113 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 536 + i32.const 120 + call $~lib/string/String.__gte i32.eqz if i32.const 0 @@ -5386,9 +8497,9 @@ call $~lib/builtins/abort unreachable end - i32.const 1504 - i32.const 160 - call $~lib/string/String.__gt + i32.const 120 + i32.const 536 + call $~lib/string/String.__lte i32.eqz if i32.const 0 @@ -5398,9 +8509,10 @@ call $~lib/builtins/abort unreachable end - i32.const 1504 - i32.const 1528 - call $~lib/string/String.__gte + i32.const 536 + i32.const 120 + call $~lib/string/String.__lt + i32.eqz i32.eqz if i32.const 0 @@ -5410,10 +8522,11 @@ call $~lib/builtins/abort unreachable end - i32.const 1504 - i32.const 1176 + i32.const 120 + i32.const 536 call $~lib/string/String.__gt i32.eqz + i32.eqz if i32.const 0 i32.const 72 @@ -5422,9 +8535,11 @@ call $~lib/builtins/abort unreachable end - i32.const 1504 - i32.const 1176 + i32.const 120 + i32.const 120 call $~lib/string/String.__lt + i32.eqz + i32.eqz if i32.const 0 i32.const 72 @@ -5433,9 +8548,23 @@ call $~lib/builtins/abort unreachable end - i32.const 1152 - global.get $std/string/nullStr - call $~lib/string/String.__lt + i32.const 120 + i32.const 120 + call $~lib/string/String.__gt + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 119 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 120 + i32.const 120 + call $~lib/string/String.__gte + i32.eqz if i32.const 0 i32.const 72 @@ -5444,9 +8573,10 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/nullStr - i32.const 1152 - call $~lib/string/String.__lt + i32.const 120 + i32.const 120 + call $~lib/string/String.__lte + i32.eqz if i32.const 0 i32.const 72 @@ -5455,78 +8585,48 @@ call $~lib/builtins/abort unreachable end - i32.const 488 - i32.const 120 - call $~lib/string/String.__gt + block + i32.const 65377 + call $~lib/string/String.fromCodePoint + local.set $23 + i32.const 55296 + call $~lib/string/String.fromCodePoint + local.tee $22 + i32.const 56322 + call $~lib/string/String.fromCodePoint + local.tee $24 + call $~lib/string/String.__concat + local.tee $25 + call $~lib/rt/purerc/__retain + local.set $26 + local.get $23 + local.get $26 + call $~lib/string/String.__gt + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 126 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $23 + call $~lib/rt/purerc/__release + local.get $22 + call $~lib/rt/purerc/__release + local.get $24 + call $~lib/rt/purerc/__release + local.get $25 + call $~lib/rt/purerc/__release + local.get $26 + call $~lib/rt/purerc/__release + end + i32.const 592 + call $~lib/string/String#get:length + i32.const 3 + i32.eq i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 123 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - i32.const 488 - call $~lib/string/String.__lt - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 124 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 488 - i32.const 120 - call $~lib/string/String.__gte - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 125 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 488 - call $~lib/string/String.__lte - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 126 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 488 - i32.const 120 - call $~lib/string/String.__lt - if - i32.const 0 - i32.const 72 - i32.const 127 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - i32.const 488 - call $~lib/string/String.__gt - if - i32.const 0 - i32.const 72 - i32.const 128 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - i32.const 120 - call $~lib/string/String.__lt if i32.const 0 i32.const 72 @@ -5536,19 +8636,11 @@ unreachable end i32.const 120 + i32.const 100 + call $~lib/string/String#repeat + local.tee $26 i32.const 120 - call $~lib/string/String.__gt - if - i32.const 0 - i32.const 72 - i32.const 130 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - i32.const 120 - call $~lib/string/String.__gte + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -5558,8 +8650,12 @@ call $~lib/builtins/abort unreachable end + i32.const 160 + i32.const 0 + call $~lib/string/String#repeat + local.tee $25 i32.const 120 - call $~lib/string/String.__lte + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -5569,18 +8665,57 @@ call $~lib/builtins/abort unreachable end - i32.const 65377 - call $~lib/string/String.fromCodePoint - global.set $std/string/a - i32.const 55296 - call $~lib/string/String.fromCodePoint - i32.const 56322 - call $~lib/string/String.fromCodePoint - call $~lib/string/String.__concat - global.set $std/string/b - global.get $std/string/a - global.get $std/string/b - call $~lib/string/String.__gt + i32.const 160 + i32.const 1 + call $~lib/string/String#repeat + local.tee $24 + i32.const 160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 133 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 160 + i32.const 2 + call $~lib/string/String#repeat + local.tee $22 + i32.const 1576 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 134 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 160 + i32.const 3 + call $~lib/string/String#repeat + local.tee $23 + i32.const 1648 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 135 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1224 + i32.const 4 + call $~lib/string/String#repeat + local.tee $27 + i32.const 1672 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -5590,12 +8725,28 @@ call $~lib/builtins/abort unreachable end - i32.const 532 - i32.load - i32.const 1 - i32.shr_u - i32.const 3 - i32.ne + i32.const 160 + i32.const 5 + call $~lib/string/String#repeat + local.tee $28 + i32.const 1704 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 137 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 160 + i32.const 6 + call $~lib/string/String#repeat + local.tee $29 + i32.const 1736 + call $~lib/string/String.__eq + i32.eqz if i32.const 0 i32.const 72 @@ -5604,52 +8755,31 @@ call $~lib/builtins/abort unreachable end - i32.const 120 - i32.const 100 + i32.const 160 + i32.const 7 call $~lib/string/String#repeat - i32.const 120 + local.tee $30 + i32.const 1768 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 72 - i32.const 140 + i32.const 139 i32.const 0 call $~lib/builtins/abort unreachable end - i32.const 160 + i32.const 1800 + global.get $std/string/str + call $~lib/rt/purerc/__retainRelease + global.set $std/string/str + global.get $std/string/str i32.const 0 - call $~lib/string/String#repeat - i32.const 120 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 141 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 160 - i32.const 1 - call $~lib/string/String#repeat - i32.const 160 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 142 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 160 - i32.const 2 - call $~lib/string/String#repeat - i32.const 1528 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#slice + local.tee $31 + i32.const 1800 call $~lib/string/String.__eq i32.eqz if @@ -5660,10 +8790,12 @@ call $~lib/builtins/abort unreachable end - i32.const 160 - i32.const 3 - call $~lib/string/String#repeat - i32.const 1552 + global.get $std/string/str + i32.const -1 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#slice + local.tee $32 + i32.const 1848 call $~lib/string/String.__eq i32.eqz if @@ -5674,10 +8806,12 @@ call $~lib/builtins/abort unreachable end - i32.const 1176 - i32.const 4 - call $~lib/string/String#repeat - i32.const 1576 + global.get $std/string/str + i32.const -5 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#slice + local.tee $33 + i32.const 1872 call $~lib/string/String.__eq i32.eqz if @@ -5688,10 +8822,12 @@ call $~lib/builtins/abort unreachable end - i32.const 160 - i32.const 5 - call $~lib/string/String#repeat - i32.const 1608 + global.get $std/string/str + i32.const 2 + i32.const 7 + call $~lib/string/String#slice + local.tee $34 + i32.const 1904 call $~lib/string/String.__eq i32.eqz if @@ -5702,10 +8838,12 @@ call $~lib/builtins/abort unreachable end - i32.const 160 - i32.const 6 - call $~lib/string/String#repeat - i32.const 1640 + global.get $std/string/str + i32.const -11 + i32.const -6 + call $~lib/string/String#slice + local.tee $35 + i32.const 1936 call $~lib/string/String.__eq i32.eqz if @@ -5716,10 +8854,12 @@ call $~lib/builtins/abort unreachable end - i32.const 160 - i32.const 7 - call $~lib/string/String#repeat - i32.const 1672 + global.get $std/string/str + i32.const 4 + i32.const 3 + call $~lib/string/String#slice + local.tee $36 + i32.const 120 call $~lib/string/String.__eq i32.eqz if @@ -5730,611 +8870,239 @@ call $~lib/builtins/abort unreachable end - i32.const 1704 - global.set $std/string/str - global.get $std/string/str - i32.const 0 - i32.const 2147483647 - call $~lib/string/String#slice - i32.const 1704 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 152 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/str - i32.const -1 - i32.const 2147483647 - call $~lib/string/String#slice - i32.const 1752 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 153 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/str - i32.const -5 - i32.const 2147483647 - call $~lib/string/String#slice - i32.const 1776 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 154 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/str - i32.const 2 - i32.const 7 - call $~lib/string/String#slice - i32.const 1808 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 155 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/str - i32.const -11 - i32.const -6 - call $~lib/string/String#slice - i32.const 1840 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 156 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/str - i32.const 4 - i32.const 3 - call $~lib/string/String#slice - i32.const 120 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 157 - i32.const 0 - call $~lib/builtins/abort - unreachable - end global.get $std/string/str i32.const 0 i32.const -1 call $~lib/string/String#slice - i32.const 1872 + local.tee $37 + i32.const 1968 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 72 - i32.const 158 + i32.const 149 i32.const 0 call $~lib/builtins/abort unreachable end - i32.const 120 + block + i32.const 0 + local.set $38 + block (result i32) + local.get $38 + call $~lib/rt/purerc/__release + i32.const 120 + i32.const 0 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 1 + i32.eq + if (result i32) + local.get $38 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 120 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + else + i32.const 0 + end + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 155 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $38 + call $~lib/rt/purerc/__release + i32.const 120 + i32.const 120 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 157 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $38 + call $~lib/rt/purerc/__release + i32.const 120 + i32.const 776 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 1 + i32.eq + if (result i32) + local.get $38 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 120 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + else + i32.const 0 + end + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 159 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $38 + call $~lib/rt/purerc/__release + i32.const 2344 + i32.const 2376 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 1 + i32.eq + if (result i32) + local.get $38 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 2344 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + else + i32.const 0 + end + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 161 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $38 + call $~lib/rt/purerc/__release + i32.const 2344 + i32.const 776 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 3 + i32.eq + if (result i32) + local.get $38 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 160 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + else + i32.const 0 + end + i32.const 0 + i32.ne + if (result i32) + local.get $38 + i32.const 1 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 1200 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + else + i32.const 0 + end + i32.const 0 + i32.ne + if (result i32) + local.get $38 + i32.const 2 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 2400 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + else + i32.const 0 + end + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 163 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $38 + call $~lib/rt/purerc/__release + end i32.const 0 - i32.const 2147483647 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 1 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 120 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 163 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - i32.const 120 - i32.const 2147483647 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - if - i32.const 0 - i32.const 72 - i32.const 165 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - i32.const 728 - i32.const 2147483647 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 1 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 120 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 167 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1968 - i32.const 2000 - i32.const 2147483647 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 1 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1968 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 169 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1968 - i32.const 728 - i32.const 2147483647 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 3 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 171 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 2048 - i32.const 2080 - i32.const 2147483647 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 3 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 173 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 2104 - i32.const 728 - i32.const 2147483647 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 4 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 120 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 3 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 175 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 2136 - i32.const 728 - i32.const 2147483647 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 4 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 120 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 3 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 177 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 2168 - i32.const 728 - i32.const 2147483647 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 4 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 3 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 120 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 179 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 488 - i32.const 120 - i32.const 2147483647 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 3 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 181 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 488 - i32.const 120 - i32.const 0 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - if - i32.const 0 - i32.const 72 - i32.const 183 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 488 - i32.const 120 - i32.const 1 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 1 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 185 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1968 - i32.const 728 - i32.const 1 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 1 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 187 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 488 - i32.const 120 - i32.const 4 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 3 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else - i32.const 0 - end + call $~lib/util/number/itoa32 + local.tee $38 + i32.const 896 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -6344,42 +9112,25 @@ call $~lib/builtins/abort unreachable end - i32.const 488 - i32.const 120 - i32.const -1 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 3 - i32.eq - if (result i32) - global.get $std/string/sa + i32.const 1 + call $~lib/util/number/itoa32 + local.tee $39 + i32.const 920 + call $~lib/string/String.__eq + i32.eqz + if i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else + i32.const 72 + i32.const 190 i32.const 0 + call $~lib/builtins/abort + unreachable end + i32.const 8 + call $~lib/util/number/itoa32 + local.tee $40 + i32.const 2872 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -6389,42 +9140,25 @@ call $~lib/builtins/abort unreachable end - i32.const 1968 - i32.const 728 - i32.const -1 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=12 - i32.const 3 - i32.eq - if (result i32) - global.get $std/string/sa + i32.const 123 + call $~lib/util/number/itoa32 + local.tee $41 + i32.const 592 + call $~lib/string/String.__eq + i32.eqz + if i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else + i32.const 72 + i32.const 192 i32.const 0 + call $~lib/builtins/abort + unreachable end + i32.const -1000 + call $~lib/util/number/itoa32 + local.tee $42 + i32.const 2896 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -6434,9 +9168,24 @@ call $~lib/builtins/abort unreachable end - i32.const 0 + i32.const 1234 call $~lib/util/number/itoa32 - i32.const 848 + local.tee $43 + i32.const 2928 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 194 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 12345 + call $~lib/util/number/itoa32 + local.tee $44 + i32.const 2952 call $~lib/string/String.__eq i32.eqz if @@ -6447,9 +9196,10 @@ call $~lib/builtins/abort unreachable end - i32.const 1 + i32.const 123456 call $~lib/util/number/itoa32 - i32.const 872 + local.tee $45 + i32.const 2984 call $~lib/string/String.__eq i32.eqz if @@ -6460,9 +9210,10 @@ call $~lib/builtins/abort unreachable end - i32.const 8 + i32.const 1111111 call $~lib/util/number/itoa32 - i32.const 2648 + local.tee $46 + i32.const 3016 call $~lib/string/String.__eq i32.eqz if @@ -6473,9 +9224,10 @@ call $~lib/builtins/abort unreachable end - i32.const 123 + i32.const 1234567 call $~lib/util/number/itoa32 - i32.const 544 + local.tee $47 + i32.const 3048 call $~lib/string/String.__eq i32.eqz if @@ -6486,9 +9238,10 @@ call $~lib/builtins/abort unreachable end - i32.const -1000 + i32.const 2147483646 call $~lib/util/number/itoa32 - i32.const 2672 + local.tee $48 + i32.const 3080 call $~lib/string/String.__eq i32.eqz if @@ -6499,9 +9252,10 @@ call $~lib/builtins/abort unreachable end - i32.const 1234 + i32.const 2147483647 call $~lib/util/number/itoa32 - i32.const 2704 + local.tee $49 + i32.const 3120 call $~lib/string/String.__eq i32.eqz if @@ -6512,9 +9266,10 @@ call $~lib/builtins/abort unreachable end - i32.const 12345 + i32.const -2147483648 call $~lib/util/number/itoa32 - i32.const 2728 + local.tee $50 + i32.const 3160 call $~lib/string/String.__eq i32.eqz if @@ -6525,9 +9280,10 @@ call $~lib/builtins/abort unreachable end - i32.const 123456 + i32.const -1 call $~lib/util/number/itoa32 - i32.const 2760 + local.tee $51 + i32.const 3200 call $~lib/string/String.__eq i32.eqz if @@ -6538,22 +9294,10 @@ call $~lib/builtins/abort unreachable end - i32.const 1111111 - call $~lib/util/number/itoa32 - i32.const 2792 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 203 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1234567 - call $~lib/util/number/itoa32 - i32.const 2824 + i32.const 0 + call $~lib/util/number/utoa32 + local.tee $52 + i32.const 896 call $~lib/string/String.__eq i32.eqz if @@ -6564,9 +9308,10 @@ call $~lib/builtins/abort unreachable end - i32.const 2147483646 - call $~lib/util/number/itoa32 - i32.const 2856 + i32.const 1000 + call $~lib/util/number/utoa32 + local.tee $53 + i32.const 3224 call $~lib/string/String.__eq i32.eqz if @@ -6578,8 +9323,9 @@ unreachable end i32.const 2147483647 - call $~lib/util/number/itoa32 - i32.const 2896 + call $~lib/util/number/utoa32 + local.tee $54 + i32.const 3120 call $~lib/string/String.__eq i32.eqz if @@ -6591,8 +9337,9 @@ unreachable end i32.const -2147483648 - call $~lib/util/number/itoa32 - i32.const 2936 + call $~lib/util/number/utoa32 + local.tee $55 + i32.const 3248 call $~lib/string/String.__eq i32.eqz if @@ -6603,9 +9350,10 @@ call $~lib/builtins/abort unreachable end - i32.const -1 - call $~lib/util/number/itoa32 - i32.const 2976 + global.get $~lib/builtins/u32.MAX_VALUE + call $~lib/util/number/utoa32 + local.tee $56 + i32.const 3288 call $~lib/string/String.__eq i32.eqz if @@ -6616,9 +9364,10 @@ call $~lib/builtins/abort unreachable end - i32.const 0 - call $~lib/util/number/utoa32 - i32.const 848 + i64.const 0 + call $~lib/util/number/utoa64 + local.tee $57 + i32.const 896 call $~lib/string/String.__eq i32.eqz if @@ -6629,9 +9378,10 @@ call $~lib/builtins/abort unreachable end - i32.const 1000 - call $~lib/util/number/utoa32 - i32.const 3000 + i64.const 1234 + call $~lib/util/number/utoa64 + local.tee $58 + i32.const 2928 call $~lib/string/String.__eq i32.eqz if @@ -6642,9 +9392,10 @@ call $~lib/builtins/abort unreachable end - i32.const 2147483647 - call $~lib/util/number/utoa32 - i32.const 2896 + i64.const 99999999 + call $~lib/util/number/utoa64 + local.tee $59 + i32.const 3328 call $~lib/string/String.__eq i32.eqz if @@ -6655,9 +9406,10 @@ call $~lib/builtins/abort unreachable end - i32.const -2147483648 - call $~lib/util/number/utoa32 - i32.const 3024 + i64.const 100000000 + call $~lib/util/number/utoa64 + local.tee $60 + i32.const 3360 call $~lib/string/String.__eq i32.eqz if @@ -6668,9 +9420,10 @@ call $~lib/builtins/abort unreachable end - i32.const -1 - call $~lib/util/number/utoa32 - i32.const 3064 + i64.const 4294967295 + call $~lib/util/number/utoa64 + local.tee $61 + i32.const 3288 call $~lib/string/String.__eq i32.eqz if @@ -6681,9 +9434,24 @@ call $~lib/builtins/abort unreachable end - i64.const 0 + i64.const 68719476735 call $~lib/util/number/utoa64 - i32.const 848 + local.tee $62 + i32.const 3400 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 215 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i64.const 868719476735 + call $~lib/util/number/utoa64 + local.tee $63 + i32.const 3440 call $~lib/string/String.__eq i32.eqz if @@ -6694,9 +9462,10 @@ call $~lib/builtins/abort unreachable end - i64.const 1234 + i64.const 999868719476735 call $~lib/util/number/utoa64 - i32.const 2704 + local.tee $64 + i32.const 3480 call $~lib/string/String.__eq i32.eqz if @@ -6707,9 +9476,10 @@ call $~lib/builtins/abort unreachable end - i64.const 99999999 + i64.const 9999868719476735 call $~lib/util/number/utoa64 - i32.const 3104 + local.tee $65 + i32.const 3528 call $~lib/string/String.__eq i32.eqz if @@ -6720,9 +9490,10 @@ call $~lib/builtins/abort unreachable end - i64.const 100000000 + i64.const 19999868719476735 call $~lib/util/number/utoa64 - i32.const 3136 + local.tee $66 + i32.const 3576 call $~lib/string/String.__eq i32.eqz if @@ -6733,9 +9504,10 @@ call $~lib/builtins/abort unreachable end - i64.const 4294967295 + global.get $~lib/builtins/u64.MAX_VALUE call $~lib/util/number/utoa64 - i32.const 3064 + local.tee $67 + i32.const 3632 call $~lib/string/String.__eq i32.eqz if @@ -6746,22 +9518,10 @@ call $~lib/builtins/abort unreachable end - i64.const 68719476735 - call $~lib/util/number/utoa64 - i32.const 3176 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 221 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i64.const 868719476735 - call $~lib/util/number/utoa64 - i32.const 3216 + i64.const 0 + call $~lib/util/number/itoa64 + local.tee $68 + i32.const 896 call $~lib/string/String.__eq i32.eqz if @@ -6772,9 +9532,10 @@ call $~lib/builtins/abort unreachable end - i64.const 999868719476735 - call $~lib/util/number/utoa64 - i32.const 3256 + i64.const -1234 + call $~lib/util/number/itoa64 + local.tee $69 + i32.const 3688 call $~lib/string/String.__eq i32.eqz if @@ -6785,9 +9546,10 @@ call $~lib/builtins/abort unreachable end - i64.const 9999868719476735 - call $~lib/util/number/utoa64 - i32.const 3304 + i64.const 4294967295 + call $~lib/util/number/itoa64 + local.tee $70 + i32.const 3288 call $~lib/string/String.__eq i32.eqz if @@ -6798,9 +9560,10 @@ call $~lib/builtins/abort unreachable end - i64.const 19999868719476735 - call $~lib/util/number/utoa64 - i32.const 3352 + i64.const -4294967295 + call $~lib/util/number/itoa64 + local.tee $71 + i32.const 3720 call $~lib/string/String.__eq i32.eqz if @@ -6811,9 +9574,10 @@ call $~lib/builtins/abort unreachable end - i64.const -1 - call $~lib/util/number/utoa64 - i32.const 3408 + i64.const 68719476735 + call $~lib/util/number/itoa64 + local.tee $72 + i32.const 3400 call $~lib/string/String.__eq i32.eqz if @@ -6824,9 +9588,24 @@ call $~lib/builtins/abort unreachable end - i64.const 0 + i64.const -68719476735 call $~lib/util/number/itoa64 - i32.const 848 + local.tee $73 + i32.const 3760 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 227 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i64.const -868719476735 + call $~lib/util/number/itoa64 + local.tee $74 + i32.const 3800 call $~lib/string/String.__eq i32.eqz if @@ -6837,9 +9616,10 @@ call $~lib/builtins/abort unreachable end - i64.const -1234 + i64.const -999868719476735 call $~lib/util/number/itoa64 - i32.const 3464 + local.tee $75 + i32.const 3848 call $~lib/string/String.__eq i32.eqz if @@ -6850,9 +9630,10 @@ call $~lib/builtins/abort unreachable end - i64.const 4294967295 + i64.const -19999868719476735 call $~lib/util/number/itoa64 - i32.const 3064 + local.tee $76 + i32.const 3896 call $~lib/string/String.__eq i32.eqz if @@ -6863,9 +9644,10 @@ call $~lib/builtins/abort unreachable end - i64.const -4294967295 + global.get $~lib/builtins/i64.MAX_VALUE call $~lib/util/number/itoa64 - i32.const 3496 + local.tee $77 + i32.const 3952 call $~lib/string/String.__eq i32.eqz if @@ -6876,9 +9658,10 @@ call $~lib/builtins/abort unreachable end - i64.const 68719476735 + global.get $~lib/builtins/i64.MIN_VALUE call $~lib/util/number/itoa64 - i32.const 3176 + local.tee $78 + i32.const 4008 call $~lib/string/String.__eq i32.eqz if @@ -6889,35 +9672,10 @@ call $~lib/builtins/abort unreachable end - i64.const -68719476735 - call $~lib/util/number/itoa64 - i32.const 3536 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 233 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i64.const -868719476735 - call $~lib/util/number/itoa64 - i32.const 3576 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 234 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i64.const -999868719476735 - call $~lib/util/number/itoa64 - i32.const 3624 + f64.const 0 + call $~lib/util/number/dtoa + local.tee $79 + i32.const 4064 call $~lib/string/String.__eq i32.eqz if @@ -6928,9 +9686,10 @@ call $~lib/builtins/abort unreachable end - i64.const -19999868719476735 - call $~lib/util/number/itoa64 - i32.const 3672 + f64.const -0 + call $~lib/util/number/dtoa + local.tee $80 + i32.const 4064 call $~lib/string/String.__eq i32.eqz if @@ -6941,9 +9700,10 @@ call $~lib/builtins/abort unreachable end - i64.const 9223372036854775807 - call $~lib/util/number/itoa64 - i32.const 3728 + f64.const nan:0x8000000000000 + call $~lib/util/number/dtoa + local.tee $81 + i32.const 4088 call $~lib/string/String.__eq i32.eqz if @@ -6954,9 +9714,10 @@ call $~lib/builtins/abort unreachable end - i64.const -9223372036854775808 - call $~lib/util/number/itoa64 - i32.const 3784 + f64.const inf + call $~lib/util/number/dtoa + local.tee $82 + i32.const 4152 call $~lib/string/String.__eq i32.eqz if @@ -6967,9 +9728,40 @@ call $~lib/builtins/abort unreachable end - f64.const 0 + f64.const inf + f64.neg call $~lib/util/number/dtoa - i32.const 3840 + local.tee $83 + i32.const 4112 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 239 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/builtins/f64.EPSILON + call $~lib/util/number/dtoa + local.tee $84 + i32.const 5240 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 240 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/builtins/f64.EPSILON + f64.neg + call $~lib/util/number/dtoa + local.tee $85 + i32.const 5304 call $~lib/string/String.__eq i32.eqz if @@ -6980,9 +9772,10 @@ call $~lib/builtins/abort unreachable end - f64.const -0 + global.get $~lib/builtins/f64.MAX_VALUE call $~lib/util/number/dtoa - i32.const 3840 + local.tee $86 + i32.const 5368 call $~lib/string/String.__eq i32.eqz if @@ -6993,9 +9786,11 @@ call $~lib/builtins/abort unreachable end - f64.const nan:0x8000000000000 + global.get $~lib/builtins/f64.MAX_VALUE + f64.neg call $~lib/util/number/dtoa - i32.const 3864 + local.tee $87 + i32.const 5432 call $~lib/string/String.__eq i32.eqz if @@ -7006,9 +9801,10 @@ call $~lib/builtins/abort unreachable end - f64.const inf + f64.const 4185580496821356722454785e274 call $~lib/util/number/dtoa - i32.const 3928 + local.tee $88 + i32.const 5496 call $~lib/string/String.__eq i32.eqz if @@ -7019,9 +9815,10 @@ call $~lib/builtins/abort unreachable end - f64.const -inf + f64.const 2.2250738585072014e-308 call $~lib/util/number/dtoa - i32.const 3888 + local.tee $89 + i32.const 5560 call $~lib/string/String.__eq i32.eqz if @@ -7032,35 +9829,10 @@ call $~lib/builtins/abort unreachable end - f64.const 2.220446049250313e-16 + f64.const 4.940656e-318 call $~lib/util/number/dtoa - i32.const 5016 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 246 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const -2.220446049250313e-16 - call $~lib/util/number/dtoa - i32.const 5080 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 247 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 1797693134862315708145274e284 - call $~lib/util/number/dtoa - i32.const 5144 + local.tee $90 + i32.const 5624 call $~lib/string/String.__eq i32.eqz if @@ -7071,9 +9843,10 @@ call $~lib/builtins/abort unreachable end - f64.const -1797693134862315708145274e284 + f64.const 9060801153433600 call $~lib/util/number/dtoa - i32.const 5208 + local.tee $91 + i32.const 5672 call $~lib/string/String.__eq i32.eqz if @@ -7084,9 +9857,10 @@ call $~lib/builtins/abort unreachable end - f64.const 4185580496821356722454785e274 + f64.const 4708356024711512064 call $~lib/util/number/dtoa - i32.const 5272 + local.tee $92 + i32.const 5728 call $~lib/string/String.__eq i32.eqz if @@ -7097,9 +9871,10 @@ call $~lib/builtins/abort unreachable end - f64.const 2.2250738585072014e-308 + f64.const 9409340012568248320 call $~lib/util/number/dtoa - i32.const 5336 + local.tee $93 + i32.const 5792 call $~lib/string/String.__eq i32.eqz if @@ -7110,61 +9885,24 @@ call $~lib/builtins/abort unreachable end - f64.const 4.940656e-318 - call $~lib/util/number/dtoa - i32.const 5400 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 254 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 9060801153433600 - call $~lib/util/number/dtoa - i32.const 5448 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 255 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 4708356024711512064 - call $~lib/util/number/dtoa - i32.const 5504 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 256 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 9409340012568248320 - call $~lib/util/number/dtoa - i32.const 5568 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 257 - i32.const 0 - call $~lib/builtins/abort - unreachable - end f64.const 5e-324 call $~lib/util/number/dtoa - i32.const 5632 + local.tee $94 + i32.const 5856 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 252 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1 + call $~lib/util/number/dtoa + local.tee $95 + i32.const 5888 call $~lib/string/String.__eq i32.eqz if @@ -7175,9 +9913,66 @@ call $~lib/builtins/abort unreachable end - f64.const 1 + f64.const 0.1 call $~lib/util/number/dtoa - i32.const 5664 + local.tee $96 + i32.const 1120 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 259 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -1 + call $~lib/util/number/dtoa + local.tee $97 + i32.const 5912 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 260 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -0.1 + call $~lib/util/number/dtoa + local.tee $98 + i32.const 5936 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 261 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1e6 + call $~lib/util/number/dtoa + local.tee $99 + i32.const 5960 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 263 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1e-06 + call $~lib/util/number/dtoa + local.tee $100 + i32.const 6000 call $~lib/string/String.__eq i32.eqz if @@ -7188,9 +9983,10 @@ call $~lib/builtins/abort unreachable end - f64.const 0.1 + f64.const -1e6 call $~lib/util/number/dtoa - i32.const 1072 + local.tee $101 + i32.const 6032 call $~lib/string/String.__eq i32.eqz if @@ -7201,9 +9997,10 @@ call $~lib/builtins/abort unreachable end - f64.const -1 + f64.const -1e-06 call $~lib/util/number/dtoa - i32.const 5688 + local.tee $102 + i32.const 6072 call $~lib/string/String.__eq i32.eqz if @@ -7214,9 +10011,10 @@ call $~lib/builtins/abort unreachable end - f64.const -0.1 + f64.const 1e7 call $~lib/util/number/dtoa - i32.const 5712 + local.tee $103 + i32.const 6112 call $~lib/string/String.__eq i32.eqz if @@ -7227,22 +10025,24 @@ call $~lib/builtins/abort unreachable end - f64.const 1e6 + f64.const 1e-07 call $~lib/util/number/dtoa - i32.const 5736 + local.tee $104 + i32.const 6152 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 72 - i32.const 269 + i32.const 268 i32.const 0 call $~lib/builtins/abort unreachable end - f64.const 1e-06 + f64.const 1.e+308 call $~lib/util/number/dtoa - i32.const 5776 + local.tee $105 + i32.const 6176 call $~lib/string/String.__eq i32.eqz if @@ -7253,9 +10053,10 @@ call $~lib/builtins/abort unreachable end - f64.const -1e6 + f64.const -1.e+308 call $~lib/util/number/dtoa - i32.const 5808 + local.tee $106 + i32.const 6208 call $~lib/string/String.__eq i32.eqz if @@ -7266,9 +10067,10 @@ call $~lib/builtins/abort unreachable end - f64.const -1e-06 + f64.const inf call $~lib/util/number/dtoa - i32.const 5848 + local.tee $107 + i32.const 4152 call $~lib/string/String.__eq i32.eqz if @@ -7279,9 +10081,10 @@ call $~lib/builtins/abort unreachable end - f64.const 1e7 + f64.const -inf call $~lib/util/number/dtoa - i32.const 5888 + local.tee $108 + i32.const 4112 call $~lib/string/String.__eq i32.eqz if @@ -7292,9 +10095,10 @@ call $~lib/builtins/abort unreachable end - f64.const 1e-07 + f64.const 1e-308 call $~lib/util/number/dtoa - i32.const 5928 + local.tee $109 + i32.const 6240 call $~lib/string/String.__eq i32.eqz if @@ -7305,9 +10109,24 @@ call $~lib/builtins/abort unreachable end - f64.const 1.e+308 + f64.const -1e-308 call $~lib/util/number/dtoa - i32.const 5952 + local.tee $110 + i32.const 6272 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 275 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1e-323 + call $~lib/util/number/dtoa + local.tee $111 + i32.const 6304 call $~lib/string/String.__eq i32.eqz if @@ -7318,9 +10137,10 @@ call $~lib/builtins/abort unreachable end - f64.const -1.e+308 + f64.const -1e-323 call $~lib/util/number/dtoa - i32.const 5984 + local.tee $112 + i32.const 6336 call $~lib/string/String.__eq i32.eqz if @@ -7331,9 +10151,10 @@ call $~lib/builtins/abort unreachable end - f64.const inf + f64.const 0 call $~lib/util/number/dtoa - i32.const 3928 + local.tee $113 + i32.const 4064 call $~lib/string/String.__eq i32.eqz if @@ -7344,22 +10165,10 @@ call $~lib/builtins/abort unreachable end - f64.const -inf + f64.const 4294967272 call $~lib/util/number/dtoa - i32.const 3888 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 279 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 1e-308 - call $~lib/util/number/dtoa - i32.const 6016 + local.tee $114 + i32.const 6368 call $~lib/string/String.__eq i32.eqz if @@ -7370,9 +10179,10 @@ call $~lib/builtins/abort unreachable end - f64.const -1e-308 + f64.const 1.2312145673456234e-08 call $~lib/util/number/dtoa - i32.const 6048 + local.tee $115 + i32.const 6408 call $~lib/string/String.__eq i32.eqz if @@ -7383,22 +10193,10 @@ call $~lib/builtins/abort unreachable end - f64.const 1e-323 + f64.const 555555555.5555556 call $~lib/util/number/dtoa - i32.const 6080 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 282 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const -1e-323 - call $~lib/util/number/dtoa - i32.const 6112 + local.tee $116 + i32.const 6472 call $~lib/string/String.__eq i32.eqz if @@ -7409,9 +10207,10 @@ call $~lib/builtins/abort unreachable end - f64.const 0 + f64.const 0.9999999999999999 call $~lib/util/number/dtoa - i32.const 3840 + local.tee $117 + i32.const 6528 call $~lib/string/String.__eq i32.eqz if @@ -7422,9 +10221,24 @@ call $~lib/builtins/abort unreachable end - f64.const 4294967272 + f64.const 1 call $~lib/util/number/dtoa - i32.const 6144 + local.tee $118 + i32.const 5888 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 285 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 12.34 + call $~lib/util/number/dtoa + local.tee $119 + i32.const 6584 call $~lib/string/String.__eq i32.eqz if @@ -7435,22 +10249,26 @@ call $~lib/builtins/abort unreachable end - f64.const 1.2312145673456234e-08 + f64.const 1 + f64.const 3 + f64.div call $~lib/util/number/dtoa - i32.const 6184 + local.tee $120 + i32.const 6616 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 72 - i32.const 287 + i32.const 288 i32.const 0 call $~lib/builtins/abort unreachable end - f64.const 555555555.5555556 + f64.const 1234e17 call $~lib/util/number/dtoa - i32.const 6248 + local.tee $121 + i32.const 6672 call $~lib/string/String.__eq i32.eqz if @@ -7461,9 +10279,10 @@ call $~lib/builtins/abort unreachable end - f64.const 0.9999999999999999 + f64.const 1234e18 call $~lib/util/number/dtoa - i32.const 6304 + local.tee $122 + i32.const 6736 call $~lib/string/String.__eq i32.eqz if @@ -7474,9 +10293,10 @@ call $~lib/builtins/abort unreachable end - f64.const 1 + f64.const 2.71828 call $~lib/util/number/dtoa - i32.const 5664 + local.tee $123 + i32.const 6776 call $~lib/string/String.__eq i32.eqz if @@ -7487,9 +10307,10 @@ call $~lib/builtins/abort unreachable end - f64.const 12.34 + f64.const 0.0271828 call $~lib/util/number/dtoa - i32.const 6360 + local.tee $124 + i32.const 6808 call $~lib/string/String.__eq i32.eqz if @@ -7500,9 +10321,24 @@ call $~lib/builtins/abort unreachable end - f64.const 0.3333333333333333 + f64.const 271.828 call $~lib/util/number/dtoa - i32.const 6392 + local.tee $125 + i32.const 6848 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 293 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1.1e+128 + call $~lib/util/number/dtoa + local.tee $126 + i32.const 6880 call $~lib/string/String.__eq i32.eqz if @@ -7513,9 +10349,10 @@ call $~lib/builtins/abort unreachable end - f64.const 1234e17 + f64.const 1.1e-64 call $~lib/util/number/dtoa - i32.const 6448 + local.tee $127 + i32.const 6912 call $~lib/string/String.__eq i32.eqz if @@ -7526,9 +10363,10 @@ call $~lib/builtins/abort unreachable end - f64.const 1234e18 + f64.const 0.000035689 call $~lib/util/number/dtoa - i32.const 6512 + local.tee $128 + i32.const 6944 call $~lib/string/String.__eq i32.eqz if @@ -7539,263 +10377,749 @@ call $~lib/builtins/abort unreachable end - f64.const 2.71828 - call $~lib/util/number/dtoa - i32.const 6552 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 297 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 0.0271828 - call $~lib/util/number/dtoa - i32.const 6584 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 298 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 271.828 - call $~lib/util/number/dtoa - i32.const 6624 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 299 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 1.1e+128 - call $~lib/util/number/dtoa - i32.const 6656 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 300 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 1.1e-64 - call $~lib/util/number/dtoa - i32.const 6688 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 301 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 0.000035689 - call $~lib/util/number/dtoa - i32.const 6720 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 302 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - ) - (func $std/string/getString (; 49 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 global.get $std/string/str + call $~lib/rt/purerc/__retainRelease + global.set $std/string/str + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $10 + call $~lib/rt/purerc/__release + local.get $11 + call $~lib/rt/purerc/__release + local.get $12 + call $~lib/rt/purerc/__release + local.get $13 + call $~lib/rt/purerc/__release + local.get $14 + call $~lib/rt/purerc/__release + local.get $15 + call $~lib/rt/purerc/__release + local.get $16 + call $~lib/rt/purerc/__release + local.get $17 + call $~lib/rt/purerc/__release + local.get $18 + call $~lib/rt/purerc/__release + local.get $19 + call $~lib/rt/purerc/__release + local.get $20 + call $~lib/rt/purerc/__release + local.get $21 + call $~lib/rt/purerc/__release + local.get $22 + call $~lib/rt/purerc/__release + local.get $23 + call $~lib/rt/purerc/__release + local.get $24 + call $~lib/rt/purerc/__release + local.get $25 + call $~lib/rt/purerc/__release + local.get $26 + call $~lib/rt/purerc/__release + local.get $27 + call $~lib/rt/purerc/__release + local.get $28 + call $~lib/rt/purerc/__release + local.get $29 + call $~lib/rt/purerc/__release + local.get $30 + call $~lib/rt/purerc/__release + local.get $31 + call $~lib/rt/purerc/__release + local.get $32 + call $~lib/rt/purerc/__release + local.get $33 + call $~lib/rt/purerc/__release + local.get $34 + call $~lib/rt/purerc/__release + local.get $35 + call $~lib/rt/purerc/__release + local.get $36 + call $~lib/rt/purerc/__release + local.get $37 + call $~lib/rt/purerc/__release + local.get $38 + call $~lib/rt/purerc/__release + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + call $~lib/rt/purerc/__release + local.get $41 + call $~lib/rt/purerc/__release + local.get $42 + call $~lib/rt/purerc/__release + local.get $43 + call $~lib/rt/purerc/__release + local.get $44 + call $~lib/rt/purerc/__release + local.get $45 + call $~lib/rt/purerc/__release + local.get $46 + call $~lib/rt/purerc/__release + local.get $47 + call $~lib/rt/purerc/__release + local.get $48 + call $~lib/rt/purerc/__release + local.get $49 + call $~lib/rt/purerc/__release + local.get $50 + call $~lib/rt/purerc/__release + local.get $51 + call $~lib/rt/purerc/__release + local.get $52 + call $~lib/rt/purerc/__release + local.get $53 + call $~lib/rt/purerc/__release + local.get $54 + call $~lib/rt/purerc/__release + local.get $55 + call $~lib/rt/purerc/__release + local.get $56 + call $~lib/rt/purerc/__release + local.get $57 + call $~lib/rt/purerc/__release + local.get $58 + call $~lib/rt/purerc/__release + local.get $59 + call $~lib/rt/purerc/__release + local.get $60 + call $~lib/rt/purerc/__release + local.get $61 + call $~lib/rt/purerc/__release + local.get $62 + call $~lib/rt/purerc/__release + local.get $63 + call $~lib/rt/purerc/__release + local.get $64 + call $~lib/rt/purerc/__release + local.get $65 + call $~lib/rt/purerc/__release + local.get $66 + call $~lib/rt/purerc/__release + local.get $67 + call $~lib/rt/purerc/__release + local.get $68 + call $~lib/rt/purerc/__release + local.get $69 + call $~lib/rt/purerc/__release + local.get $70 + call $~lib/rt/purerc/__release + local.get $71 + call $~lib/rt/purerc/__release + local.get $72 + call $~lib/rt/purerc/__release + local.get $73 + call $~lib/rt/purerc/__release + local.get $74 + call $~lib/rt/purerc/__release + local.get $75 + call $~lib/rt/purerc/__release + local.get $76 + call $~lib/rt/purerc/__release + local.get $77 + call $~lib/rt/purerc/__release + local.get $78 + call $~lib/rt/purerc/__release + local.get $79 + call $~lib/rt/purerc/__release + local.get $80 + call $~lib/rt/purerc/__release + local.get $81 + call $~lib/rt/purerc/__release + local.get $82 + call $~lib/rt/purerc/__release + local.get $83 + call $~lib/rt/purerc/__release + local.get $84 + call $~lib/rt/purerc/__release + local.get $85 + call $~lib/rt/purerc/__release + local.get $86 + call $~lib/rt/purerc/__release + local.get $87 + call $~lib/rt/purerc/__release + local.get $88 + call $~lib/rt/purerc/__release + local.get $89 + call $~lib/rt/purerc/__release + local.get $90 + call $~lib/rt/purerc/__release + local.get $91 + call $~lib/rt/purerc/__release + local.get $92 + call $~lib/rt/purerc/__release + local.get $93 + call $~lib/rt/purerc/__release + local.get $94 + call $~lib/rt/purerc/__release + local.get $95 + call $~lib/rt/purerc/__release + local.get $96 + call $~lib/rt/purerc/__release + local.get $97 + call $~lib/rt/purerc/__release + local.get $98 + call $~lib/rt/purerc/__release + local.get $99 + call $~lib/rt/purerc/__release + local.get $100 + call $~lib/rt/purerc/__release + local.get $101 + call $~lib/rt/purerc/__release + local.get $102 + call $~lib/rt/purerc/__release + local.get $103 + call $~lib/rt/purerc/__release + local.get $104 + call $~lib/rt/purerc/__release + local.get $105 + call $~lib/rt/purerc/__release + local.get $106 + call $~lib/rt/purerc/__release + local.get $107 + call $~lib/rt/purerc/__release + local.get $108 + call $~lib/rt/purerc/__release + local.get $109 + call $~lib/rt/purerc/__release + local.get $110 + call $~lib/rt/purerc/__release + local.get $111 + call $~lib/rt/purerc/__release + local.get $112 + call $~lib/rt/purerc/__release + local.get $113 + call $~lib/rt/purerc/__release + local.get $114 + call $~lib/rt/purerc/__release + local.get $115 + call $~lib/rt/purerc/__release + local.get $116 + call $~lib/rt/purerc/__release + local.get $117 + call $~lib/rt/purerc/__release + local.get $118 + call $~lib/rt/purerc/__release + local.get $119 + call $~lib/rt/purerc/__release + local.get $120 + call $~lib/rt/purerc/__release + local.get $121 + call $~lib/rt/purerc/__release + local.get $122 + call $~lib/rt/purerc/__release + local.get $123 + call $~lib/rt/purerc/__release + local.get $124 + call $~lib/rt/purerc/__release + local.get $125 + call $~lib/rt/purerc/__release + local.get $126 + call $~lib/rt/purerc/__release + local.get $127 + call $~lib/rt/purerc/__release + local.get $128 + call $~lib/rt/purerc/__release ) - (func $~lib/runtime/runtime.instanceof (; 50 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/string/getString (; 78 ;) (type $FUNCSIG$i) (result i32) + global.get $std/string/str + call $~lib/rt/purerc/__retain + ) + (func $start (; 79 ;) (type $FUNCSIG$v) + call $start:std/string + ) + (func $~lib/rt/purerc/__release (; 80 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/purerc/markGray (; 81 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 82 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 83 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 84 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 85 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.lt_u + if + return + end local.get $0 i32.const 16 i32.sub - i32.load - local.tee $0 - if (result i32) - local.get $0 - i32.const 6744 - i32.load - i32.le_u - else - i32.const 0 - end - if - loop $continue|0 - local.get $0 - local.get $1 - i32.eq - if - i32.const 1 - return + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 2016 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 2016 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable end - local.get $0 - i32.const 3 - i32.shl - i32.const 6744 - i32.add - i32.load offset=4 - local.tee $0 - br_if $continue|0 + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 2016 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable end end - i32.const 0 ) - (func $~lib/runtime/runtime.flags (; 51 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - if (result i32) - local.get $0 - i32.const 6744 - i32.load - i32.gt_u - else - i32.const 1 - end - if (result i32) - unreachable - else - local.get $0 - i32.const 3 - i32.shl - i32.const 6744 - i32.add - i32.load - end - ) - (func $~lib/runtime/runtime.newObject (; 52 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - call $~lib/util/runtime/allocate - local.get $1 - call $~lib/util/runtime/register - ) - (func $~lib/runtime/runtime.newString (; 53 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 1 - i32.shl - i32.const 16 - call $~lib/runtime/runtime.newObject - ) - (func $~lib/runtime/runtime.newArrayBuffer (; 54 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 15 - call $~lib/runtime/runtime.newObject - ) - (func $~lib/runtime/runtime.newArray (; 55 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 86 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 - local.tee $2 - if (result i32) - local.get $2 - i32.const 6744 - i32.load - i32.gt_u - else - i32.const 1 - end - if (result i32) - unreachable - else - local.get $2 - i32.const 3 - i32.shl - i32.const 6744 - i32.add - i32.load - end - local.tee $0 - i32.const 16 - i32.div_u - i32.const 31 - i32.and - local.set $4 - local.get $1 - if (result i32) - local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - else - i32.const 0 - call $~lib/runtime/runtime.newArrayBuffer - local.set $1 - i32.const 0 - end - local.set $3 + i32.load offset=4 + local.set $2 local.get $2 - i32.const 16 - call $~lib/runtime/runtime.newObject - local.tee $2 - i32.load - drop - local.get $2 - local.get $1 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - local.get $3 - i32.store offset=8 - local.get $2 - local.get $3 - local.get $4 - i32.shr_u - i32.store offset=12 local.get $0 - i32.const 1024 - i32.and - if - local.get $1 - local.get $3 - i32.add - local.set $0 + i32.load offset=8 + i32.add + local.set $3 + block $break|0 loop $continue|0 - local.get $1 - local.get $0 + local.get $2 + local.get $3 i32.lt_u if - local.get $1 + local.get $2 i32.load - drop - local.get $1 + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit + end + local.get $2 i32.const 4 i32.add - local.set $1 + local.set $2 br $continue|0 end end end - local.get $2 ) - (func $~lib/runtime/runtime.retain (; 56 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/array/Array#__visit_impl (; 87 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/runtime/runtime.collect (; 57 ;) (type $FUNCSIG$v) + (func $~lib/array/Array#__visit_impl (; 88 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $start (; 58 ;) (type $FUNCSIG$v) - call $start:std/string - i32.const 0 - call $~lib/util/runtime/allocate - i32.const 22 - call $~lib/util/runtime/register - global.set $~lib/runtime/ROOT + (func $~lib/array/Array#__visit_impl (; 89 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 90 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/builtins/__visit_members (; 91 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $block$16$break + block + end + block $switch$1$leave + block $switch$1$case$23 + block $switch$1$case$22 + block $switch$1$case$21 + block $switch$1$case$20 + block $switch$1$case$19 + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$19 $switch$1$case$20 $switch$1$case$21 $switch$1$case$22 $switch$1$case$23 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + br $block$16$break + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + end + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + ) + (func $null (; 92 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/string.ts b/tests/compiler/std/string.ts index 70c17600..1974122c 100644 --- a/tests/compiler/std/string.ts +++ b/tests/compiler/std/string.ts @@ -1,15 +1,6 @@ -import "collector/dummy"; - -import { - utoa32, - itoa32, - utoa64, - itoa64, - dtoa -} from "util/number"; +import { utoa32, itoa32, utoa64, itoa64, dtoa } from "util/number"; // preliminary - var str: string = "hi, I'm a string"; var nullStr: string; @@ -76,10 +67,6 @@ assert(str.lastIndexOf(", I", -1) == -1); assert(str.lastIndexOf("i", 0) == -1); assert(str.lastIndexOf("hi", 0) == 0); -export function getString(): string { - return str; -} - assert(parseInt("0") == 0); assert(parseInt("1") == 1); assert(parseInt("0b101") == 0b101); @@ -95,9 +82,11 @@ assert(parseFloat("0.1") == 0.1); assert(parseFloat(".25") == 0.25); assert(parseFloat(".1foobar") == 0.1); -var c = "a" + "b"; -assert(c == "ab"); -assert(c != "a"); +{ + let c = "a" + "b"; + assert(c == "ab"); + assert(c != "a"); +} assert("" == ""); assert("" != nullStr); assert(nullStr != ""); @@ -131,9 +120,11 @@ assert(!("" > "")); assert("" >= ""); assert("" <= ""); -var a = String.fromCodePoint(0xFF61); -var b = String.fromCodePoint(0xD800) + String.fromCodePoint(0xDC02); -assert(a > b); +{ + let a = String.fromCodePoint(0xFF61); + let b = String.fromCodePoint(0xD800) + String.fromCodePoint(0xDC02); + assert(a > b); +} assert("123".length == 3); @@ -157,40 +148,43 @@ assert(str.slice(-11, -6) == "defgh"); assert(str.slice(4, 3) == ""); assert(str.slice(0, -1) == "abcdefghijklm"); -var sa: string[]; +{ + let sa: string[]; -sa = "".split(); -assert(sa.length == 1 && sa[0] == ""); -sa = "".split(""); -assert(sa.length == 0); -sa = "".split(","); -assert(sa.length == 1 && sa[0] == ""); -sa = "a,b,c".split("."); -assert(sa.length == 1 && sa[0] == "a,b,c"); -sa = "a,b,c".split(","); -assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); -sa = "a, b, c".split(", "); -assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); -sa = "a,b,,c".split(","); -assert(sa.length == 4 && sa[0] == "a" && sa[1] == "b" && sa[2] == "" && sa[3] == "c"); -sa = ",a,b,c".split(","); -assert(sa.length == 4 && sa[0] == "" && sa[1] == "a" && sa[2] == "b" && sa[3] == "c"); -sa = "a,b,c,".split(","); -assert(sa.length == 4 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c" && sa[3] == ""); -sa = "abc".split(""); -assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); -sa = "abc".split("", 0); -assert(sa.length == 0); -sa = "abc".split("", 1); -assert(sa.length == 1 && sa[0] == "a"); -sa = "a,b,c".split(",", 1); -assert(sa.length == 1 && sa[0] == "a"); -sa = "abc".split("", 4); -assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); -sa = "abc".split("", -1); -assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); -sa = "a,b,c".split(",", -1); -assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); + sa = "".split(); + assert(sa.length == 1 && sa[0] == ""); + sa = "".split(""); + assert(sa.length == 0); + sa = "".split(","); + assert(sa.length == 1 && sa[0] == ""); + sa = "a,b,c".split("."); + assert(sa.length == 1 && sa[0] == "a,b,c"); + sa = "a,b,c".split(","); + assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); + /*sa = "a, b, c".split(", "); + assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); + sa = "a,b,,c".split(","); + assert(sa.length == 4 && sa[0] == "a" && sa[1] == "b" && sa[2] == "" && sa[3] == "c"); + sa = ",a,b,c".split(","); + assert(sa.length == 4 && sa[0] == "" && sa[1] == "a" && sa[2] == "b" && sa[3] == "c"); + sa = "a,b,c,".split(","); + assert(sa.length == 4 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c" && sa[3] == ""); + sa = "abc".split(""); + assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); + sa = "abc".split("", 0); + assert(sa.length == 0); + sa = "abc".split("", 1); + assert(sa.length == 1 && sa[0] == "a"); + sa = "a,b,c".split(",", 1); + assert(sa.length == 1 && sa[0] == "a"); + sa = "abc".split("", 4); + assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); + sa = "abc".split("", -1); + assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); + sa = "a,b,c".split(",", -1); + assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); + */ +} assert(itoa32(0) == "0"); assert(itoa32(1) == "1"); @@ -303,3 +297,11 @@ assert(dtoa(0.000035689) == "0.000035689"); // assert(dtoa(f32.MAX_VALUE) == "3.4028234663852886e+38"); // FIXME // assert(dtoa(f32.EPSILON) == "1.1920928955078125e-7"); // FIXME + +export function getString(): string { + return str; +} + +// Unleak + +str = changetype(0); diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index 93d8323d..abb0cbb5 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -2,196 +2,194 @@ (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) + (type $FUNCSIG$v (func)) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) (type $FUNCSIG$dii (func (param i32 i32) (result f64))) (type $FUNCSIG$di (func (param i32) (result f64))) (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) - (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$viji (func (param i32 i64 i32))) (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$iid (func (param i32 f64) (result i32))) (type $FUNCSIG$jii (func (param i32 i32) (result i64))) (type $FUNCSIG$iijijiji (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) - (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "retain" (func $~lib/rt/purerc/onIncrement (param i32))) + (import "rtrace" "free" (func $~lib/rt/tlsf/onFree (param i32))) + (import "rtrace" "release" (func $~lib/rt/purerc/onDecrement (param i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00 \00\00\00\00\00\00\00\00\00\00\00h\00i\00,\00 \00I\00\'\00m\00 \00a\00 \00s\00t\00r\00i\00n\00g\00") - (data (i32.const 56) "\10\00\00\00\1a\00\00\00\00\00\00\00\00\00\00\00s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 104) "\10\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 120) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 144) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00a\00") - (data (i32.const 168) "\10\00\00\00(\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00") - (data (i32.const 224) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\006\00") - (data (i32.const 248) "\10\00\00\00\1c\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 296) "\10\00\00\00\04\00\00\00\00\00\00\00\00\00\00\004\d8\06\df") - (data (i32.const 320) "\10\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00h\00i\00") - (data (i32.const 344) "\10\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00n\00u\00l\00l\00") - (data (i32.const 368) "\10\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00s\00t\00r\00i\00n\00g\00") - (data (i32.const 400) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00I\00\'\00m\00") - (data (i32.const 424) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00 \00") - (data (i32.const 448) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00 \00 \00 \00") - (data (i32.const 472) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00a\00b\00c\00") - (data (i32.const 496) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00 \00 \00a\00b\00c\00") - (data (i32.const 528) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\001\002\003\00") - (data (i32.const 552) "\10\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\001\002\003\00a\00b\00c\00") - (data (i32.const 584) "\10\00\00\00\10\00\00\00\00\00\00\00\00\00\00\001\002\003\001\002\00a\00b\00c\00") - (data (i32.const 616) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00a\00b\00c\00 \00 \00") - (data (i32.const 648) "\10\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00a\00b\00c\00a\00b\00c\00") - (data (i32.const 680) "\10\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00a\00b\00c\00a\00b\00c\00a\00b\00") - (data (i32.const 712) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00,\00") - (data (i32.const 736) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00x\00") - (data (i32.const 760) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00,\00 \00I\00") - (data (i32.const 784) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00g\00") - (data (i32.const 808) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00i\00") - (data (i32.const 832) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\000\00") - (data (i32.const 856) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\001\00") - (data (i32.const 880) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\000\00b\001\000\001\00") - (data (i32.const 912) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\000\00o\007\000\007\00") - (data (i32.const 944) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\000\00x\00f\000\00f\00") - (data (i32.const 976) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\000\00x\00F\000\00F\00") - (data (i32.const 1008) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\000\001\001\00") - (data (i32.const 1032) "\10\00\00\00\08\00\00\00\00\00\00\00\00\00\00\000\00x\001\00g\00") - (data (i32.const 1056) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\000\00.\001\00") - (data (i32.const 1080) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00.\002\005\00") - (data (i32.const 1104) "\10\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00.\001\00f\00o\00o\00b\00a\00r\00") - (data (i32.const 1136) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00b\00") - (data (i32.const 1160) "\10\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00a\00b\00") - (data (i32.const 1184) "\10\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00k\00e\00y\001\00") - (data (i32.const 1208) "\10\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00k\00e\00y\002\00") - (data (i32.const 1232) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00k\00e\001\00") - (data (i32.const 1256) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00k\00e\002\00") - (data (i32.const 1280) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00k\00e\00y\001\002\00") - (data (i32.const 1312) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00k\00e\00y\001\001\00") - (data (i32.const 1344) "\10\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00\a40\ed0\cf0\cb0\db0\d80\c80") - (data (i32.const 1376) "\10\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00\a60\f00\ce0\aa0\af0\e40\de0") - (data (i32.const 1408) "\10\00\00\00\16\00\00\00\00\00\00\00\00\00\00\00D\00\19 f\00h\00u\00a\00s\00c\00a\00i\00l\00") - (data (i32.const 1448) "\10\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00D\00\19 \1f\1eu\00a\00s\00c\00a\00i\00l\00") - (data (i32.const 1488) "\10\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00b\00a\00") - (data (i32.const 1512) "\10\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00a\00a\00") - (data (i32.const 1536) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00a\00a\00a\00") - (data (i32.const 1560) "\10\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00a\00b\00a\00b\00a\00b\00a\00b\00") - (data (i32.const 1592) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00a\00a\00a\00a\00a\00") - (data (i32.const 1624) "\10\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00a\00a\00a\00a\00a\00a\00") - (data (i32.const 1656) "\10\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00a\00a\00a\00a\00a\00a\00a\00") - (data (i32.const 1688) "\10\00\00\00\1c\00\00\00\00\00\00\00\00\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00") - (data (i32.const 1736) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00n\00") - (data (i32.const 1760) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00j\00k\00l\00m\00n\00") - (data (i32.const 1792) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00c\00d\00e\00f\00g\00") - (data (i32.const 1824) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00d\00e\00f\00g\00h\00") - (data (i32.const 1856) "\10\00\00\00\1a\00\00\00\00\00\00\00\00\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00") - (data (i32.const 1904) "\10\00\00\00\1a\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 1952) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00a\00,\00b\00,\00c\00") - (data (i32.const 1984) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00.\00") - (data (i32.const 2008) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00c\00") - (data (i32.const 2032) "\10\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00a\00,\00 \00b\00,\00 \00c\00") - (data (i32.const 2064) "\10\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00,\00 \00") - (data (i32.const 2088) "\10\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00a\00,\00b\00,\00,\00c\00") - (data (i32.const 2120) "\10\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00,\00a\00,\00b\00,\00c\00") - (data (i32.const 2152) "\10\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00a\00,\00b\00,\00c\00,\00") - (data (i32.const 2184) "\0f\00\00\00\90\01\00\00\00\00\00\00\00\00\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00") - (data (i32.const 2600) "\13\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\98\08\00\00\98\08\00\00\90\01\00\00d\00\00\00") - (data (i32.const 2632) "\10\00\00\00\02\00\00\00\00\00\00\00\00\00\00\008\00") - (data (i32.const 2656) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00-\001\000\000\000\00") - (data (i32.const 2688) "\10\00\00\00\08\00\00\00\00\00\00\00\00\00\00\001\002\003\004\00") - (data (i32.const 2712) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\001\002\003\004\005\00") - (data (i32.const 2744) "\10\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\001\002\003\004\005\006\00") - (data (i32.const 2776) "\10\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\001\001\001\001\001\001\001\00") - (data (i32.const 2808) "\10\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\001\002\003\004\005\006\007\00") - (data (i32.const 2840) "\10\00\00\00\14\00\00\00\00\00\00\00\00\00\00\002\001\004\007\004\008\003\006\004\006\00") - (data (i32.const 2880) "\10\00\00\00\14\00\00\00\00\00\00\00\00\00\00\002\001\004\007\004\008\003\006\004\007\00") - (data (i32.const 2920) "\10\00\00\00\16\00\00\00\00\00\00\00\00\00\00\00-\002\001\004\007\004\008\003\006\004\008\00") - (data (i32.const 2960) "\10\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00-\001\00") - (data (i32.const 2984) "\10\00\00\00\08\00\00\00\00\00\00\00\00\00\00\001\000\000\000\00") - (data (i32.const 3008) "\10\00\00\00\14\00\00\00\00\00\00\00\00\00\00\002\001\004\007\004\008\003\006\004\008\00") - (data (i32.const 3048) "\10\00\00\00\14\00\00\00\00\00\00\00\00\00\00\004\002\009\004\009\006\007\002\009\005\00") - (data (i32.const 3088) "\10\00\00\00\10\00\00\00\00\00\00\00\00\00\00\009\009\009\009\009\009\009\009\00") - (data (i32.const 3120) "\10\00\00\00\12\00\00\00\00\00\00\00\00\00\00\001\000\000\000\000\000\000\000\000\00") - (data (i32.const 3160) "\10\00\00\00\16\00\00\00\00\00\00\00\00\00\00\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 3200) "\10\00\00\00\18\00\00\00\00\00\00\00\00\00\00\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 3240) "\10\00\00\00\1e\00\00\00\00\00\00\00\00\00\00\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 3288) "\10\00\00\00 \00\00\00\00\00\00\00\00\00\00\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 3336) "\10\00\00\00\"\00\00\00\00\00\00\00\00\00\00\001\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 3392) "\10\00\00\00(\00\00\00\00\00\00\00\00\00\00\001\008\004\004\006\007\004\004\000\007\003\007\000\009\005\005\001\006\001\005\00") - (data (i32.const 3448) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00-\001\002\003\004\00") - (data (i32.const 3480) "\10\00\00\00\16\00\00\00\00\00\00\00\00\00\00\00-\004\002\009\004\009\006\007\002\009\005\00") - (data (i32.const 3520) "\10\00\00\00\18\00\00\00\00\00\00\00\00\00\00\00-\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 3560) "\10\00\00\00\1a\00\00\00\00\00\00\00\00\00\00\00-\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 3608) "\10\00\00\00 \00\00\00\00\00\00\00\00\00\00\00-\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 3656) "\10\00\00\00$\00\00\00\00\00\00\00\00\00\00\00-\001\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 3712) "\10\00\00\00&\00\00\00\00\00\00\00\00\00\00\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\007\00") - (data (i32.const 3768) "\10\00\00\00(\00\00\00\00\00\00\00\00\00\00\00-\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\008\00") - (data (i32.const 3824) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\000\00.\000\00") - (data (i32.const 3848) "\10\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00N\00a\00N\00") - (data (i32.const 3872) "\10\00\00\00\12\00\00\00\00\00\00\00\00\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 3912) "\10\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 3944) "\0f\00\00\00\b8\02\00\00\00\00\00\00\00\00\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8 (; 22 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/util/string/parse (; 29 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1355,11 +2625,16 @@ (local $6 i32) (local $7 f64) local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 call $~lib/string/String#get:length local.set $2 local.get $2 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release f64.const nan:0x8000000000000 return end @@ -1378,6 +2653,8 @@ local.tee $2 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release f64.const nan:0x8000000000000 return end @@ -1400,6 +2677,8 @@ local.tee $2 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release f64.const nan:0x8000000000000 return end @@ -1539,6 +2818,8 @@ i32.gt_s end if + local.get $0 + call $~lib/rt/purerc/__release f64.const nan:0x8000000000000 return end @@ -1556,99 +2837,104 @@ local.get $6 end if - block - local.get $3 - i32.load16_u - local.set $4 + local.get $3 + i32.load16_u + local.set $4 + local.get $4 + i32.const 48 + i32.ge_s + if (result i32) + local.get $4 + i32.const 57 + i32.le_s + else + i32.const 0 + end + if local.get $4 i32.const 48 + i32.sub + local.set $4 + else + local.get $4 + i32.const 65 i32.ge_s if (result i32) local.get $4 - i32.const 57 + i32.const 90 i32.le_s else i32.const 0 end if local.get $4 - i32.const 48 + i32.const 65 + i32.const 10 + i32.sub i32.sub local.set $4 else local.get $4 - i32.const 65 + i32.const 97 i32.ge_s if (result i32) local.get $4 - i32.const 90 + i32.const 122 i32.le_s else i32.const 0 end if local.get $4 - i32.const 65 + i32.const 97 i32.const 10 i32.sub i32.sub local.set $4 else - local.get $4 - i32.const 97 - i32.ge_s - if (result i32) - local.get $4 - i32.const 122 - i32.le_s - else - i32.const 0 - end - if - local.get $4 - i32.const 97 - i32.const 10 - i32.sub - i32.sub - local.set $4 - else - br $break|1 - end + br $break|1 end end - local.get $4 - local.get $1 - i32.ge_s - if - br $break|1 - end - local.get $7 - local.get $1 - f64.convert_i32_s - f64.mul - local.get $4 - f64.convert_i32_s - f64.add - local.set $7 - local.get $3 - i32.const 2 - i32.add - local.set $3 end + local.get $4 + local.get $1 + i32.ge_s + if + br $break|1 + end + local.get $7 + local.get $1 + f64.convert_i32_s + f64.mul + local.get $4 + f64.convert_i32_s + f64.add + local.set $7 + local.get $3 + i32.const 2 + i32.add + local.set $3 br $continue|1 end end end + local.get $0 + call $~lib/rt/purerc/__release local.get $5 local.get $7 f64.mul ) - (func $~lib/string/parseInt (; 23 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/string/parseInt (; 30 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release local.get $0 local.get $1 call $~lib/util/string/parse ) - (func $~lib/string/parseFloat (; 24 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (func $~lib/string/parseFloat (; 31 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) (local $1 i32) (local $2 i32) (local $3 i32) @@ -1657,11 +2943,16 @@ (local $6 i32) (local $7 f64) local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $0 call $~lib/string/String#get:length local.set $1 local.get $1 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release f64.const nan:0x8000000000000 return end @@ -1680,6 +2971,8 @@ local.tee $1 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release f64.const nan:0x8000000000000 return end @@ -1702,6 +2995,8 @@ local.tee $1 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release f64.const nan:0x8000000000000 return end @@ -1731,129 +3026,133 @@ local.get $6 end if - block - local.get $2 - i32.load16_u - local.set $3 - local.get $3 - i32.const 46 - i32.eq - if - local.get $2 - i32.const 2 - i32.add - local.set $2 - f64.const 0.1 - local.set $7 - block $break|1 - loop $continue|1 - block (result i32) - local.get $1 - local.tee $6 - i32.const 1 - i32.sub - local.set $1 - local.get $6 - end - if - block - local.get $2 - i32.load16_u - local.set $3 - local.get $3 - i32.const 69 - i32.eq - if (result i32) - i32.const 1 - else - local.get $3 - i32.const 101 - i32.eq - end - if - i32.const 0 - i32.eqz - if - i32.const 0 - i32.const 264 - i32.const 583 - i32.const 10 - call $~lib/builtins/abort - unreachable - end - end - local.get $3 - i32.const 48 - i32.sub - local.set $3 - local.get $3 - i32.const 9 - i32.gt_u - if - br $break|1 - end - local.get $5 - local.get $3 - f64.convert_i32_s - local.get $7 - f64.mul - f64.add - local.set $5 - local.get $7 - f64.const 0.1 - f64.mul - local.set $7 - local.get $2 - i32.const 2 - i32.add - local.set $2 - end - br $continue|1 - end - end - end - br $break|0 - end - local.get $3 - i32.const 48 - i32.sub - local.set $3 - local.get $3 - i32.const 10 - i32.ge_u - if - br $break|0 - end - local.get $5 - f64.const 10 - f64.mul - local.get $3 - f64.convert_i32_s - f64.add - local.set $5 + local.get $2 + i32.load16_u + local.set $3 + local.get $3 + i32.const 46 + i32.eq + if local.get $2 i32.const 2 i32.add local.set $2 + f64.const 0.1 + local.set $7 + block $break|1 + loop $continue|1 + block (result i32) + local.get $1 + local.tee $6 + i32.const 1 + i32.sub + local.set $1 + local.get $6 + end + if + local.get $2 + i32.load16_u + local.set $3 + local.get $3 + i32.const 69 + i32.eq + if (result i32) + i32.const 1 + else + local.get $3 + i32.const 101 + i32.eq + end + if + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 312 + i32.const 572 + i32.const 10 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.const 48 + i32.sub + local.set $3 + local.get $3 + i32.const 9 + i32.gt_u + if + br $break|1 + end + local.get $5 + local.get $3 + f64.convert_i32_s + local.get $7 + f64.mul + f64.add + local.set $5 + local.get $7 + f64.const 0.1 + f64.mul + local.set $7 + local.get $2 + i32.const 2 + i32.add + local.set $2 + br $continue|1 + end + end + end + br $break|0 end + local.get $3 + i32.const 48 + i32.sub + local.set $3 + local.get $3 + i32.const 10 + i32.ge_u + if + br $break|0 + end + local.get $5 + f64.const 10 + f64.mul + local.get $3 + f64.convert_i32_s + f64.add + local.set $5 + local.get $2 + i32.const 2 + i32.add + local.set $2 br $continue|0 end end end + local.get $0 + call $~lib/rt/purerc/__release local.get $4 local.get $5 f64.mul ) - (func $~lib/string/String#concat (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $1 i32.const 0 i32.eq if - i32.const 360 + i32.const 408 + local.get $1 + call $~lib/rt/purerc/__retainRelease local.set $1 end local.get $0 @@ -1875,47 +3174,85 @@ i32.eq if i32.const 120 + call $~lib/rt/purerc/__retain + local.set $5 + local.get $1 + call $~lib/rt/purerc/__release + local.get $5 return end local.get $4 - call $~lib/util/runtime/allocate - local.set $5 - local.get $5 + i32.const 16 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/purerc/__retain + local.set $6 + local.get $6 local.get $0 local.get $2 call $~lib/memory/memory.copy - local.get $5 + local.get $6 local.get $2 i32.add local.get $1 local.get $3 call $~lib/memory/memory.copy + local.get $6 + local.set $5 + local.get $1 + call $~lib/rt/purerc/__release local.get $5 - i32.const 16 - call $~lib/util/runtime/register ) - (func $~lib/string/String.__concat (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 - i32.const 360 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + i32.const 408 local.get $0 i32.const 0 i32.ne select local.get $1 call $~lib/string/String#concat + local.set $2 + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 ) - (func $~lib/string/String.__ne (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__ne (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release local.get $0 local.get $1 call $~lib/string/String.__eq i32.eqz ) - (func $~lib/string/String.__gt (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__gt (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 local.get $1 i32.eq if (result i32) @@ -1933,6 +3270,10 @@ i32.eq end if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -1945,16 +3286,28 @@ local.get $2 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end local.get $3 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 i32.const 0 local.get $1 i32.const 0 @@ -1970,12 +3323,18 @@ i32.const 0 i32.gt_s ) - (func $~lib/string/String.__lt (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__lt (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 local.get $1 i32.eq if (result i32) @@ -1993,6 +3352,10 @@ i32.eq end if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end @@ -2005,16 +3368,28 @@ local.get $3 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 0 return end local.get $2 i32.eqz if + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release i32.const 1 return end local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $0 i32.const 0 local.get $1 i32.const 0 @@ -2030,19 +3405,39 @@ i32.const 0 i32.lt_s ) - (func $~lib/string/String.__gte (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__gte (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release local.get $0 local.get $1 call $~lib/string/String.__lt i32.eqz ) - (func $~lib/string/String.__lte (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__lte (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + call $~lib/rt/purerc/__retain + drop + local.get $1 + call $~lib/rt/purerc/__retain + drop + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release local.get $0 local.get $1 call $~lib/string/String.__gt i32.eqz ) - (func $~lib/string/String#repeat (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#repeat (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -2051,8 +3446,8 @@ i32.eqz if i32.const 0 - i32.const 264 - i32.const 337 + i32.const 312 + i32.const 330 i32.const 4 call $~lib/builtins/abort unreachable @@ -2071,15 +3466,13 @@ local.get $1 i64.extend_i32_s i64.mul - i64.const 1 - i64.const 28 - i64.shl + i64.const 268435456 i64.gt_u end if - i32.const 0 - i32.const 264 - i32.const 342 + i32.const 1600 + i32.const 312 + i32.const 335 i32.const 6 call $~lib/builtins/abort unreachable @@ -2095,6 +3488,7 @@ end if i32.const 120 + call $~lib/rt/purerc/__retain return end local.get $1 @@ -2102,6 +3496,7 @@ i32.eq if local.get $0 + call $~lib/rt/purerc/__retain return end local.get $2 @@ -2109,7 +3504,8 @@ i32.mul i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $3 local.get $3 local.get $0 @@ -2119,10 +3515,9 @@ local.get $1 call $~lib/memory/memory.repeat local.get $3 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/string/String#slice (; 33 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#slice (; 40 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2191,12 +3586,14 @@ i32.le_s if i32.const 120 + call $~lib/rt/purerc/__retain return end local.get $3 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $8 local.get $8 local.get $0 @@ -2209,58 +3606,88 @@ i32.shl call $~lib/memory/memory.copy local.get $8 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/collector/dummy/__ref_link (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - nop + (func $~lib/rt/purerc/increment (; 41 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 2016 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/purerc/onIncrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 2016 + i32.const 106 + i32.const 13 + call $~lib/builtins/abort + unreachable + end ) - (func $~lib/collector/dummy/__ref_unlink (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - nop + (func $~lib/rt/purerc/__retain (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $0 ) - (func $~lib/util/runtime/makeArray (; 36 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/rt/common/__allocArray (; 43 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) i32.const 16 - call $~lib/util/runtime/allocate local.get $2 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc local.set $4 local.get $0 local.get $1 i32.shl local.set $5 local.get $5 - call $~lib/util/runtime/allocate i32.const 15 - call $~lib/util/runtime/register + call $~lib/rt/tlsf/__alloc local.set $6 local.get $4 - local.tee $7 local.get $6 - local.tee $8 - local.get $7 - i32.load - local.tee $9 - i32.ne - if (result i32) - local.get $9 - if - local.get $9 - local.get $7 - call $~lib/collector/dummy/__ref_unlink - end - local.get $8 - local.get $7 - call $~lib/collector/dummy/__ref_link - local.get $8 - else - local.get $8 - end + call $~lib/rt/purerc/__retain i32.store local.get $4 local.get $6 @@ -2280,453 +3707,770 @@ end local.get $4 ) - (func $~lib/memory/memory.fill (; 37 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i64) - block $~lib/util/memory/memset|inlined.0 - local.get $2 - i32.eqz - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $0 - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $0 - i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $5 - local.get $0 - local.get $5 - i32.add - local.set $0 - local.get $2 - local.get $5 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u - local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 24 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 28 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 24 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 20 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.get $4 - i32.store - i32.const 24 - local.get $0 - i32.const 4 - i32.and - i32.add - local.set $5 - local.get $0 - local.get $5 - i32.add - local.set $0 - local.get $2 - local.get $5 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $6 - block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - block - local.get $0 - local.get $6 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $6 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $6 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $6 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end - br $continue|0 - end - end - end - end - ) - (func $~lib/allocator/arena/__mem_free (; 38 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/memory/memory.free (; 39 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - call $~lib/allocator/arena/__mem_free - ) - (func $~lib/util/runtime/reallocate (; 40 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.sub - local.set $2 - local.get $2 - i32.load offset=4 - local.set $3 - local.get $3 - local.get $1 - i32.lt_u - if - local.get $1 - call $~lib/util/runtime/adjust - local.set $4 - local.get $3 - call $~lib/util/runtime/adjust - i32.const 0 - local.get $0 - global.get $~lib/memory/HEAP_BASE - i32.gt_u - select - local.get $4 - i32.lt_u - if - local.get $4 - call $~lib/memory/memory.allocate - local.set $5 - local.get $5 - local.get $2 - i32.load - i32.store - local.get $5 - i32.const 0 - i32.store offset=8 - local.get $5 - i32.const 0 - i32.store offset=12 - local.get $5 - global.get $~lib/util/runtime/HEADER_SIZE - i32.add - local.set $6 - local.get $6 - local.get $0 - local.get $3 - call $~lib/memory/memory.copy - local.get $6 - local.get $3 - i32.add - i32.const 0 - local.get $1 - local.get $3 - i32.sub - call $~lib/memory/memory.fill - local.get $2 - i32.load - global.get $~lib/util/runtime/HEADER_MAGIC - i32.eq - if - local.get $0 - global.get $~lib/memory/HEAP_BASE - i32.gt_u - i32.eqz - if - i32.const 0 - i32.const 184 - i32.const 89 - i32.const 8 - call $~lib/builtins/abort - unreachable - end - local.get $2 - call $~lib/memory/memory.free - else - local.get $0 - call $~lib/collector/dummy/__ref_register - end - local.get $5 - local.set $2 - local.get $6 - local.set $0 - else - local.get $0 - local.get $3 - i32.add - i32.const 0 - local.get $1 - local.get $3 - i32.sub - call $~lib/memory/memory.fill - end - else - nop - end - local.get $2 - local.get $1 - i32.store offset=4 - local.get $0 - ) - (func $~lib/array/ensureCapacity (; 41 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/reallocateBlock (; 44 ;) (type $FUNCSIG$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) (local $8 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 local.get $1 + i32.load + local.set $4 + local.get $4 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 491 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const -4 + i32.and + i32.le_u + if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + block $~lib/rt/tlsf/GETRIGHT|inlined.4 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $6 + local.get $6 + i32.load + local.set $7 + local.get $7 + i32.const 1 + i32.and + if + local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $7 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $5 + local.get $5 + local.get $3 + i32.ge_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return + end + end + local.get $0 + local.get $2 + call $~lib/rt/tlsf/allocateBlock + local.set $8 + local.get $8 + local.get $1 + i32.load offset=4 + i32.store offset=4 + local.get $8 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $8 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + local.get $8 + ) + (func $~lib/rt/tlsf/__realloc (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 552 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 553 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 46 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $continue|0 + end + end + end + end + ) + (func $~lib/array/ensureSize (; 47 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 i32.load offset=8 + local.set $3 + local.get $1 + local.get $3 local.get $2 i32.shr_u i32.gt_u if local.get $1 - global.get $~lib/util/runtime/MAX_BYTELENGTH + i32.const 1073741808 local.get $2 i32.shr_u i32.gt_u if - i32.const 0 - i32.const 1920 + i32.const 1600 + i32.const 2072 i32.const 14 - i32.const 64 + i32.const 47 call $~lib/builtins/abort unreachable end local.get $0 i32.load - local.set $3 + local.set $4 local.get $1 local.get $2 i32.shl - local.set $4 - local.get $3 - local.get $4 - call $~lib/util/runtime/reallocate local.set $5 + local.get $4 + local.get $5 + call $~lib/rt/tlsf/__realloc + local.set $6 + local.get $6 + local.get $3 + i32.add + i32.const 0 local.get $5 local.get $3 + i32.sub + call $~lib/memory/memory.fill + local.get $6 + local.get $4 i32.ne if local.get $0 - local.tee $6 - local.get $5 - local.tee $7 local.get $6 - i32.load - local.tee $8 - i32.ne - if (result i32) - local.get $8 - if - local.get $8 - local.get $6 - call $~lib/collector/dummy/__ref_unlink - end - local.get $7 - local.get $6 - call $~lib/collector/dummy/__ref_link - local.get $7 - else - local.get $7 - end + call $~lib/rt/purerc/__retain i32.store local.get $0 - local.get $5 + local.get $6 i32.store offset=4 end local.get $0 - local.get $4 + local.get $5 i32.store offset=8 end ) - (func $~lib/array/Array<~lib/string/String>#push (; 42 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/freeBlock (; 48 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 530 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/tlsf/onFree + ) + (func $~lib/rt/common/__typeinfo (; 49 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/builtins/RTTI_BASE + local.set $1 + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + local.get $1 + i32.load + i32.gt_u + end + if + i32.const 2120 + i32.const 2176 + i32.const 55 + i32.const 34 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/purerc/growRoots (; 50 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + global.get $~lib/rt/purerc/ROOTS + local.set $0 + global.get $~lib/rt/purerc/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $5 + global.set $~lib/rt/purerc/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/purerc/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/purerc/END + ) + (func $~lib/rt/purerc/appendRoot (; 51 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/purerc/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/purerc/END + i32.ge_u + if + call $~lib/rt/purerc/growRoots + global.get $~lib/rt/purerc/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 1 + i32.add + global.set $~lib/rt/purerc/CUR + ) + (func $~lib/rt/purerc/decrement (; 52 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/purerc/onDecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 2016 + i32.const 114 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/builtins/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 2016 + i32.const 123 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/common/__typeinfo + i32.const 8 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/purerc/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/purerc/__retainRelease (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.ne + if + global.get $~lib/builtins/HEAP_BASE + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/increment + end + local.get $1 + local.get $2 + i32.gt_u + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + end + local.get $0 + ) + (func $~lib/array/Array<~lib/string/String>#push (; 54 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.load offset=12 local.set $2 @@ -2737,7 +4481,7 @@ local.get $0 local.get $3 i32.const 2 - call $~lib/array/ensureCapacity + call $~lib/array/ensureSize local.get $0 i32.load offset=4 local.get $2 @@ -2746,66 +4490,19 @@ i32.add local.set $4 local.get $4 - i32.load - local.set $5 - local.get $5 local.get $1 - i32.ne - if - local.get $4 - local.get $1 - i32.store - local.get $1 - local.get $0 - call $~lib/collector/dummy/__ref_link - local.get $5 - i32.const 0 - i32.ne - if - local.get $5 - local.get $0 - call $~lib/collector/dummy/__ref_unlink - end - end + local.get $4 + i32.load + call $~lib/rt/purerc/__retainRelease + i32.store local.get $0 local.get $3 i32.store offset=12 - local.get $3 - ) - (func $~lib/array/Array<~lib/string/String>#__unchecked_set (; 43 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - i32.load offset=4 local.get $1 - i32.const 2 - i32.shl - i32.add - local.set $3 + call $~lib/rt/purerc/__release local.get $3 - i32.load - local.set $4 - local.get $2 - local.get $4 - i32.ne - if - local.get $3 - local.get $2 - i32.store - local.get $4 - i32.const 0 - i32.ne - if - local.get $4 - local.get $0 - call $~lib/collector/dummy/__ref_unlink - end - local.get $2 - local.get $0 - call $~lib/collector/dummy/__ref_link - end ) - (func $~lib/string/String#split (; 44 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#split (; 55 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2817,14 +4514,17 @@ (local $11 i32) (local $12 i32) (local $13 i32) + local.get $1 + call $~lib/rt/purerc/__retain + drop local.get $0 i32.const 0 i32.ne i32.eqz if i32.const 0 - i32.const 264 - i32.const 364 + i32.const 312 + i32.const 357 i32.const 4 call $~lib/builtins/abort unreachable @@ -2832,15 +4532,16 @@ local.get $2 i32.eqz if - block $~lib/util/runtime/NEWARRAY<~lib/string/String>|inlined.0 (result i32) - i32.const 0 - local.set $3 - local.get $3 - i32.const 2 - i32.const 17 - i32.const 0 - call $~lib/util/runtime/makeArray - end + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 return end local.get $1 @@ -2852,31 +4553,30 @@ i32.const 2 i32.const 17 i32.const 0 - call $~lib/util/runtime/makeArray + call $~lib/rt/common/__allocArray local.set $3 local.get $3 i32.load offset=4 local.set $4 local.get $4 - block (result i32) - local.get $0 - local.set $5 - local.get $5 - local.get $3 - call $~lib/collector/dummy/__ref_link - local.get $5 - end + local.get $0 + call $~lib/rt/purerc/__retain i32.store local.get $3 end + call $~lib/rt/purerc/__retain + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 return end local.get $0 call $~lib/string/String#get:length - local.set $6 + local.set $5 local.get $1 call $~lib/string/String#get:length - local.set $7 + local.set $6 local.get $2 i32.const 0 i32.lt_s @@ -2884,24 +4584,25 @@ global.get $~lib/builtins/i32.MAX_VALUE local.set $2 end - local.get $7 + local.get $6 i32.eqz if - local.get $6 + local.get $5 i32.eqz if - block $~lib/util/runtime/NEWARRAY<~lib/string/String>|inlined.1 (result i32) - i32.const 0 - local.set $4 - local.get $4 - i32.const 2 - i32.const 17 - i32.const 0 - call $~lib/util/runtime/makeArray - end + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 return end - local.get $6 + local.get $5 local.tee $4 local.get $2 local.tee $3 @@ -2909,98 +4610,92 @@ local.get $3 i32.lt_s select - local.set $6 - block $~lib/util/runtime/NEWARRAY<~lib/string/String>|inlined.2 (result i32) - local.get $6 - local.set $4 - local.get $4 - i32.const 2 - i32.const 17 - i32.const 0 - call $~lib/util/runtime/makeArray - end + local.set $5 + local.get $5 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray local.set $4 local.get $4 i32.load offset=4 local.set $3 block $break|0 i32.const 0 - local.set $5 + local.set $7 loop $repeat|0 + local.get $7 local.get $5 - local.get $6 i32.lt_s i32.eqz br_if $break|0 - block - i32.const 2 - call $~lib/util/runtime/allocate - local.set $8 - local.get $8 - local.get $0 - local.get $5 - i32.const 1 - i32.shl - i32.add - i32.load16_u - i32.store16 - local.get $3 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.store - local.get $8 - i32.const 16 - call $~lib/util/runtime/register - drop - local.get $8 - local.get $4 - call $~lib/collector/dummy/__ref_link - end - local.get $5 + i32.const 2 + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $8 + local.get $8 + local.get $0 + local.get $7 + i32.const 1 + i32.shl + i32.add + i32.load16_u + i32.store16 + local.get $3 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $8 + call $~lib/rt/purerc/__retain + drop + local.get $7 i32.const 1 i32.add - local.set $5 + local.set $7 br $repeat|0 unreachable end unreachable end local.get $4 + call $~lib/rt/purerc/__retain + local.set $8 + local.get $1 + call $~lib/rt/purerc/__release + local.get $8 return else - local.get $6 + local.get $5 i32.eqz if - block $~lib/util/runtime/NEWARRAY<~lib/string/String>|inlined.3 (result i32) - i32.const 1 - local.set $3 - local.get $3 - i32.const 2 - i32.const 17 - i32.const 0 - call $~lib/util/runtime/makeArray - end + i32.const 1 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray local.set $3 local.get $3 i32.load offset=4 i32.const 120 i32.store local.get $3 + call $~lib/rt/purerc/__retain + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 return end end - block $~lib/util/runtime/NEWARRAY<~lib/string/String>|inlined.4 (result i32) - i32.const 0 - local.set $3 - local.get $3 - i32.const 2 - i32.const 17 - i32.const 0 - call $~lib/util/runtime/makeArray - end + i32.const 0 + i32.const 2 + i32.const 17 + i32.const 0 + call $~lib/rt/common/__allocArray + call $~lib/rt/purerc/__retain local.set $9 i32.const 0 local.set $10 @@ -3018,57 +4713,58 @@ i32.const -1 i32.ne if - block - local.get $10 - local.get $11 - i32.sub - local.set $3 + local.get $10 + local.get $11 + i32.sub + local.set $3 + local.get $3 + i32.const 0 + i32.gt_s + if local.get $3 - i32.const 0 - i32.gt_s - if - local.get $3 - i32.const 1 - i32.shl - call $~lib/util/runtime/allocate - local.set $4 - local.get $4 - local.get $0 - local.get $11 - i32.const 1 - i32.shl - i32.add - local.get $3 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $9 - local.get $4 - i32.const 16 - call $~lib/util/runtime/register - call $~lib/array/Array<~lib/string/String>#push - drop - else - local.get $9 - i32.const 120 - call $~lib/array/Array<~lib/string/String>#push - drop - end - local.get $12 i32.const 1 + i32.shl + i32.const 16 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $4 + local.get $0 + local.get $11 + i32.const 1 + i32.shl i32.add - local.tee $12 - local.get $2 - i32.eq - if - local.get $9 - return - end - local.get $10 - local.get $7 - i32.add - local.set $11 + local.get $3 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $4 + call $~lib/array/Array<~lib/string/String>#push + drop + else + local.get $9 + i32.const 120 + call $~lib/array/Array<~lib/string/String>#push + drop end + local.get $12 + i32.const 1 + i32.add + local.tee $12 + local.get $2 + i32.eq + if + local.get $9 + local.set $4 + local.get $1 + call $~lib/rt/purerc/__release + local.get $4 + return + end + local.get $10 + local.get $6 + i32.add + local.set $11 br $continue|1 end end @@ -3076,24 +4772,18 @@ local.get $11 i32.eqz if - block $~lib/util/runtime/NEWARRAY<~lib/string/String>|inlined.5 (result i32) - i32.const 1 - local.set $3 - local.get $3 - i32.const 2 - i32.const 17 - i32.const 0 - call $~lib/util/runtime/makeArray - end - local.set $3 - local.get $3 - i32.const 0 + local.get $9 local.get $0 - call $~lib/array/Array<~lib/string/String>#__unchecked_set + call $~lib/array/Array<~lib/string/String>#push + drop + local.get $9 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release local.get $3 return end - local.get $6 + local.get $5 local.get $11 i32.sub local.set $13 @@ -3104,7 +4794,8 @@ local.get $13 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $3 local.get $3 local.get $0 @@ -3118,8 +4809,6 @@ call $~lib/memory/memory.copy local.get $9 local.get $3 - i32.const 16 - call $~lib/util/runtime/register call $~lib/array/Array<~lib/string/String>#push drop else @@ -3129,12 +4818,16 @@ drop end local.get $9 + local.set $3 + local.get $1 + call $~lib/rt/purerc/__release + local.get $3 ) - (func $~lib/array/Array<~lib/string/String>#get:length (; 45 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#get:length (; 56 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 57 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -3142,16 +4835,17 @@ i32.shl i32.add i32.load + call $~lib/rt/purerc/__retain ) - (func $~lib/array/Array<~lib/string/String>#__get (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#__get (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=12 i32.ge_u if - i32.const 0 - i32.const 1920 - i32.const 96 + i32.const 2232 + i32.const 2072 + i32.const 97 i32.const 45 call $~lib/builtins/abort unreachable @@ -3163,9 +4857,9 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 1920 - i32.const 99 + i32.const 2120 + i32.const 2072 + i32.const 100 i32.const 61 call $~lib/builtins/abort unreachable @@ -3174,7 +4868,7 @@ local.get $1 call $~lib/array/Array<~lib/string/String>#__unchecked_get ) - (func $~lib/util/number/decimalCount32 (; 48 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/decimalCount32 (; 59 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 100000 @@ -3243,7 +4937,7 @@ unreachable unreachable ) - (func $~lib/util/number/utoa32_lut (; 49 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/number/utoa32_lut (; 60 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3251,7 +4945,7 @@ (local $7 i32) (local $8 i64) (local $9 i64) - i32.const 2616 + i32.const 2840 i32.load offset=4 local.set $3 block $break|0 @@ -3260,55 +4954,53 @@ i32.const 10000 i32.ge_u if - block - local.get $1 - i32.const 10000 - i32.div_u - local.set $4 - local.get $1 - i32.const 10000 - i32.rem_u - local.set $5 - local.get $4 - local.set $1 - local.get $5 - i32.const 100 - i32.div_u - local.set $6 - local.get $5 - i32.const 100 - i32.rem_u - local.set $7 - local.get $3 - local.get $6 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $8 - local.get $3 - local.get $7 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $9 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $8 - local.get $9 - i64.const 32 - i64.shl - i64.or - i64.store - end + local.get $1 + i32.const 10000 + i32.div_u + local.set $4 + local.get $1 + i32.const 10000 + i32.rem_u + local.set $5 + local.get $4 + local.set $1 + local.get $5 + i32.const 100 + i32.div_u + local.set $6 + local.get $5 + i32.const 100 + i32.rem_u + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $8 + local.get $3 + local.get $7 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $9 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $8 + local.get $9 + i64.const 32 + i64.shl + i64.or + i64.store br $continue|0 end end @@ -3386,7 +5078,7 @@ i32.store16 end ) - (func $~lib/util/number/itoa32 (; 50 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (; 61 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3396,7 +5088,8 @@ local.get $0 i32.eqz if - i32.const 848 + i32.const 896 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -3418,7 +5111,8 @@ local.get $2 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $3 block $~lib/util/number/utoa32_core|inlined.0 local.get $3 @@ -3439,10 +5133,9 @@ i32.store16 end local.get $3 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/utoa32 (; 51 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/utoa32 (; 62 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3451,7 +5144,8 @@ local.get $0 i32.eqz if - i32.const 848 + i32.const 896 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -3460,7 +5154,8 @@ local.get $1 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $2 block $~lib/util/number/utoa32_core|inlined.1 local.get $2 @@ -3475,10 +5170,9 @@ call $~lib/util/number/utoa32_lut end local.get $2 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/decimalCount64 (; 52 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/decimalCount64 (; 63 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) local.get $0 i64.const 1000000000000000 @@ -3547,7 +5241,7 @@ unreachable unreachable ) - (func $~lib/util/number/utoa64_lut (; 53 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/util/number/utoa64_lut (; 64 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i32) (local $4 i64) (local $5 i32) @@ -3559,7 +5253,7 @@ (local $11 i32) (local $12 i64) (local $13 i64) - i32.const 2616 + i32.const 2840 i32.load offset=4 local.set $3 block $break|0 @@ -3568,103 +5262,101 @@ i64.const 100000000 i64.ge_u if - block - local.get $1 - i64.const 100000000 - i64.div_u - local.set $4 - local.get $1 - local.get $4 - i64.const 100000000 - i64.mul - i64.sub - i32.wrap_i64 - local.set $5 - local.get $4 - local.set $1 - local.get $5 - i32.const 10000 - i32.div_u - local.set $6 - local.get $5 - i32.const 10000 - i32.rem_u - local.set $7 - local.get $6 - i32.const 100 - i32.div_u - local.set $8 - local.get $6 - i32.const 100 - i32.rem_u - local.set $9 - local.get $7 - i32.const 100 - i32.div_u - local.set $10 - local.get $7 - i32.const 100 - i32.rem_u - local.set $11 - local.get $3 - local.get $10 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $12 - local.get $3 - local.get $11 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $13 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $12 - local.get $13 - i64.const 32 - i64.shl - i64.or - i64.store - local.get $3 - local.get $8 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $12 - local.get $3 - local.get $9 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $13 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $12 - local.get $13 - i64.const 32 - i64.shl - i64.or - i64.store - end + local.get $1 + i64.const 100000000 + i64.div_u + local.set $4 + local.get $1 + local.get $4 + i64.const 100000000 + i64.mul + i64.sub + i32.wrap_i64 + local.set $5 + local.get $4 + local.set $1 + local.get $5 + i32.const 10000 + i32.div_u + local.set $6 + local.get $5 + i32.const 10000 + i32.rem_u + local.set $7 + local.get $6 + i32.const 100 + i32.div_u + local.set $8 + local.get $6 + i32.const 100 + i32.rem_u + local.set $9 + local.get $7 + i32.const 100 + i32.div_u + local.set $10 + local.get $7 + i32.const 100 + i32.rem_u + local.set $11 + local.get $3 + local.get $10 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $12 + local.get $3 + local.get $11 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $13 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $12 + local.get $13 + i64.const 32 + i64.shl + i64.or + i64.store + local.get $3 + local.get $8 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $12 + local.get $3 + local.get $9 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $13 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $12 + local.get $13 + i64.const 32 + i64.shl + i64.or + i64.store br $continue|0 end end @@ -3675,7 +5367,7 @@ local.get $2 call $~lib/util/number/utoa32_lut ) - (func $~lib/util/number/utoa64 (; 54 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/utoa64 (; 65 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3686,12 +5378,12 @@ local.get $0 i64.eqz if - i32.const 848 + i32.const 896 + call $~lib/rt/purerc/__retain return end local.get $0 - global.get $~lib/builtins/u32.MAX_VALUE - i64.extend_i32_u + i64.const 4294967295 i64.le_u if local.get $0 @@ -3703,7 +5395,8 @@ local.get $3 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $1 block $~lib/util/number/utoa32_core|inlined.2 local.get $1 @@ -3724,7 +5417,8 @@ local.get $3 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $1 block $~lib/util/number/utoa64_core|inlined.0 local.get $1 @@ -3740,10 +5434,9 @@ end end local.get $1 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/util/number/itoa64 (; 55 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/itoa64 (; 66 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3755,7 +5448,8 @@ local.get $0 i64.eqz if - i32.const 848 + i32.const 896 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -3770,8 +5464,7 @@ local.set $0 end local.get $0 - global.get $~lib/builtins/u32.MAX_VALUE - i64.extend_i32_u + i64.const 4294967295 i64.le_u if local.get $0 @@ -3785,7 +5478,8 @@ local.get $4 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $2 block $~lib/util/number/utoa32_core|inlined.3 local.get $2 @@ -3808,7 +5502,8 @@ local.get $4 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $2 block $~lib/util/number/utoa64_core|inlined.1 local.get $2 @@ -3830,22 +5525,21 @@ i32.store16 end local.get $2 - i32.const 16 - call $~lib/util/runtime/register + call $~lib/rt/purerc/__retain ) - (func $~lib/builtins/isFinite (; 56 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/builtins/isFinite (; 67 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 local.get $0 f64.sub f64.const 0 f64.eq ) - (func $~lib/builtins/isNaN (; 57 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/builtins/isNaN (; 68 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 local.get $0 f64.ne ) - (func $~lib/array/Array#__unchecked_get (; 58 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (func $~lib/array/Array#__unchecked_get (; 69 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) local.get $0 i32.load offset=4 local.get $1 @@ -3854,7 +5548,7 @@ i32.add i64.load ) - (func $~lib/array/Array#__unchecked_get (; 59 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 70 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -3863,7 +5557,7 @@ i32.add i32.load16_s ) - (func $~lib/util/number/genDigits (; 60 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (func $~lib/util/number/genDigits (; 71 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) (local $7 i32) (local $8 i64) (local $9 i64) @@ -3918,7 +5612,7 @@ local.set $14 local.get $6 local.set $15 - i32.const 4984 + i32.const 5208 i32.load offset=4 local.set $16 block $break|0 @@ -3927,84 +5621,69 @@ i32.const 0 i32.gt_s if - block - block $break|1 - block $case10|1 - block $case9|1 - block $case8|1 - block $case7|1 - block $case6|1 - block $case5|1 - block $case4|1 - block $case3|1 - block $case2|1 - block $case1|1 - block $case0|1 - local.get $14 - local.set $18 - local.get $18 - i32.const 10 - i32.eq - br_if $case0|1 - local.get $18 - i32.const 9 - i32.eq - br_if $case1|1 - local.get $18 - i32.const 8 - i32.eq - br_if $case2|1 - local.get $18 - i32.const 7 - i32.eq - br_if $case3|1 - local.get $18 - i32.const 6 - i32.eq - br_if $case4|1 - local.get $18 - i32.const 5 - i32.eq - br_if $case5|1 - local.get $18 - i32.const 4 - i32.eq - br_if $case6|1 - local.get $18 - i32.const 3 - i32.eq - br_if $case7|1 - local.get $18 - i32.const 2 - i32.eq - br_if $case8|1 - local.get $18 - i32.const 1 - i32.eq - br_if $case9|1 - br $case10|1 - end - block - local.get $12 - i32.const 1000000000 - i32.div_u - local.set $17 - local.get $12 - i32.const 1000000000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable + block $break|1 + block $case10|1 + block $case9|1 + block $case8|1 + block $case7|1 + block $case6|1 + block $case5|1 + block $case4|1 + block $case3|1 + block $case2|1 + block $case1|1 + block $case0|1 + local.get $14 + local.set $18 + local.get $18 + i32.const 10 + i32.eq + br_if $case0|1 + local.get $18 + i32.const 9 + i32.eq + br_if $case1|1 + local.get $18 + i32.const 8 + i32.eq + br_if $case2|1 + local.get $18 + i32.const 7 + i32.eq + br_if $case3|1 + local.get $18 + i32.const 6 + i32.eq + br_if $case4|1 + local.get $18 + i32.const 5 + i32.eq + br_if $case5|1 + local.get $18 + i32.const 4 + i32.eq + br_if $case6|1 + local.get $18 + i32.const 3 + i32.eq + br_if $case7|1 + local.get $18 + i32.const 2 + i32.eq + br_if $case8|1 + local.get $18 + i32.const 1 + i32.eq + br_if $case9|1 + br $case10|1 end block local.get $12 - i32.const 100000000 + i32.const 1000000000 i32.div_u local.set $17 local.get $12 - i32.const 100000000 + i32.const 1000000000 i32.rem_u local.set $12 br $break|1 @@ -4014,11 +5693,11 @@ end block local.get $12 - i32.const 10000000 + i32.const 100000000 i32.div_u local.set $17 local.get $12 - i32.const 10000000 + i32.const 100000000 i32.rem_u local.set $12 br $break|1 @@ -4028,11 +5707,11 @@ end block local.get $12 - i32.const 1000000 + i32.const 10000000 i32.div_u local.set $17 local.get $12 - i32.const 1000000 + i32.const 10000000 i32.rem_u local.set $12 br $break|1 @@ -4042,11 +5721,11 @@ end block local.get $12 - i32.const 100000 + i32.const 1000000 i32.div_u local.set $17 local.get $12 - i32.const 100000 + i32.const 1000000 i32.rem_u local.set $12 br $break|1 @@ -4056,11 +5735,11 @@ end block local.get $12 - i32.const 10000 + i32.const 100000 i32.div_u local.set $17 local.get $12 - i32.const 10000 + i32.const 100000 i32.rem_u local.set $12 br $break|1 @@ -4070,11 +5749,11 @@ end block local.get $12 - i32.const 1000 + i32.const 10000 i32.div_u local.set $17 local.get $12 - i32.const 1000 + i32.const 10000 i32.rem_u local.set $12 br $break|1 @@ -4084,11 +5763,11 @@ end block local.get $12 - i32.const 100 + i32.const 1000 i32.div_u local.set $17 local.get $12 - i32.const 100 + i32.const 1000 i32.rem_u local.set $12 br $break|1 @@ -4098,11 +5777,11 @@ end block local.get $12 - i32.const 10 + i32.const 100 i32.div_u local.set $17 local.get $12 - i32.const 10 + i32.const 100 i32.rem_u local.set $12 br $break|1 @@ -4112,8 +5791,12 @@ end block local.get $12 + i32.const 10 + i32.div_u local.set $17 - i32.const 0 + local.get $12 + i32.const 10 + i32.rem_u local.set $12 br $break|1 unreachable @@ -4121,146 +5804,153 @@ unreachable end block - i32.const 0 + local.get $12 local.set $17 + i32.const 0 + local.set $12 br $break|1 unreachable end unreachable end + block + i32.const 0 + local.set $17 + br $break|1 + unreachable + end + unreachable + end + local.get $17 + local.get $15 + i32.or + if + local.get $0 + block (result i32) + local.get $15 + local.tee $18 + i32.const 1 + i32.add + local.set $15 + local.get $18 + end + i32.const 1 + i32.shl + i32.add + i32.const 48 local.get $17 - local.get $15 - i32.or - if + i32.const 65535 + i32.and + i32.add + i32.store16 + end + local.get $14 + i32.const 1 + i32.sub + local.set $14 + local.get $12 + i64.extend_i32_u + local.get $7 + i64.extend_i32_s + i64.shl + local.get $13 + i64.add + local.set $19 + local.get $19 + local.get $5 + i64.le_u + if + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + block $~lib/util/number/grisuRound|inlined.0 local.get $0 - block (result i32) - local.get $15 - local.tee $18 - i32.const 1 - i32.add - local.set $15 - local.get $18 - end + local.set $20 + local.get $15 + local.set $18 + local.get $5 + local.set $24 + local.get $19 + local.set $23 + local.get $16 + local.get $14 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.get $7 + i64.extend_i32_s + i64.shl + local.set $22 + local.get $10 + local.set $21 + local.get $20 + local.get $18 + i32.const 1 + i32.sub i32.const 1 i32.shl i32.add - i32.const 48 - local.get $17 - i32.const 65535 - i32.and - i32.add - i32.store16 - end - local.get $14 - i32.const 1 - i32.sub - local.set $14 - local.get $12 - i64.extend_i32_u - local.get $7 - i64.extend_i32_s - i64.shl - local.get $13 - i64.add - local.set $19 - local.get $19 - local.get $5 - i64.le_u - if - global.get $~lib/util/number/_K - local.get $14 - i32.add - global.set $~lib/util/number/_K - block $~lib/util/number/grisuRound|inlined.0 - local.get $0 - local.set $20 - local.get $15 - local.set $18 - local.get $5 - local.set $24 - local.get $19 - local.set $23 - local.get $16 - local.get $14 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.get $7 - i64.extend_i32_s - i64.shl - local.set $22 - local.get $10 - local.set $21 - local.get $20 - local.get $18 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - i32.add - local.set $25 - local.get $25 - i32.load16_u - local.set $26 - block $break|2 - loop $continue|2 + local.set $25 + local.get $25 + i32.load16_u + local.set $26 + block $break|2 + loop $continue|2 + local.get $23 + local.get $21 + i64.lt_u + if (result i32) + local.get $24 local.get $23 + i64.sub + local.get $22 + i64.ge_u + else + i32.const 0 + end + if (result i32) + local.get $23 + local.get $22 + i64.add local.get $21 i64.lt_u if (result i32) - local.get $24 + i32.const 1 + else + local.get $21 local.get $23 i64.sub - local.get $22 - i64.ge_u - else - i32.const 0 - end - if (result i32) local.get $23 local.get $22 i64.add local.get $21 - i64.lt_u - if (result i32) - i32.const 1 - else - local.get $21 - local.get $23 - i64.sub - local.get $23 - local.get $22 - i64.add - local.get $21 - i64.sub - i64.gt_u - end - else - i32.const 0 - end - if - block - local.get $26 - i32.const 1 - i32.sub - local.set $26 - local.get $23 - local.get $22 - i64.add - local.set $23 - end - br $continue|2 + i64.sub + i64.gt_u end + else + i32.const 0 + end + if + local.get $26 + i32.const 1 + i32.sub + local.set $26 + local.get $23 + local.get $22 + i64.add + local.set $23 + br $continue|2 end end - local.get $25 - local.get $26 - i32.store16 end - local.get $15 - return + local.get $25 + local.get $26 + i32.store16 end + local.get $15 + return end br $continue|0 end @@ -4270,156 +5960,152 @@ loop $continue|3 i32.const 1 if - block - local.get $13 - i64.const 10 - i64.mul - local.set $13 - local.get $5 - i64.const 10 - i64.mul - local.set $5 - local.get $13 - local.get $7 - i64.extend_i32_s - i64.shr_u - local.set $19 + local.get $13 + i64.const 10 + i64.mul + local.set $13 + local.get $5 + i64.const 10 + i64.mul + local.set $5 + local.get $13 + local.get $7 + i64.extend_i32_s + i64.shr_u + local.set $19 + local.get $19 + local.get $15 + i64.extend_i32_s + i64.or + i64.const 0 + i64.ne + if + local.get $0 + block (result i32) + local.get $15 + local.tee $17 + i32.const 1 + i32.add + local.set $15 + local.get $17 + end + i32.const 1 + i32.shl + i32.add + i32.const 48 local.get $19 - local.get $15 - i64.extend_i32_s - i64.or - i64.const 0 - i64.ne - if + i32.wrap_i64 + i32.const 65535 + i32.and + i32.add + i32.store16 + end + local.get $13 + local.get $9 + i64.and + local.set $13 + local.get $14 + i32.const 1 + i32.sub + local.set $14 + local.get $13 + local.get $5 + i64.lt_u + if + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + local.get $10 + local.get $16 + i32.const 0 + local.get $14 + i32.sub + i32.const 2 + i32.shl + i32.add + i64.load32_u + i64.mul + local.set $10 + block $~lib/util/number/grisuRound|inlined.1 local.get $0 - block (result i32) - local.get $15 - local.tee $17 - i32.const 1 - i32.add - local.set $15 - local.get $17 - end + local.set $26 + local.get $15 + local.set $17 + local.get $5 + local.set $24 + local.get $13 + local.set $23 + local.get $8 + local.set $22 + local.get $10 + local.set $21 + local.get $26 + local.get $17 + i32.const 1 + i32.sub i32.const 1 i32.shl i32.add - i32.const 48 - local.get $19 - i32.wrap_i64 - i32.const 65535 - i32.and - i32.add - i32.store16 - end - local.get $13 - local.get $9 - i64.and - local.set $13 - local.get $14 - i32.const 1 - i32.sub - local.set $14 - local.get $13 - local.get $5 - i64.lt_u - if - global.get $~lib/util/number/_K - local.get $14 - i32.add - global.set $~lib/util/number/_K - local.get $10 - local.get $16 - i32.const 0 - local.get $14 - i32.sub - i32.const 2 - i32.shl - i32.add - i64.load32_u - i64.mul - local.set $10 - block $~lib/util/number/grisuRound|inlined.1 - local.get $0 - local.set $26 - local.get $15 - local.set $17 - local.get $5 - local.set $24 - local.get $13 - local.set $23 - local.get $8 - local.set $22 - local.get $10 - local.set $21 - local.get $26 - local.get $17 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - i32.add - local.set $25 - local.get $25 - i32.load16_u - local.set $18 - block $break|4 - loop $continue|4 + local.set $25 + local.get $25 + i32.load16_u + local.set $18 + block $break|4 + loop $continue|4 + local.get $23 + local.get $21 + i64.lt_u + if (result i32) + local.get $24 local.get $23 + i64.sub + local.get $22 + i64.ge_u + else + i32.const 0 + end + if (result i32) + local.get $23 + local.get $22 + i64.add local.get $21 i64.lt_u if (result i32) - local.get $24 + i32.const 1 + else + local.get $21 local.get $23 i64.sub - local.get $22 - i64.ge_u - else - i32.const 0 - end - if (result i32) local.get $23 local.get $22 i64.add local.get $21 - i64.lt_u - if (result i32) - i32.const 1 - else - local.get $21 - local.get $23 - i64.sub - local.get $23 - local.get $22 - i64.add - local.get $21 - i64.sub - i64.gt_u - end - else - i32.const 0 - end - if - block - local.get $18 - i32.const 1 - i32.sub - local.set $18 - local.get $23 - local.get $22 - i64.add - local.set $23 - end - br $continue|4 + i64.sub + i64.gt_u end + else + i32.const 0 + end + if + local.get $18 + i32.const 1 + i32.sub + local.set $18 + local.get $23 + local.get $22 + i64.add + local.set $23 + br $continue|4 end end - local.get $25 - local.get $18 - i32.store16 end - local.get $15 - return + local.get $25 + local.get $18 + i32.store16 end + local.get $15 + return end br $continue|3 end @@ -4427,7 +6113,7 @@ end local.get $15 ) - (func $~lib/util/number/prettify (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 72 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4757,7 +6443,7 @@ unreachable unreachable ) - (func $~lib/util/number/dtoa_core (; 62 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/util/number/dtoa_core (; 73 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 i32) (local $3 f64) (local $4 i32) @@ -4926,11 +6612,11 @@ i32.shl i32.sub global.set $~lib/util/number/_K - i32.const 4672 + i32.const 4896 local.get $13 call $~lib/array/Array#__unchecked_get global.set $~lib/util/number/_frc_pow - i32.const 4896 + i32.const 5120 local.get $13 call $~lib/array/Array#__unchecked_get global.set $~lib/util/number/_exp_pow @@ -5195,7 +6881,7 @@ local.get $2 i32.add ) - (func $~lib/string/String#substring (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#substring (; 74 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5210,8 +6896,8 @@ i32.eqz if i32.const 0 - i32.const 264 - i32.const 203 + i32.const 312 + i32.const 196 i32.const 4 call $~lib/builtins/abort unreachable @@ -5281,6 +6967,7 @@ i32.eqz if i32.const 120 + call $~lib/rt/purerc/__retain return end local.get $8 @@ -5297,10 +6984,12 @@ end if local.get $0 + call $~lib/rt/purerc/__retain return end local.get $3 - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $10 local.get $10 local.get $0 @@ -5309,44 +6998,46 @@ local.get $3 call $~lib/memory/memory.copy local.get $10 + call $~lib/rt/purerc/__retain + ) + (func $~lib/rt/tlsf/__free (; 75 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 560 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 561 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 i32.const 16 - call $~lib/util/runtime/register - ) - (func $~lib/util/runtime/discard (; 64 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - local.get $0 - global.get $~lib/memory/HEAP_BASE - i32.gt_u - i32.eqz - if - i32.const 0 - i32.const 184 - i32.const 115 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE i32.sub - local.set $1 - local.get $1 - i32.load - global.get $~lib/util/runtime/HEADER_MAGIC - i32.eq - i32.eqz - if - i32.const 0 - i32.const 184 - i32.const 117 - i32.const 4 - call $~lib/builtins/abort - unreachable - end - local.get $1 - call $~lib/memory/memory.free + call $~lib/rt/tlsf/freeBlock ) - (func $~lib/util/number/dtoa (; 65 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/util/number/dtoa (; 76 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -5354,7 +7045,8 @@ f64.const 0 f64.eq if - i32.const 3840 + i32.const 4064 + call $~lib/rt/purerc/__retain return end local.get $0 @@ -5364,39 +7056,176 @@ local.get $0 call $~lib/builtins/isNaN if - i32.const 3864 + i32.const 4088 + call $~lib/rt/purerc/__retain return end - i32.const 3888 - i32.const 3928 + i32.const 4112 + i32.const 4152 local.get $0 f64.const 0 f64.lt select + call $~lib/rt/purerc/__retain return end i32.const 28 i32.const 1 i32.shl - call $~lib/util/runtime/allocate + i32.const 16 + call $~lib/rt/tlsf/__alloc local.set $1 local.get $1 local.get $0 call $~lib/util/number/dtoa_core local.set $2 + local.get $2 + i32.const 28 + i32.eq + if + local.get $1 + call $~lib/rt/purerc/__retain + return + end local.get $1 i32.const 0 local.get $2 call $~lib/string/String#substring local.set $3 local.get $1 - call $~lib/util/runtime/discard + call $~lib/rt/tlsf/__free local.get $3 ) - (func $start:std/string (; 66 ;) (type $FUNCSIG$v) + (func $start:std/string (; 77 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i32) + (local $19 i32) + (local $20 i32) + (local $21 i32) + (local $22 i32) + (local $23 i32) + (local $24 i32) + (local $25 i32) + (local $26 i32) + (local $27 i32) + (local $28 i32) + (local $29 i32) + (local $30 i32) + (local $31 i32) + (local $32 i32) + (local $33 i32) + (local $34 i32) + (local $35 i32) + (local $36 i32) + (local $37 i32) + (local $38 i32) + (local $39 i32) + (local $40 i32) + (local $41 i32) + (local $42 i32) + (local $43 i32) + (local $44 i32) + (local $45 i32) + (local $46 i32) + (local $47 i32) + (local $48 i32) + (local $49 i32) + (local $50 i32) + (local $51 i32) + (local $52 i32) + (local $53 i32) + (local $54 i32) + (local $55 i32) + (local $56 i32) + (local $57 i32) + (local $58 i32) + (local $59 i32) + (local $60 i32) + (local $61 i32) + (local $62 i32) + (local $63 i32) + (local $64 i32) + (local $65 i32) + (local $66 i32) + (local $67 i32) + (local $68 i32) + (local $69 i32) + (local $70 i32) + (local $71 i32) + (local $72 i32) + (local $73 i32) + (local $74 i32) + (local $75 i32) + (local $76 i32) + (local $77 i32) + (local $78 i32) + (local $79 i32) + (local $80 i32) + (local $81 i32) + (local $82 i32) + (local $83 i32) + (local $84 i32) + (local $85 i32) + (local $86 i32) + (local $87 i32) + (local $88 i32) + (local $89 i32) + (local $90 i32) + (local $91 i32) + (local $92 i32) + (local $93 i32) + (local $94 i32) + (local $95 i32) + (local $96 i32) + (local $97 i32) + (local $98 i32) + (local $99 i32) + (local $100 i32) + (local $101 i32) + (local $102 i32) + (local $103 i32) + (local $104 i32) + (local $105 i32) + (local $106 i32) + (local $107 i32) + (local $108 i32) + (local $109 i32) + (local $110 i32) + (local $111 i32) + (local $112 i32) + (local $113 i32) + (local $114 i32) + (local $115 i32) + (local $116 i32) + (local $117 i32) + (local $118 i32) + (local $119 i32) + (local $120 i32) + (local $121 i32) + (local $122 i32) + (local $123 i32) + (local $124 i32) + (local $125 i32) + (local $126 i32) + (local $127 i32) + (local $128 i32) global.get $std/string/str i32.const 24 i32.eq @@ -5404,7 +7233,7 @@ if i32.const 0 i32.const 72 - i32.const 17 + i32.const 8 i32.const 0 call $~lib/builtins/abort unreachable @@ -5417,7 +7246,7 @@ if i32.const 0 i32.const 72 - i32.const 19 + i32.const 10 i32.const 0 call $~lib/builtins/abort unreachable @@ -5431,7 +7260,7 @@ if i32.const 0 i32.const 72 - i32.const 20 + i32.const 11 i32.const 0 call $~lib/builtins/abort unreachable @@ -5445,7 +7274,7 @@ if i32.const 0 i32.const 72 - i32.const 22 + i32.const 13 i32.const 0 call $~lib/builtins/abort unreachable @@ -5459,7 +7288,7 @@ if i32.const 0 i32.const 72 - i32.const 23 + i32.const 14 i32.const 0 call $~lib/builtins/abort unreachable @@ -5473,26 +7302,113 @@ if i32.const 0 i32.const 72 - i32.const 24 + i32.const 15 i32.const 0 call $~lib/builtins/abort unreachable end - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset i32.const 0 call $~lib/string/String.fromCharCode + local.tee $0 i32.const 136 call $~lib/string/String.__eq i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 17 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 54 + call $~lib/string/String.fromCharCode + local.tee $1 + i32.const 288 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 18 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 65536 + i32.const 54 + i32.add + call $~lib/string/String.fromCharCode + local.tee $2 + i32.const 288 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 19 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $~lib/string/String.fromCodePoint + local.tee $3 + i32.const 136 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 21 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 54 + call $~lib/string/String.fromCodePoint + local.tee $4 + i32.const 288 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 22 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 119558 + call $~lib/string/String.fromCodePoint + local.tee $5 + i32.eqz + if + i32.const 360 + i32.const 72 + i32.const 23 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $std/string/str + i32.const 384 + i32.const 0 + call $~lib/string/String#startsWith + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 25 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $std/string/str + i32.const 432 + global.get $~lib/string/String.MAX_LENGTH + call $~lib/string/String#endsWith + i32.eqz if i32.const 0 i32.const 72 @@ -5501,10 +7417,25 @@ call $~lib/builtins/abort unreachable end - i32.const 54 - call $~lib/string/String.fromCharCode - i32.const 240 - call $~lib/string/String.__eq + block $~lib/string/String#includes|inlined.0 (result i32) + global.get $std/string/str + local.set $8 + i32.const 464 + call $~lib/rt/purerc/__retain + local.set $7 + i32.const 0 + local.set $6 + local.get $7 + call $~lib/rt/purerc/__release + local.get $8 + local.get $7 + local.get $6 + call $~lib/string/String#indexOf + i32.const -1 + i32.ne + end + i32.const 0 + i32.ne i32.eqz if i32.const 0 @@ -5514,24 +7445,28 @@ call $~lib/builtins/abort unreachable end - i32.const 65536 - i32.const 54 - i32.add - call $~lib/string/String.fromCharCode - i32.const 240 + global.get $std/string/str + i32.const 0 + i32.const 488 + call $~lib/string/String#padStart + local.tee $6 + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 72 - i32.const 28 + i32.const 29 i32.const 0 call $~lib/builtins/abort unreachable end - i32.const 0 - call $~lib/string/String.fromCodePoint - i32.const 136 + global.get $std/string/str + i32.const 15 + i32.const 488 + call $~lib/string/String#padStart + local.tee $7 + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -5542,9 +7477,12 @@ call $~lib/builtins/abort unreachable end - i32.const 54 - call $~lib/string/String.fromCodePoint - i32.const 240 + i32.const 120 + i32.const 3 + i32.const 488 + call $~lib/string/String#padStart + local.tee $8 + i32.const 512 call $~lib/string/String.__eq i32.eqz if @@ -5555,21 +7493,45 @@ call $~lib/builtins/abort unreachable end - i32.const 119558 - call $~lib/string/String.fromCodePoint + i32.const 120 + i32.const 10 + i32.const 120 + call $~lib/string/String#padStart + local.tee $9 + i32.const 120 + call $~lib/string/String.__eq i32.eqz if - i32.const 312 + i32.const 0 i32.const 72 i32.const 32 i32.const 0 call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 336 - i32.const 0 - call $~lib/string/String#startsWith + i32.const 160 + i32.const 100 + i32.const 120 + call $~lib/string/String#padStart + local.tee $10 + i32.const 160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 33 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 536 + i32.const 5 + i32.const 488 + call $~lib/string/String#padStart + local.tee $11 + i32.const 560 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -5579,10 +7541,13 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 384 - global.get $~lib/string/String.MAX_LENGTH - call $~lib/string/String#endsWith + i32.const 536 + i32.const 6 + i32.const 592 + call $~lib/string/String#padStart + local.tee $12 + i32.const 616 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -5592,22 +7557,13 @@ call $~lib/builtins/abort unreachable end - block $~lib/string/String#includes|inlined.0 (result i32) - global.get $std/string/str - local.set $2 - i32.const 416 - local.set $1 - i32.const 0 - local.set $0 - local.get $2 - local.get $1 - local.get $0 - call $~lib/string/String#indexOf - i32.const -1 - i32.ne - end - i32.const 0 - i32.ne + i32.const 536 + i32.const 8 + i32.const 592 + call $~lib/string/String#padStart + local.tee $13 + i32.const 648 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -5619,8 +7575,9 @@ end global.get $std/string/str i32.const 0 - i32.const 440 - call $~lib/string/String#padStart + i32.const 488 + call $~lib/string/String#padEnd + local.tee $14 global.get $std/string/str call $~lib/string/String.__eq i32.eqz @@ -5634,8 +7591,9 @@ end global.get $std/string/str i32.const 15 - i32.const 440 - call $~lib/string/String#padStart + i32.const 488 + call $~lib/string/String#padEnd + local.tee $15 global.get $std/string/str call $~lib/string/String.__eq i32.eqz @@ -5649,9 +7607,10 @@ end i32.const 120 i32.const 3 - i32.const 440 - call $~lib/string/String#padStart - i32.const 464 + i32.const 488 + call $~lib/string/String#padEnd + local.tee $16 + i32.const 512 call $~lib/string/String.__eq i32.eqz if @@ -5665,7 +7624,8 @@ i32.const 120 i32.const 10 i32.const 120 - call $~lib/string/String#padStart + call $~lib/string/String#padEnd + local.tee $17 i32.const 120 call $~lib/string/String.__eq i32.eqz @@ -5680,7 +7640,8 @@ i32.const 160 i32.const 100 i32.const 120 - call $~lib/string/String#padStart + call $~lib/string/String#padEnd + local.tee $18 i32.const 160 call $~lib/string/String.__eq i32.eqz @@ -5692,11 +7653,12 @@ call $~lib/builtins/abort unreachable end - i32.const 488 + i32.const 536 i32.const 5 - i32.const 440 - call $~lib/string/String#padStart - i32.const 512 + i32.const 488 + call $~lib/string/String#padEnd + local.tee $19 + i32.const 680 call $~lib/string/String.__eq i32.eqz if @@ -5707,11 +7669,12 @@ call $~lib/builtins/abort unreachable end - i32.const 488 + i32.const 536 i32.const 6 - i32.const 544 - call $~lib/string/String#padStart - i32.const 568 + i32.const 536 + call $~lib/string/String#padEnd + local.tee $20 + i32.const 712 call $~lib/string/String.__eq i32.eqz if @@ -5722,11 +7685,12 @@ call $~lib/builtins/abort unreachable end - i32.const 488 + i32.const 536 i32.const 8 - i32.const 544 - call $~lib/string/String#padStart - i32.const 600 + i32.const 536 + call $~lib/string/String#padEnd + local.tee $21 + i32.const 744 call $~lib/string/String.__eq i32.eqz if @@ -5737,12 +7701,12 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str + i32.const 120 + i32.const 120 i32.const 0 - i32.const 440 - call $~lib/string/String#padEnd - global.get $std/string/str - call $~lib/string/String.__eq + call $~lib/string/String#indexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 @@ -5752,12 +7716,12 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 15 - i32.const 440 - call $~lib/string/String#padEnd - global.get $std/string/str - call $~lib/string/String.__eq + i32.const 120 + i32.const 384 + i32.const 0 + call $~lib/string/String#indexOf + i32.const -1 + i32.eq i32.eqz if i32.const 0 @@ -5767,12 +7731,12 @@ call $~lib/builtins/abort unreachable end - i32.const 120 - i32.const 3 - i32.const 440 - call $~lib/string/String#padEnd - i32.const 464 - call $~lib/string/String.__eq + i32.const 160 + i32.const 160 + i32.const 0 + call $~lib/string/String#indexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 @@ -5782,12 +7746,12 @@ call $~lib/builtins/abort unreachable end - i32.const 120 - i32.const 10 - i32.const 120 - call $~lib/string/String#padEnd - i32.const 120 - call $~lib/string/String.__eq + global.get $std/string/str + global.get $std/string/str + i32.const 0 + call $~lib/string/String#indexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 @@ -5797,12 +7761,12 @@ call $~lib/builtins/abort unreachable end - i32.const 160 - i32.const 100 + global.get $std/string/str i32.const 120 - call $~lib/string/String#padEnd - i32.const 160 - call $~lib/string/String.__eq + i32.const 0 + call $~lib/string/String#indexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 @@ -5812,12 +7776,12 @@ call $~lib/builtins/abort unreachable end - i32.const 488 - i32.const 5 - i32.const 440 - call $~lib/string/String#padEnd - i32.const 632 - call $~lib/string/String.__eq + global.get $std/string/str + i32.const 776 + i32.const 0 + call $~lib/string/String#indexOf + i32.const 2 + i32.eq i32.eqz if i32.const 0 @@ -5827,12 +7791,12 @@ call $~lib/builtins/abort unreachable end - i32.const 488 - i32.const 6 - i32.const 488 - call $~lib/string/String#padEnd - i32.const 664 - call $~lib/string/String.__eq + global.get $std/string/str + i32.const 800 + i32.const 0 + call $~lib/string/String#indexOf + i32.const -1 + i32.eq i32.eqz if i32.const 0 @@ -5842,12 +7806,12 @@ call $~lib/builtins/abort unreachable end - i32.const 488 - i32.const 8 - i32.const 488 - call $~lib/string/String#padEnd - i32.const 696 - call $~lib/string/String.__eq + global.get $std/string/str + i32.const 776 + i32.const 2 + call $~lib/string/String#indexOf + i32.const 2 + i32.eq i32.eqz if i32.const 0 @@ -5857,11 +7821,26 @@ call $~lib/builtins/abort unreachable end - i32.const 120 - i32.const 120 - i32.const 0 + global.get $std/string/str + i32.const 776 + i32.const 3 call $~lib/string/String#indexOf - i32.const 0 + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 55 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $std/string/str + i32.const 824 + i32.const -1 + call $~lib/string/String#indexOf + i32.const 2 i32.eq i32.eqz if @@ -5873,24 +7852,9 @@ unreachable end i32.const 120 - i32.const 336 - i32.const 0 - call $~lib/string/String#indexOf - i32.const -1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 57 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 160 - i32.const 160 - i32.const 0 - call $~lib/string/String#indexOf + i32.const 120 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf i32.const 0 i32.eq i32.eqz @@ -5902,11 +7866,11 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - global.get $std/string/str - i32.const 0 - call $~lib/string/String#indexOf - i32.const 0 + i32.const 120 + i32.const 384 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf + i32.const -1 i32.eq i32.eqz if @@ -5919,9 +7883,10 @@ end global.get $std/string/str i32.const 120 - i32.const 0 - call $~lib/string/String#indexOf - i32.const 0 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf + global.get $std/string/str + call $~lib/string/String#get:length i32.eq i32.eqz if @@ -5933,9 +7898,9 @@ unreachable end global.get $std/string/str - i32.const 728 - i32.const 0 - call $~lib/string/String#indexOf + i32.const 776 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf i32.const 2 i32.eq i32.eqz @@ -5948,9 +7913,9 @@ unreachable end global.get $std/string/str - i32.const 752 - i32.const 0 - call $~lib/string/String#indexOf + i32.const 800 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf i32.const -1 i32.eq i32.eqz @@ -5963,10 +7928,10 @@ unreachable end global.get $std/string/str - i32.const 728 - i32.const 2 - call $~lib/string/String#indexOf - i32.const 2 + i32.const 848 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf + i32.const 15 i32.eq i32.eqz if @@ -5978,10 +7943,10 @@ unreachable end global.get $std/string/str - i32.const 728 - i32.const 3 - call $~lib/string/String#indexOf - i32.const -1 + i32.const 776 + i32.const 2 + call $~lib/string/String#lastIndexOf + i32.const 2 i32.eq i32.eqz if @@ -5994,8 +7959,8 @@ end global.get $std/string/str i32.const 776 - i32.const -1 - call $~lib/string/String#indexOf + i32.const 3 + call $~lib/string/String#lastIndexOf i32.const 2 i32.eq i32.eqz @@ -6007,11 +7972,26 @@ call $~lib/builtins/abort unreachable end - i32.const 120 - i32.const 120 - global.get $~lib/builtins/i32.MAX_VALUE + global.get $std/string/str + i32.const 824 + i32.const -1 call $~lib/string/String#lastIndexOf + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 66 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $std/string/str + i32.const 872 i32.const 0 + call $~lib/string/String#lastIndexOf + i32.const -1 i32.eq i32.eqz if @@ -6022,11 +8002,11 @@ call $~lib/builtins/abort unreachable end - i32.const 120 - i32.const 336 - global.get $~lib/builtins/i32.MAX_VALUE + global.get $std/string/str + i32.const 384 + i32.const 0 call $~lib/string/String#lastIndexOf - i32.const -1 + i32.const 0 i32.eq i32.eqz if @@ -6037,28 +8017,11 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 120 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#lastIndexOf - global.get $std/string/str - call $~lib/string/String#get:length - i32.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 69 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/str - i32.const 728 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#lastIndexOf - i32.const 2 - i32.eq + i32.const 896 + i32.const 0 + call $~lib/string/parseInt + f64.const 0 + f64.eq i32.eqz if i32.const 0 @@ -6068,12 +8031,11 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 752 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#lastIndexOf - i32.const -1 - i32.eq + i32.const 920 + i32.const 0 + call $~lib/string/parseInt + f64.const 1 + f64.eq i32.eqz if i32.const 0 @@ -6083,12 +8045,11 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 800 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#lastIndexOf - i32.const 15 - i32.eq + i32.const 944 + i32.const 0 + call $~lib/string/parseInt + f64.const 5 + f64.eq i32.eqz if i32.const 0 @@ -6098,12 +8059,11 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 728 - i32.const 2 - call $~lib/string/String#lastIndexOf - i32.const 2 - i32.eq + i32.const 976 + i32.const 0 + call $~lib/string/parseInt + f64.const 455 + f64.eq i32.eqz if i32.const 0 @@ -6113,12 +8073,11 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 728 - i32.const 3 - call $~lib/string/String#lastIndexOf - i32.const 2 - i32.eq + i32.const 1008 + i32.const 0 + call $~lib/string/parseInt + f64.const 3855 + f64.eq i32.eqz if i32.const 0 @@ -6128,12 +8087,11 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 776 - i32.const -1 - call $~lib/string/String#lastIndexOf - i32.const -1 - i32.eq + i32.const 1040 + i32.const 0 + call $~lib/string/parseInt + f64.const 3855 + f64.eq i32.eqz if i32.const 0 @@ -6143,12 +8101,11 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 824 + i32.const 1072 i32.const 0 - call $~lib/string/String#lastIndexOf - i32.const -1 - i32.eq + call $~lib/string/parseInt + f64.const 11 + f64.eq i32.eqz if i32.const 0 @@ -6158,12 +8115,11 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 336 + i32.const 1096 i32.const 0 - call $~lib/string/String#lastIndexOf - i32.const 0 - i32.eq + call $~lib/string/parseInt + f64.const 1 + f64.eq i32.eqz if i32.const 0 @@ -6173,119 +8129,7 @@ call $~lib/builtins/abort unreachable end - i32.const 848 - i32.const 0 - call $~lib/string/parseInt - f64.const 0 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 83 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 872 - i32.const 0 - call $~lib/string/parseInt - f64.const 1 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 84 - i32.const 0 - call $~lib/builtins/abort - unreachable - end i32.const 896 - i32.const 0 - call $~lib/string/parseInt - f64.const 5 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 85 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 928 - i32.const 0 - call $~lib/string/parseInt - f64.const 455 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 86 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 960 - i32.const 0 - call $~lib/string/parseInt - f64.const 3855 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 87 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 992 - i32.const 0 - call $~lib/string/parseInt - f64.const 3855 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 88 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1024 - i32.const 0 - call $~lib/string/parseInt - f64.const 11 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 89 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1048 - i32.const 0 - call $~lib/string/parseInt - f64.const 1 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 90 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 848 call $~lib/string/parseFloat f64.const 0 f64.eq @@ -6293,12 +8137,12 @@ if i32.const 0 i32.const 72 - i32.const 92 + i32.const 79 i32.const 0 call $~lib/builtins/abort unreachable end - i32.const 872 + i32.const 920 call $~lib/string/parseFloat f64.const 1 f64.eq @@ -6306,33 +8150,7 @@ if i32.const 0 i32.const 72 - i32.const 93 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1072 - call $~lib/string/parseFloat - f64.const 0.1 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 94 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1096 - call $~lib/string/parseFloat - f64.const 0.25 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 95 + i32.const 80 i32.const 0 call $~lib/builtins/abort unreachable @@ -6345,39 +8163,73 @@ if i32.const 0 i32.const 72 - i32.const 96 + i32.const 81 i32.const 0 call $~lib/builtins/abort unreachable end - i32.const 160 - i32.const 1152 - call $~lib/string/String.__concat - global.set $std/string/c - global.get $std/string/c - i32.const 1176 - call $~lib/string/String.__eq + i32.const 1144 + call $~lib/string/parseFloat + f64.const 0.25 + f64.eq i32.eqz if i32.const 0 i32.const 72 - i32.const 99 + i32.const 82 i32.const 0 call $~lib/builtins/abort unreachable end - global.get $std/string/c - i32.const 160 - call $~lib/string/String.__ne + i32.const 1168 + call $~lib/string/parseFloat + f64.const 0.1 + f64.eq i32.eqz if i32.const 0 i32.const 72 - i32.const 100 + i32.const 83 i32.const 0 call $~lib/builtins/abort unreachable end + block + i32.const 160 + i32.const 1200 + call $~lib/string/String.__concat + local.tee $22 + call $~lib/rt/purerc/__retain + local.set $23 + local.get $23 + i32.const 1224 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 87 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $23 + i32.const 160 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 88 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $22 + call $~lib/rt/purerc/__release + local.get $23 + call $~lib/rt/purerc/__release + end i32.const 120 i32.const 120 call $~lib/string/String.__eq @@ -6385,7 +8237,7 @@ if i32.const 0 i32.const 72 - i32.const 101 + i32.const 90 i32.const 0 call $~lib/builtins/abort unreachable @@ -6397,7 +8249,7 @@ if i32.const 0 i32.const 72 - i32.const 102 + i32.const 91 i32.const 0 call $~lib/builtins/abort unreachable @@ -6409,19 +8261,19 @@ if i32.const 0 i32.const 72 - i32.const 103 + i32.const 92 i32.const 0 call $~lib/builtins/abort unreachable end i32.const 160 - i32.const 1152 + i32.const 1200 call $~lib/string/String.__ne i32.eqz if i32.const 0 i32.const 72 - i32.const 104 + i32.const 93 i32.const 0 call $~lib/builtins/abort unreachable @@ -6433,31 +8285,7 @@ if i32.const 0 i32.const 72 - i32.const 105 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1200 - i32.const 1224 - call $~lib/string/String.__ne - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 106 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1200 - i32.const 1200 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 107 + i32.const 94 i32.const 0 call $~lib/builtins/abort unreachable @@ -6469,15 +8297,149 @@ if i32.const 0 i32.const 72 - i32.const 108 + i32.const 95 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1248 + i32.const 1248 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 96 i32.const 0 call $~lib/builtins/abort unreachable end i32.const 1296 - i32.const 1328 + i32.const 1320 call $~lib/string/String.__ne i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 97 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1344 + i32.const 1376 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 98 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1408 + i32.const 1408 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 99 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1408 + i32.const 1440 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 100 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1472 + i32.const 1512 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 101 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1200 + i32.const 160 + call $~lib/string/String.__gt + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 103 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1552 + i32.const 160 + call $~lib/string/String.__gt + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 104 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1552 + i32.const 1576 + call $~lib/string/String.__gte + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 105 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1552 + i32.const 1224 + call $~lib/string/String.__gt + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 106 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1552 + i32.const 1224 + call $~lib/string/String.__lt + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 107 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1200 + global.get $std/string/nullStr + call $~lib/string/String.__lt + i32.eqz + i32.eqz if i32.const 0 i32.const 72 @@ -6486,9 +8448,10 @@ call $~lib/builtins/abort unreachable end - i32.const 1360 - i32.const 1360 - call $~lib/string/String.__eq + global.get $std/string/nullStr + i32.const 1200 + call $~lib/string/String.__lt + i32.eqz i32.eqz if i32.const 0 @@ -6498,21 +8461,9 @@ call $~lib/builtins/abort unreachable end - i32.const 1360 - i32.const 1392 - call $~lib/string/String.__ne - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 111 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1424 - i32.const 1464 - call $~lib/string/String.__ne + i32.const 536 + i32.const 120 + call $~lib/string/String.__gt i32.eqz if i32.const 0 @@ -6522,9 +8473,21 @@ call $~lib/builtins/abort unreachable end - i32.const 1152 - i32.const 160 - call $~lib/string/String.__gt + i32.const 120 + i32.const 536 + call $~lib/string/String.__lt + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 113 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 536 + i32.const 120 + call $~lib/string/String.__gte i32.eqz if i32.const 0 @@ -6534,9 +8497,9 @@ call $~lib/builtins/abort unreachable end - i32.const 1504 - i32.const 160 - call $~lib/string/String.__gt + i32.const 120 + i32.const 536 + call $~lib/string/String.__lte i32.eqz if i32.const 0 @@ -6546,9 +8509,10 @@ call $~lib/builtins/abort unreachable end - i32.const 1504 - i32.const 1528 - call $~lib/string/String.__gte + i32.const 536 + i32.const 120 + call $~lib/string/String.__lt + i32.eqz i32.eqz if i32.const 0 @@ -6558,10 +8522,11 @@ call $~lib/builtins/abort unreachable end - i32.const 1504 - i32.const 1176 + i32.const 120 + i32.const 536 call $~lib/string/String.__gt i32.eqz + i32.eqz if i32.const 0 i32.const 72 @@ -6570,8 +8535,8 @@ call $~lib/builtins/abort unreachable end - i32.const 1504 - i32.const 1176 + i32.const 120 + i32.const 120 call $~lib/string/String.__lt i32.eqz i32.eqz @@ -6583,11 +8548,23 @@ call $~lib/builtins/abort unreachable end - i32.const 1152 - global.get $std/string/nullStr - call $~lib/string/String.__lt + i32.const 120 + i32.const 120 + call $~lib/string/String.__gt i32.eqz i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 119 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 120 + i32.const 120 + call $~lib/string/String.__gte + i32.eqz if i32.const 0 i32.const 72 @@ -6596,10 +8573,9 @@ call $~lib/builtins/abort unreachable end - global.get $std/string/nullStr - i32.const 1152 - call $~lib/string/String.__lt - i32.eqz + i32.const 120 + i32.const 120 + call $~lib/string/String.__lte i32.eqz if i32.const 0 @@ -6609,84 +8585,47 @@ call $~lib/builtins/abort unreachable end - i32.const 488 - i32.const 120 - call $~lib/string/String.__gt - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 123 - i32.const 0 - call $~lib/builtins/abort - unreachable + block + i32.const 65377 + call $~lib/string/String.fromCodePoint + local.set $23 + i32.const 55296 + call $~lib/string/String.fromCodePoint + local.tee $22 + i32.const 56322 + call $~lib/string/String.fromCodePoint + local.tee $24 + call $~lib/string/String.__concat + local.tee $25 + call $~lib/rt/purerc/__retain + local.set $26 + local.get $23 + local.get $26 + call $~lib/string/String.__gt + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 126 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $23 + call $~lib/rt/purerc/__release + local.get $22 + call $~lib/rt/purerc/__release + local.get $24 + call $~lib/rt/purerc/__release + local.get $25 + call $~lib/rt/purerc/__release + local.get $26 + call $~lib/rt/purerc/__release end - i32.const 120 - i32.const 488 - call $~lib/string/String.__lt - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 124 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 488 - i32.const 120 - call $~lib/string/String.__gte - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 125 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - i32.const 488 - call $~lib/string/String.__lte - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 126 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 488 - i32.const 120 - call $~lib/string/String.__lt - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 127 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - i32.const 488 - call $~lib/string/String.__gt - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 128 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - i32.const 120 - call $~lib/string/String.__lt - i32.eqz + i32.const 592 + call $~lib/string/String#get:length + i32.const 3 + i32.eq i32.eqz if i32.const 0 @@ -6697,21 +8636,11 @@ unreachable end i32.const 120 + i32.const 100 + call $~lib/string/String#repeat + local.tee $26 i32.const 120 - call $~lib/string/String.__gt - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 130 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - i32.const 120 - call $~lib/string/String.__gte + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -6721,9 +8650,12 @@ call $~lib/builtins/abort unreachable end + i32.const 160 + i32.const 0 + call $~lib/string/String#repeat + local.tee $25 i32.const 120 - i32.const 120 - call $~lib/string/String.__lte + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -6733,18 +8665,57 @@ call $~lib/builtins/abort unreachable end - i32.const 65377 - call $~lib/string/String.fromCodePoint - global.set $std/string/a - i32.const 55296 - call $~lib/string/String.fromCodePoint - i32.const 56322 - call $~lib/string/String.fromCodePoint - call $~lib/string/String.__concat - global.set $std/string/b - global.get $std/string/a - global.get $std/string/b - call $~lib/string/String.__gt + i32.const 160 + i32.const 1 + call $~lib/string/String#repeat + local.tee $24 + i32.const 160 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 133 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 160 + i32.const 2 + call $~lib/string/String#repeat + local.tee $22 + i32.const 1576 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 134 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 160 + i32.const 3 + call $~lib/string/String#repeat + local.tee $23 + i32.const 1648 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 135 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1224 + i32.const 4 + call $~lib/string/String#repeat + local.tee $27 + i32.const 1672 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -6754,10 +8725,27 @@ call $~lib/builtins/abort unreachable end - i32.const 544 - call $~lib/string/String#get:length - i32.const 3 - i32.eq + i32.const 160 + i32.const 5 + call $~lib/string/String#repeat + local.tee $28 + i32.const 1704 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 137 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 160 + i32.const 6 + call $~lib/string/String#repeat + local.tee $29 + i32.const 1736 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -6767,52 +8755,31 @@ call $~lib/builtins/abort unreachable end - i32.const 120 - i32.const 100 + i32.const 160 + i32.const 7 call $~lib/string/String#repeat - i32.const 120 + local.tee $30 + i32.const 1768 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 72 - i32.const 140 + i32.const 139 i32.const 0 call $~lib/builtins/abort unreachable end - i32.const 160 + i32.const 1800 + global.get $std/string/str + call $~lib/rt/purerc/__retainRelease + global.set $std/string/str + global.get $std/string/str i32.const 0 - call $~lib/string/String#repeat - i32.const 120 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 141 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 160 - i32.const 1 - call $~lib/string/String#repeat - i32.const 160 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 142 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 160 - i32.const 2 - call $~lib/string/String#repeat - i32.const 1528 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#slice + local.tee $31 + i32.const 1800 call $~lib/string/String.__eq i32.eqz if @@ -6823,10 +8790,12 @@ call $~lib/builtins/abort unreachable end - i32.const 160 - i32.const 3 - call $~lib/string/String#repeat - i32.const 1552 + global.get $std/string/str + i32.const -1 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#slice + local.tee $32 + i32.const 1848 call $~lib/string/String.__eq i32.eqz if @@ -6837,10 +8806,12 @@ call $~lib/builtins/abort unreachable end - i32.const 1176 - i32.const 4 - call $~lib/string/String#repeat - i32.const 1576 + global.get $std/string/str + i32.const -5 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#slice + local.tee $33 + i32.const 1872 call $~lib/string/String.__eq i32.eqz if @@ -6851,10 +8822,12 @@ call $~lib/builtins/abort unreachable end - i32.const 160 - i32.const 5 - call $~lib/string/String#repeat - i32.const 1608 + global.get $std/string/str + i32.const 2 + i32.const 7 + call $~lib/string/String#slice + local.tee $34 + i32.const 1904 call $~lib/string/String.__eq i32.eqz if @@ -6865,10 +8838,12 @@ call $~lib/builtins/abort unreachable end - i32.const 160 - i32.const 6 - call $~lib/string/String#repeat - i32.const 1640 + global.get $std/string/str + i32.const -11 + i32.const -6 + call $~lib/string/String#slice + local.tee $35 + i32.const 1936 call $~lib/string/String.__eq i32.eqz if @@ -6879,10 +8854,12 @@ call $~lib/builtins/abort unreachable end - i32.const 160 - i32.const 7 - call $~lib/string/String#repeat - i32.const 1672 + global.get $std/string/str + i32.const 4 + i32.const 3 + call $~lib/string/String#slice + local.tee $36 + i32.const 120 call $~lib/string/String.__eq i32.eqz if @@ -6893,617 +8870,239 @@ call $~lib/builtins/abort unreachable end - i32.const 1704 - global.set $std/string/str - global.get $std/string/str - i32.const 0 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#slice - i32.const 1704 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 152 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/str - i32.const -1 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#slice - i32.const 1752 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 153 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/str - i32.const -5 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#slice - i32.const 1776 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 154 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/str - i32.const 2 - i32.const 7 - call $~lib/string/String#slice - i32.const 1808 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 155 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/str - i32.const -11 - i32.const -6 - call $~lib/string/String#slice - i32.const 1840 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 156 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $std/string/str - i32.const 4 - i32.const 3 - call $~lib/string/String#slice - i32.const 120 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 157 - i32.const 0 - call $~lib/builtins/abort - unreachable - end global.get $std/string/str i32.const 0 i32.const -1 call $~lib/string/String#slice - i32.const 1872 + local.tee $37 + i32.const 1968 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 72 - i32.const 158 + i32.const 149 i32.const 0 call $~lib/builtins/abort unreachable end - i32.const 120 - i32.const 0 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 1 - i32.eq - if (result i32) - global.get $std/string/sa + block i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 120 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 163 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - i32.const 120 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 165 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 120 - i32.const 728 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 1 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 120 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 167 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1968 - i32.const 2000 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 1 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1968 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 169 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1968 - i32.const 728 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 3 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa + local.set $38 + block (result i32) + local.get $38 + call $~lib/rt/purerc/__release + i32.const 120 + i32.const 0 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else + i32.eq + if (result i32) + local.get $38 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 120 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + else + i32.const 0 + end i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else + i32.ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 155 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $38 + call $~lib/rt/purerc/__release + i32.const 120 + i32.const 120 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 171 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 2048 - i32.const 2080 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 3 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 157 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $38 + call $~lib/rt/purerc/__release + i32.const 120 + i32.const 776 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else + i32.eq + if (result i32) + local.get $38 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 120 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + else + i32.const 0 + end i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 173 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 2104 - i32.const 728 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 4 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa + i32.ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 159 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $38 + call $~lib/rt/purerc/__release + i32.const 2344 + i32.const 2376 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else + i32.eq + if (result i32) + local.get $38 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 2344 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + else + i32.const 0 + end i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 120 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa + i32.ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 161 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $38 + call $~lib/rt/purerc/__release + i32.const 2344 + i32.const 776 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length i32.const 3 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else + i32.eq + if (result i32) + local.get $38 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 160 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + else + i32.const 0 + end i32.const 0 + i32.ne + if (result i32) + local.get $38 + i32.const 1 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 1200 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + else + i32.const 0 + end + i32.const 0 + i32.ne + if (result i32) + local.get $38 + i32.const 2 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 2400 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + else + i32.const 0 + end + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 163 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $38 + call $~lib/rt/purerc/__release end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 175 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 2136 - i32.const 728 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 4 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 120 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 3 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 177 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 2168 - i32.const 728 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 4 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 3 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 120 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 179 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 488 - i32.const 120 - global.get $~lib/builtins/i32.MAX_VALUE - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 3 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 181 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 488 - i32.const 120 i32.const 0 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 183 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 488 - i32.const 120 - i32.const 1 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 1 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 185 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1968 - i32.const 728 - i32.const 1 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 1 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 187 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 488 - i32.const 120 - i32.const 4 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 3 - i32.eq - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else - i32.const 0 - end + call $~lib/util/number/itoa32 + local.tee $38 + i32.const 896 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -7513,42 +9112,25 @@ call $~lib/builtins/abort unreachable end - i32.const 488 - i32.const 120 - i32.const -1 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 3 - i32.eq - if (result i32) - global.get $std/string/sa + i32.const 1 + call $~lib/util/number/itoa32 + local.tee $39 + i32.const 920 + call $~lib/string/String.__eq + i32.eqz + if i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else + i32.const 72 + i32.const 190 i32.const 0 + call $~lib/builtins/abort + unreachable end + i32.const 8 + call $~lib/util/number/itoa32 + local.tee $40 + i32.const 2872 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -7558,42 +9140,25 @@ call $~lib/builtins/abort unreachable end - i32.const 1968 - i32.const 728 - i32.const -1 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - call $~lib/array/Array<~lib/string/String>#get:length - i32.const 3 - i32.eq - if (result i32) - global.get $std/string/sa + i32.const 123 + call $~lib/util/number/itoa32 + local.tee $41 + i32.const 592 + call $~lib/string/String.__eq + i32.eqz + if i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 160 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1152 - call $~lib/string/String.__eq - else - i32.const 0 - end - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 2024 - call $~lib/string/String.__eq - else + i32.const 72 + i32.const 192 i32.const 0 + call $~lib/builtins/abort + unreachable end + i32.const -1000 + call $~lib/util/number/itoa32 + local.tee $42 + i32.const 2896 + call $~lib/string/String.__eq i32.eqz if i32.const 0 @@ -7603,9 +9168,24 @@ call $~lib/builtins/abort unreachable end - i32.const 0 + i32.const 1234 call $~lib/util/number/itoa32 - i32.const 848 + local.tee $43 + i32.const 2928 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 194 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 12345 + call $~lib/util/number/itoa32 + local.tee $44 + i32.const 2952 call $~lib/string/String.__eq i32.eqz if @@ -7616,9 +9196,10 @@ call $~lib/builtins/abort unreachable end - i32.const 1 + i32.const 123456 call $~lib/util/number/itoa32 - i32.const 872 + local.tee $45 + i32.const 2984 call $~lib/string/String.__eq i32.eqz if @@ -7629,9 +9210,10 @@ call $~lib/builtins/abort unreachable end - i32.const 8 + i32.const 1111111 call $~lib/util/number/itoa32 - i32.const 2648 + local.tee $46 + i32.const 3016 call $~lib/string/String.__eq i32.eqz if @@ -7642,9 +9224,10 @@ call $~lib/builtins/abort unreachable end - i32.const 123 + i32.const 1234567 call $~lib/util/number/itoa32 - i32.const 544 + local.tee $47 + i32.const 3048 call $~lib/string/String.__eq i32.eqz if @@ -7655,9 +9238,10 @@ call $~lib/builtins/abort unreachable end - i32.const -1000 + i32.const 2147483646 call $~lib/util/number/itoa32 - i32.const 2672 + local.tee $48 + i32.const 3080 call $~lib/string/String.__eq i32.eqz if @@ -7668,9 +9252,10 @@ call $~lib/builtins/abort unreachable end - i32.const 1234 + i32.const 2147483647 call $~lib/util/number/itoa32 - i32.const 2704 + local.tee $49 + i32.const 3120 call $~lib/string/String.__eq i32.eqz if @@ -7681,9 +9266,10 @@ call $~lib/builtins/abort unreachable end - i32.const 12345 + i32.const -2147483648 call $~lib/util/number/itoa32 - i32.const 2728 + local.tee $50 + i32.const 3160 call $~lib/string/String.__eq i32.eqz if @@ -7694,9 +9280,10 @@ call $~lib/builtins/abort unreachable end - i32.const 123456 + i32.const -1 call $~lib/util/number/itoa32 - i32.const 2760 + local.tee $51 + i32.const 3200 call $~lib/string/String.__eq i32.eqz if @@ -7707,22 +9294,10 @@ call $~lib/builtins/abort unreachable end - i32.const 1111111 - call $~lib/util/number/itoa32 - i32.const 2792 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 203 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i32.const 1234567 - call $~lib/util/number/itoa32 - i32.const 2824 + i32.const 0 + call $~lib/util/number/utoa32 + local.tee $52 + i32.const 896 call $~lib/string/String.__eq i32.eqz if @@ -7733,9 +9308,10 @@ call $~lib/builtins/abort unreachable end - i32.const 2147483646 - call $~lib/util/number/itoa32 - i32.const 2856 + i32.const 1000 + call $~lib/util/number/utoa32 + local.tee $53 + i32.const 3224 call $~lib/string/String.__eq i32.eqz if @@ -7747,8 +9323,9 @@ unreachable end i32.const 2147483647 - call $~lib/util/number/itoa32 - i32.const 2896 + call $~lib/util/number/utoa32 + local.tee $54 + i32.const 3120 call $~lib/string/String.__eq i32.eqz if @@ -7760,8 +9337,9 @@ unreachable end i32.const -2147483648 - call $~lib/util/number/itoa32 - i32.const 2936 + call $~lib/util/number/utoa32 + local.tee $55 + i32.const 3248 call $~lib/string/String.__eq i32.eqz if @@ -7772,9 +9350,10 @@ call $~lib/builtins/abort unreachable end - i32.const -1 - call $~lib/util/number/itoa32 - i32.const 2976 + global.get $~lib/builtins/u32.MAX_VALUE + call $~lib/util/number/utoa32 + local.tee $56 + i32.const 3288 call $~lib/string/String.__eq i32.eqz if @@ -7785,9 +9364,10 @@ call $~lib/builtins/abort unreachable end - i32.const 0 - call $~lib/util/number/utoa32 - i32.const 848 + i64.const 0 + call $~lib/util/number/utoa64 + local.tee $57 + i32.const 896 call $~lib/string/String.__eq i32.eqz if @@ -7798,9 +9378,10 @@ call $~lib/builtins/abort unreachable end - i32.const 1000 - call $~lib/util/number/utoa32 - i32.const 3000 + i64.const 1234 + call $~lib/util/number/utoa64 + local.tee $58 + i32.const 2928 call $~lib/string/String.__eq i32.eqz if @@ -7811,9 +9392,10 @@ call $~lib/builtins/abort unreachable end - i32.const 2147483647 - call $~lib/util/number/utoa32 - i32.const 2896 + i64.const 99999999 + call $~lib/util/number/utoa64 + local.tee $59 + i32.const 3328 call $~lib/string/String.__eq i32.eqz if @@ -7824,9 +9406,10 @@ call $~lib/builtins/abort unreachable end - i32.const -2147483648 - call $~lib/util/number/utoa32 - i32.const 3024 + i64.const 100000000 + call $~lib/util/number/utoa64 + local.tee $60 + i32.const 3360 call $~lib/string/String.__eq i32.eqz if @@ -7837,9 +9420,10 @@ call $~lib/builtins/abort unreachable end - global.get $~lib/builtins/u32.MAX_VALUE - call $~lib/util/number/utoa32 - i32.const 3064 + i64.const 4294967295 + call $~lib/util/number/utoa64 + local.tee $61 + i32.const 3288 call $~lib/string/String.__eq i32.eqz if @@ -7850,9 +9434,24 @@ call $~lib/builtins/abort unreachable end - i64.const 0 + i64.const 68719476735 call $~lib/util/number/utoa64 - i32.const 848 + local.tee $62 + i32.const 3400 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 215 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i64.const 868719476735 + call $~lib/util/number/utoa64 + local.tee $63 + i32.const 3440 call $~lib/string/String.__eq i32.eqz if @@ -7863,9 +9462,10 @@ call $~lib/builtins/abort unreachable end - i64.const 1234 + i64.const 999868719476735 call $~lib/util/number/utoa64 - i32.const 2704 + local.tee $64 + i32.const 3480 call $~lib/string/String.__eq i32.eqz if @@ -7876,9 +9476,10 @@ call $~lib/builtins/abort unreachable end - i64.const 99999999 + i64.const 9999868719476735 call $~lib/util/number/utoa64 - i32.const 3104 + local.tee $65 + i32.const 3528 call $~lib/string/String.__eq i32.eqz if @@ -7889,9 +9490,10 @@ call $~lib/builtins/abort unreachable end - i64.const 100000000 + i64.const 19999868719476735 call $~lib/util/number/utoa64 - i32.const 3136 + local.tee $66 + i32.const 3576 call $~lib/string/String.__eq i32.eqz if @@ -7902,9 +9504,10 @@ call $~lib/builtins/abort unreachable end - i64.const 4294967295 + global.get $~lib/builtins/u64.MAX_VALUE call $~lib/util/number/utoa64 - i32.const 3064 + local.tee $67 + i32.const 3632 call $~lib/string/String.__eq i32.eqz if @@ -7915,22 +9518,10 @@ call $~lib/builtins/abort unreachable end - i64.const 68719476735 - call $~lib/util/number/utoa64 - i32.const 3176 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 221 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i64.const 868719476735 - call $~lib/util/number/utoa64 - i32.const 3216 + i64.const 0 + call $~lib/util/number/itoa64 + local.tee $68 + i32.const 896 call $~lib/string/String.__eq i32.eqz if @@ -7941,9 +9532,10 @@ call $~lib/builtins/abort unreachable end - i64.const 999868719476735 - call $~lib/util/number/utoa64 - i32.const 3256 + i64.const -1234 + call $~lib/util/number/itoa64 + local.tee $69 + i32.const 3688 call $~lib/string/String.__eq i32.eqz if @@ -7954,9 +9546,10 @@ call $~lib/builtins/abort unreachable end - i64.const 9999868719476735 - call $~lib/util/number/utoa64 - i32.const 3304 + i64.const 4294967295 + call $~lib/util/number/itoa64 + local.tee $70 + i32.const 3288 call $~lib/string/String.__eq i32.eqz if @@ -7967,9 +9560,10 @@ call $~lib/builtins/abort unreachable end - i64.const 19999868719476735 - call $~lib/util/number/utoa64 - i32.const 3352 + i64.const -4294967295 + call $~lib/util/number/itoa64 + local.tee $71 + i32.const 3720 call $~lib/string/String.__eq i32.eqz if @@ -7980,9 +9574,10 @@ call $~lib/builtins/abort unreachable end - global.get $~lib/builtins/u64.MAX_VALUE - call $~lib/util/number/utoa64 - i32.const 3408 + i64.const 68719476735 + call $~lib/util/number/itoa64 + local.tee $72 + i32.const 3400 call $~lib/string/String.__eq i32.eqz if @@ -7993,9 +9588,24 @@ call $~lib/builtins/abort unreachable end - i64.const 0 + i64.const -68719476735 call $~lib/util/number/itoa64 - i32.const 848 + local.tee $73 + i32.const 3760 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 227 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i64.const -868719476735 + call $~lib/util/number/itoa64 + local.tee $74 + i32.const 3800 call $~lib/string/String.__eq i32.eqz if @@ -8006,9 +9616,10 @@ call $~lib/builtins/abort unreachable end - i64.const -1234 + i64.const -999868719476735 call $~lib/util/number/itoa64 - i32.const 3464 + local.tee $75 + i32.const 3848 call $~lib/string/String.__eq i32.eqz if @@ -8019,9 +9630,10 @@ call $~lib/builtins/abort unreachable end - i64.const 4294967295 + i64.const -19999868719476735 call $~lib/util/number/itoa64 - i32.const 3064 + local.tee $76 + i32.const 3896 call $~lib/string/String.__eq i32.eqz if @@ -8032,9 +9644,10 @@ call $~lib/builtins/abort unreachable end - i64.const -4294967295 + global.get $~lib/builtins/i64.MAX_VALUE call $~lib/util/number/itoa64 - i32.const 3496 + local.tee $77 + i32.const 3952 call $~lib/string/String.__eq i32.eqz if @@ -8045,9 +9658,10 @@ call $~lib/builtins/abort unreachable end - i64.const 68719476735 + global.get $~lib/builtins/i64.MIN_VALUE call $~lib/util/number/itoa64 - i32.const 3176 + local.tee $78 + i32.const 4008 call $~lib/string/String.__eq i32.eqz if @@ -8058,35 +9672,10 @@ call $~lib/builtins/abort unreachable end - i64.const -68719476735 - call $~lib/util/number/itoa64 - i32.const 3536 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 233 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i64.const -868719476735 - call $~lib/util/number/itoa64 - i32.const 3576 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 234 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - i64.const -999868719476735 - call $~lib/util/number/itoa64 - i32.const 3624 + f64.const 0 + call $~lib/util/number/dtoa + local.tee $79 + i32.const 4064 call $~lib/string/String.__eq i32.eqz if @@ -8097,9 +9686,10 @@ call $~lib/builtins/abort unreachable end - i64.const -19999868719476735 - call $~lib/util/number/itoa64 - i32.const 3672 + f64.const -0 + call $~lib/util/number/dtoa + local.tee $80 + i32.const 4064 call $~lib/string/String.__eq i32.eqz if @@ -8110,9 +9700,10 @@ call $~lib/builtins/abort unreachable end - global.get $~lib/builtins/i64.MAX_VALUE - call $~lib/util/number/itoa64 - i32.const 3728 + f64.const nan:0x8000000000000 + call $~lib/util/number/dtoa + local.tee $81 + i32.const 4088 call $~lib/string/String.__eq i32.eqz if @@ -8123,9 +9714,10 @@ call $~lib/builtins/abort unreachable end - global.get $~lib/builtins/i64.MIN_VALUE - call $~lib/util/number/itoa64 - i32.const 3784 + f64.const inf + call $~lib/util/number/dtoa + local.tee $82 + i32.const 4152 call $~lib/string/String.__eq i32.eqz if @@ -8136,9 +9728,40 @@ call $~lib/builtins/abort unreachable end - f64.const 0 + f64.const inf + f64.neg call $~lib/util/number/dtoa - i32.const 3840 + local.tee $83 + i32.const 4112 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 239 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/builtins/f64.EPSILON + call $~lib/util/number/dtoa + local.tee $84 + i32.const 5240 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 240 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/builtins/f64.EPSILON + f64.neg + call $~lib/util/number/dtoa + local.tee $85 + i32.const 5304 call $~lib/string/String.__eq i32.eqz if @@ -8149,9 +9772,10 @@ call $~lib/builtins/abort unreachable end - f64.const -0 + global.get $~lib/builtins/f64.MAX_VALUE call $~lib/util/number/dtoa - i32.const 3840 + local.tee $86 + i32.const 5368 call $~lib/string/String.__eq i32.eqz if @@ -8162,9 +9786,11 @@ call $~lib/builtins/abort unreachable end - f64.const nan:0x8000000000000 + global.get $~lib/builtins/f64.MAX_VALUE + f64.neg call $~lib/util/number/dtoa - i32.const 3864 + local.tee $87 + i32.const 5432 call $~lib/string/String.__eq i32.eqz if @@ -8175,9 +9801,10 @@ call $~lib/builtins/abort unreachable end - f64.const inf + f64.const 4185580496821356722454785e274 call $~lib/util/number/dtoa - i32.const 3928 + local.tee $88 + i32.const 5496 call $~lib/string/String.__eq i32.eqz if @@ -8188,10 +9815,10 @@ call $~lib/builtins/abort unreachable end - f64.const inf - f64.neg + f64.const 2.2250738585072014e-308 call $~lib/util/number/dtoa - i32.const 3888 + local.tee $89 + i32.const 5560 call $~lib/string/String.__eq i32.eqz if @@ -8202,36 +9829,10 @@ call $~lib/builtins/abort unreachable end - global.get $~lib/builtins/f64.EPSILON + f64.const 4.940656e-318 call $~lib/util/number/dtoa - i32.const 5016 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 246 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/builtins/f64.EPSILON - f64.neg - call $~lib/util/number/dtoa - i32.const 5080 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 247 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/builtins/f64.MAX_VALUE - call $~lib/util/number/dtoa - i32.const 5144 + local.tee $90 + i32.const 5624 call $~lib/string/String.__eq i32.eqz if @@ -8242,10 +9843,10 @@ call $~lib/builtins/abort unreachable end - global.get $~lib/builtins/f64.MAX_VALUE - f64.neg + f64.const 9060801153433600 call $~lib/util/number/dtoa - i32.const 5208 + local.tee $91 + i32.const 5672 call $~lib/string/String.__eq i32.eqz if @@ -8256,9 +9857,10 @@ call $~lib/builtins/abort unreachable end - f64.const 4185580496821356722454785e274 + f64.const 4708356024711512064 call $~lib/util/number/dtoa - i32.const 5272 + local.tee $92 + i32.const 5728 call $~lib/string/String.__eq i32.eqz if @@ -8269,9 +9871,10 @@ call $~lib/builtins/abort unreachable end - f64.const 2.2250738585072014e-308 + f64.const 9409340012568248320 call $~lib/util/number/dtoa - i32.const 5336 + local.tee $93 + i32.const 5792 call $~lib/string/String.__eq i32.eqz if @@ -8282,61 +9885,24 @@ call $~lib/builtins/abort unreachable end - f64.const 4.940656e-318 - call $~lib/util/number/dtoa - i32.const 5400 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 254 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 9060801153433600 - call $~lib/util/number/dtoa - i32.const 5448 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 255 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 4708356024711512064 - call $~lib/util/number/dtoa - i32.const 5504 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 256 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 9409340012568248320 - call $~lib/util/number/dtoa - i32.const 5568 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 257 - i32.const 0 - call $~lib/builtins/abort - unreachable - end f64.const 5e-324 call $~lib/util/number/dtoa - i32.const 5632 + local.tee $94 + i32.const 5856 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 252 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1 + call $~lib/util/number/dtoa + local.tee $95 + i32.const 5888 call $~lib/string/String.__eq i32.eqz if @@ -8347,9 +9913,66 @@ call $~lib/builtins/abort unreachable end - f64.const 1 + f64.const 0.1 call $~lib/util/number/dtoa - i32.const 5664 + local.tee $96 + i32.const 1120 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 259 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -1 + call $~lib/util/number/dtoa + local.tee $97 + i32.const 5912 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 260 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -0.1 + call $~lib/util/number/dtoa + local.tee $98 + i32.const 5936 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 261 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1e6 + call $~lib/util/number/dtoa + local.tee $99 + i32.const 5960 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 263 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1e-06 + call $~lib/util/number/dtoa + local.tee $100 + i32.const 6000 call $~lib/string/String.__eq i32.eqz if @@ -8360,9 +9983,10 @@ call $~lib/builtins/abort unreachable end - f64.const 0.1 + f64.const -1e6 call $~lib/util/number/dtoa - i32.const 1072 + local.tee $101 + i32.const 6032 call $~lib/string/String.__eq i32.eqz if @@ -8373,9 +9997,10 @@ call $~lib/builtins/abort unreachable end - f64.const -1 + f64.const -1e-06 call $~lib/util/number/dtoa - i32.const 5688 + local.tee $102 + i32.const 6072 call $~lib/string/String.__eq i32.eqz if @@ -8386,9 +10011,10 @@ call $~lib/builtins/abort unreachable end - f64.const -0.1 + f64.const 1e7 call $~lib/util/number/dtoa - i32.const 5712 + local.tee $103 + i32.const 6112 call $~lib/string/String.__eq i32.eqz if @@ -8399,22 +10025,24 @@ call $~lib/builtins/abort unreachable end - f64.const 1e6 + f64.const 1e-07 call $~lib/util/number/dtoa - i32.const 5736 + local.tee $104 + i32.const 6152 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 72 - i32.const 269 + i32.const 268 i32.const 0 call $~lib/builtins/abort unreachable end - f64.const 1e-06 + f64.const 1.e+308 call $~lib/util/number/dtoa - i32.const 5776 + local.tee $105 + i32.const 6176 call $~lib/string/String.__eq i32.eqz if @@ -8425,9 +10053,10 @@ call $~lib/builtins/abort unreachable end - f64.const -1e6 + f64.const -1.e+308 call $~lib/util/number/dtoa - i32.const 5808 + local.tee $106 + i32.const 6208 call $~lib/string/String.__eq i32.eqz if @@ -8438,9 +10067,10 @@ call $~lib/builtins/abort unreachable end - f64.const -1e-06 + f64.const inf call $~lib/util/number/dtoa - i32.const 5848 + local.tee $107 + i32.const 4152 call $~lib/string/String.__eq i32.eqz if @@ -8451,9 +10081,10 @@ call $~lib/builtins/abort unreachable end - f64.const 1e7 + f64.const -inf call $~lib/util/number/dtoa - i32.const 5888 + local.tee $108 + i32.const 4112 call $~lib/string/String.__eq i32.eqz if @@ -8464,9 +10095,10 @@ call $~lib/builtins/abort unreachable end - f64.const 1e-07 + f64.const 1e-308 call $~lib/util/number/dtoa - i32.const 5928 + local.tee $109 + i32.const 6240 call $~lib/string/String.__eq i32.eqz if @@ -8477,9 +10109,24 @@ call $~lib/builtins/abort unreachable end - f64.const 1.e+308 + f64.const -1e-308 call $~lib/util/number/dtoa - i32.const 5952 + local.tee $110 + i32.const 6272 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 275 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1e-323 + call $~lib/util/number/dtoa + local.tee $111 + i32.const 6304 call $~lib/string/String.__eq i32.eqz if @@ -8490,9 +10137,10 @@ call $~lib/builtins/abort unreachable end - f64.const -1.e+308 + f64.const -1e-323 call $~lib/util/number/dtoa - i32.const 5984 + local.tee $112 + i32.const 6336 call $~lib/string/String.__eq i32.eqz if @@ -8503,9 +10151,10 @@ call $~lib/builtins/abort unreachable end - f64.const inf + f64.const 0 call $~lib/util/number/dtoa - i32.const 3928 + local.tee $113 + i32.const 4064 call $~lib/string/String.__eq i32.eqz if @@ -8516,22 +10165,10 @@ call $~lib/builtins/abort unreachable end - f64.const -inf + f64.const 4294967272 call $~lib/util/number/dtoa - i32.const 3888 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 279 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 1e-308 - call $~lib/util/number/dtoa - i32.const 6016 + local.tee $114 + i32.const 6368 call $~lib/string/String.__eq i32.eqz if @@ -8542,9 +10179,10 @@ call $~lib/builtins/abort unreachable end - f64.const -1e-308 + f64.const 1.2312145673456234e-08 call $~lib/util/number/dtoa - i32.const 6048 + local.tee $115 + i32.const 6408 call $~lib/string/String.__eq i32.eqz if @@ -8555,22 +10193,10 @@ call $~lib/builtins/abort unreachable end - f64.const 1e-323 + f64.const 555555555.5555556 call $~lib/util/number/dtoa - i32.const 6080 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 282 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const -1e-323 - call $~lib/util/number/dtoa - i32.const 6112 + local.tee $116 + i32.const 6472 call $~lib/string/String.__eq i32.eqz if @@ -8581,9 +10207,10 @@ call $~lib/builtins/abort unreachable end - f64.const 0 + f64.const 0.9999999999999999 call $~lib/util/number/dtoa - i32.const 3840 + local.tee $117 + i32.const 6528 call $~lib/string/String.__eq i32.eqz if @@ -8594,9 +10221,24 @@ call $~lib/builtins/abort unreachable end - f64.const 4294967272 + f64.const 1 call $~lib/util/number/dtoa - i32.const 6144 + local.tee $118 + i32.const 5888 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 285 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 12.34 + call $~lib/util/number/dtoa + local.tee $119 + i32.const 6584 call $~lib/string/String.__eq i32.eqz if @@ -8607,22 +10249,26 @@ call $~lib/builtins/abort unreachable end - f64.const 1.2312145673456234e-08 + f64.const 1 + f64.const 3 + f64.div call $~lib/util/number/dtoa - i32.const 6184 + local.tee $120 + i32.const 6616 call $~lib/string/String.__eq i32.eqz if i32.const 0 i32.const 72 - i32.const 287 + i32.const 288 i32.const 0 call $~lib/builtins/abort unreachable end - f64.const 555555555.5555556 + f64.const 1234e17 call $~lib/util/number/dtoa - i32.const 6248 + local.tee $121 + i32.const 6672 call $~lib/string/String.__eq i32.eqz if @@ -8633,9 +10279,10 @@ call $~lib/builtins/abort unreachable end - f64.const 0.9999999999999999 + f64.const 1234e18 call $~lib/util/number/dtoa - i32.const 6304 + local.tee $122 + i32.const 6736 call $~lib/string/String.__eq i32.eqz if @@ -8646,9 +10293,10 @@ call $~lib/builtins/abort unreachable end - f64.const 1 + f64.const 2.71828 call $~lib/util/number/dtoa - i32.const 5664 + local.tee $123 + i32.const 6776 call $~lib/string/String.__eq i32.eqz if @@ -8659,9 +10307,10 @@ call $~lib/builtins/abort unreachable end - f64.const 12.34 + f64.const 0.0271828 call $~lib/util/number/dtoa - i32.const 6360 + local.tee $124 + i32.const 6808 call $~lib/string/String.__eq i32.eqz if @@ -8672,11 +10321,24 @@ call $~lib/builtins/abort unreachable end - f64.const 1 - f64.const 3 - f64.div + f64.const 271.828 call $~lib/util/number/dtoa - i32.const 6392 + local.tee $125 + i32.const 6848 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 293 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1.1e+128 + call $~lib/util/number/dtoa + local.tee $126 + i32.const 6880 call $~lib/string/String.__eq i32.eqz if @@ -8687,9 +10349,10 @@ call $~lib/builtins/abort unreachable end - f64.const 1234e17 + f64.const 1.1e-64 call $~lib/util/number/dtoa - i32.const 6448 + local.tee $127 + i32.const 6912 call $~lib/string/String.__eq i32.eqz if @@ -8700,9 +10363,10 @@ call $~lib/builtins/abort unreachable end - f64.const 1234e18 + f64.const 0.000035689 call $~lib/util/number/dtoa - i32.const 6512 + local.tee $128 + i32.const 6944 call $~lib/string/String.__eq i32.eqz if @@ -8713,319 +10377,749 @@ call $~lib/builtins/abort unreachable end - f64.const 2.71828 - call $~lib/util/number/dtoa - i32.const 6552 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 297 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 0.0271828 - call $~lib/util/number/dtoa - i32.const 6584 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 298 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 271.828 - call $~lib/util/number/dtoa - i32.const 6624 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 299 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 1.1e+128 - call $~lib/util/number/dtoa - i32.const 6656 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 300 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 1.1e-64 - call $~lib/util/number/dtoa - i32.const 6688 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 301 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - f64.const 0.000035689 - call $~lib/util/number/dtoa - i32.const 6720 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 302 - i32.const 0 - call $~lib/builtins/abort - unreachable - end - ) - (func $std/string/getString (; 67 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 global.get $std/string/str + call $~lib/rt/purerc/__retainRelease + global.set $std/string/str + local.get $0 + call $~lib/rt/purerc/__release + local.get $1 + call $~lib/rt/purerc/__release + local.get $2 + call $~lib/rt/purerc/__release + local.get $3 + call $~lib/rt/purerc/__release + local.get $4 + call $~lib/rt/purerc/__release + local.get $5 + call $~lib/rt/purerc/__release + local.get $6 + call $~lib/rt/purerc/__release + local.get $7 + call $~lib/rt/purerc/__release + local.get $8 + call $~lib/rt/purerc/__release + local.get $9 + call $~lib/rt/purerc/__release + local.get $10 + call $~lib/rt/purerc/__release + local.get $11 + call $~lib/rt/purerc/__release + local.get $12 + call $~lib/rt/purerc/__release + local.get $13 + call $~lib/rt/purerc/__release + local.get $14 + call $~lib/rt/purerc/__release + local.get $15 + call $~lib/rt/purerc/__release + local.get $16 + call $~lib/rt/purerc/__release + local.get $17 + call $~lib/rt/purerc/__release + local.get $18 + call $~lib/rt/purerc/__release + local.get $19 + call $~lib/rt/purerc/__release + local.get $20 + call $~lib/rt/purerc/__release + local.get $21 + call $~lib/rt/purerc/__release + local.get $22 + call $~lib/rt/purerc/__release + local.get $23 + call $~lib/rt/purerc/__release + local.get $24 + call $~lib/rt/purerc/__release + local.get $25 + call $~lib/rt/purerc/__release + local.get $26 + call $~lib/rt/purerc/__release + local.get $27 + call $~lib/rt/purerc/__release + local.get $28 + call $~lib/rt/purerc/__release + local.get $29 + call $~lib/rt/purerc/__release + local.get $30 + call $~lib/rt/purerc/__release + local.get $31 + call $~lib/rt/purerc/__release + local.get $32 + call $~lib/rt/purerc/__release + local.get $33 + call $~lib/rt/purerc/__release + local.get $34 + call $~lib/rt/purerc/__release + local.get $35 + call $~lib/rt/purerc/__release + local.get $36 + call $~lib/rt/purerc/__release + local.get $37 + call $~lib/rt/purerc/__release + local.get $38 + call $~lib/rt/purerc/__release + local.get $39 + call $~lib/rt/purerc/__release + local.get $40 + call $~lib/rt/purerc/__release + local.get $41 + call $~lib/rt/purerc/__release + local.get $42 + call $~lib/rt/purerc/__release + local.get $43 + call $~lib/rt/purerc/__release + local.get $44 + call $~lib/rt/purerc/__release + local.get $45 + call $~lib/rt/purerc/__release + local.get $46 + call $~lib/rt/purerc/__release + local.get $47 + call $~lib/rt/purerc/__release + local.get $48 + call $~lib/rt/purerc/__release + local.get $49 + call $~lib/rt/purerc/__release + local.get $50 + call $~lib/rt/purerc/__release + local.get $51 + call $~lib/rt/purerc/__release + local.get $52 + call $~lib/rt/purerc/__release + local.get $53 + call $~lib/rt/purerc/__release + local.get $54 + call $~lib/rt/purerc/__release + local.get $55 + call $~lib/rt/purerc/__release + local.get $56 + call $~lib/rt/purerc/__release + local.get $57 + call $~lib/rt/purerc/__release + local.get $58 + call $~lib/rt/purerc/__release + local.get $59 + call $~lib/rt/purerc/__release + local.get $60 + call $~lib/rt/purerc/__release + local.get $61 + call $~lib/rt/purerc/__release + local.get $62 + call $~lib/rt/purerc/__release + local.get $63 + call $~lib/rt/purerc/__release + local.get $64 + call $~lib/rt/purerc/__release + local.get $65 + call $~lib/rt/purerc/__release + local.get $66 + call $~lib/rt/purerc/__release + local.get $67 + call $~lib/rt/purerc/__release + local.get $68 + call $~lib/rt/purerc/__release + local.get $69 + call $~lib/rt/purerc/__release + local.get $70 + call $~lib/rt/purerc/__release + local.get $71 + call $~lib/rt/purerc/__release + local.get $72 + call $~lib/rt/purerc/__release + local.get $73 + call $~lib/rt/purerc/__release + local.get $74 + call $~lib/rt/purerc/__release + local.get $75 + call $~lib/rt/purerc/__release + local.get $76 + call $~lib/rt/purerc/__release + local.get $77 + call $~lib/rt/purerc/__release + local.get $78 + call $~lib/rt/purerc/__release + local.get $79 + call $~lib/rt/purerc/__release + local.get $80 + call $~lib/rt/purerc/__release + local.get $81 + call $~lib/rt/purerc/__release + local.get $82 + call $~lib/rt/purerc/__release + local.get $83 + call $~lib/rt/purerc/__release + local.get $84 + call $~lib/rt/purerc/__release + local.get $85 + call $~lib/rt/purerc/__release + local.get $86 + call $~lib/rt/purerc/__release + local.get $87 + call $~lib/rt/purerc/__release + local.get $88 + call $~lib/rt/purerc/__release + local.get $89 + call $~lib/rt/purerc/__release + local.get $90 + call $~lib/rt/purerc/__release + local.get $91 + call $~lib/rt/purerc/__release + local.get $92 + call $~lib/rt/purerc/__release + local.get $93 + call $~lib/rt/purerc/__release + local.get $94 + call $~lib/rt/purerc/__release + local.get $95 + call $~lib/rt/purerc/__release + local.get $96 + call $~lib/rt/purerc/__release + local.get $97 + call $~lib/rt/purerc/__release + local.get $98 + call $~lib/rt/purerc/__release + local.get $99 + call $~lib/rt/purerc/__release + local.get $100 + call $~lib/rt/purerc/__release + local.get $101 + call $~lib/rt/purerc/__release + local.get $102 + call $~lib/rt/purerc/__release + local.get $103 + call $~lib/rt/purerc/__release + local.get $104 + call $~lib/rt/purerc/__release + local.get $105 + call $~lib/rt/purerc/__release + local.get $106 + call $~lib/rt/purerc/__release + local.get $107 + call $~lib/rt/purerc/__release + local.get $108 + call $~lib/rt/purerc/__release + local.get $109 + call $~lib/rt/purerc/__release + local.get $110 + call $~lib/rt/purerc/__release + local.get $111 + call $~lib/rt/purerc/__release + local.get $112 + call $~lib/rt/purerc/__release + local.get $113 + call $~lib/rt/purerc/__release + local.get $114 + call $~lib/rt/purerc/__release + local.get $115 + call $~lib/rt/purerc/__release + local.get $116 + call $~lib/rt/purerc/__release + local.get $117 + call $~lib/rt/purerc/__release + local.get $118 + call $~lib/rt/purerc/__release + local.get $119 + call $~lib/rt/purerc/__release + local.get $120 + call $~lib/rt/purerc/__release + local.get $121 + call $~lib/rt/purerc/__release + local.get $122 + call $~lib/rt/purerc/__release + local.get $123 + call $~lib/rt/purerc/__release + local.get $124 + call $~lib/rt/purerc/__release + local.get $125 + call $~lib/rt/purerc/__release + local.get $126 + call $~lib/rt/purerc/__release + local.get $127 + call $~lib/rt/purerc/__release + local.get $128 + call $~lib/rt/purerc/__release ) - (func $~lib/runtime/runtime.instanceof (; 68 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/string/getString (; 78 ;) (type $FUNCSIG$i) (result i32) + global.get $std/string/str + call $~lib/rt/purerc/__retain + ) + (func $start (; 79 ;) (type $FUNCSIG$v) + call $start:std/string + ) + (func $~lib/rt/purerc/__release (; 80 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/builtins/HEAP_BASE + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/purerc/decrement + end + ) + (func $~lib/rt/purerc/markGray (; 81 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/builtins/__visit_members + end + ) + (func $~lib/rt/purerc/scanBlack (; 82 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/builtins/__visit_members + ) + (func $~lib/rt/purerc/scan (; 83 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/purerc/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/builtins/__visit_members + end + end + ) + (func $~lib/rt/purerc/collectWhite (; 84 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/builtins/__visit_members + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/purerc/__visit (; 85 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.sub - i32.load - local.set $2 - global.get $~lib/runtime/RTTI_BASE - local.set $3 - local.get $2 - if (result i32) - local.get $2 - local.get $3 - i32.load - i32.le_u - else - i32.const 0 - end + global.get $~lib/builtins/HEAP_BASE + i32.lt_u if - loop $continue|0 - local.get $2 - local.get $1 - i32.eq - if - i32.const 1 - return + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/purerc/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 2016 + i32.const 74 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/purerc/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/purerc/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 2016 + i32.const 85 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/purerc/scanBlack + end + br $break|0 + unreachable + end + unreachable end - local.get $3 - local.get $2 - i32.const 8 - i32.mul - i32.add - i32.load offset=4 - local.tee $2 - br_if $continue|0 + block + local.get $2 + call $~lib/rt/purerc/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 2016 + i32.const 96 + i32.const 24 + call $~lib/builtins/abort + unreachable end end - i32.const 0 ) - (func $~lib/runtime/runtime.flags (; 69 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - global.get $~lib/runtime/RTTI_BASE - local.set $1 - local.get $0 - i32.eqz - if (result i32) - i32.const 1 - else - local.get $0 - local.get $1 - i32.load - i32.gt_u - end - if (result i32) - unreachable - else - local.get $1 - local.get $0 - i32.const 8 - i32.mul - i32.add - i32.load - end - ) - (func $~lib/runtime/runtime.newObject (; 70 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - call $~lib/util/runtime/allocate - local.get $1 - call $~lib/util/runtime/register - ) - (func $~lib/runtime/runtime.newString (; 71 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 1 - i32.shl - i32.const 16 - call $~lib/runtime/runtime.newObject - ) - (func $~lib/runtime/runtime.newArrayBuffer (; 72 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 15 - call $~lib/runtime/runtime.newObject - ) - (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 73 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - global.get $~lib/util/runtime/HEADER_SIZE - i32.sub - i32.load offset=4 - ) - (func $~lib/runtime/runtime.newArray (; 74 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 86 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) local.get $0 - call $~lib/runtime/runtime.flags + i32.load offset=4 local.set $2 local.get $2 - i32.const 16 - i32.div_u - i32.const 31 - i32.and - local.set $3 - local.get $1 - i32.eqz - if - i32.const 0 - local.tee $4 - call $~lib/runtime/runtime.newArrayBuffer - local.set $1 - else - local.get $1 - call $~lib/arraybuffer/ArrayBuffer#get:byteLength - local.set $4 - end local.get $0 - i32.const 16 - call $~lib/runtime/runtime.newObject - local.set $5 - local.get $5 - local.tee $6 - local.get $1 - local.tee $7 - local.get $6 - i32.load - local.tee $8 - i32.ne - if (result i32) - local.get $8 - if - local.get $8 - local.get $6 - call $~lib/collector/dummy/__ref_unlink - end - local.get $7 - local.get $6 - call $~lib/collector/dummy/__ref_link - local.get $7 - else - local.get $7 - end - i32.store - local.get $5 - local.get $1 - i32.store offset=4 - local.get $5 - local.get $4 - i32.store offset=8 - local.get $5 - local.get $4 - local.get $3 - i32.shr_u - i32.store offset=12 - local.get $2 - i32.const 1024 - i32.and - if - local.get $1 - local.set $6 - local.get $6 - local.get $4 - i32.add - local.set $8 - block $break|0 - loop $continue|0 - local.get $6 - local.get $8 - i32.lt_u + i32.load offset=8 + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 if - block - local.get $6 - i32.load - local.set $7 - local.get $7 - if - local.get $7 - local.get $5 - call $~lib/collector/dummy/__ref_link - end - local.get $6 - i32.const 4 - i32.add - local.set $6 - end - br $continue|0 + local.get $4 + local.get $1 + call $~lib/rt/purerc/__visit end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 end end end - local.get $5 ) - (func $~lib/runtime/Root#constructor (; 75 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 0 - call $~lib/util/runtime/allocate - i32.const 22 - call $~lib/util/runtime/register - local.set $0 - end - local.get $0 - ) - (func $~lib/runtime/runtime.retain (; 76 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - global.get $~lib/runtime/ROOT - call $~lib/collector/dummy/__ref_link - ) - (func $~lib/runtime/runtime.release (; 77 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - global.get $~lib/runtime/ROOT - call $~lib/collector/dummy/__ref_unlink - ) - (func $~lib/collector/dummy/__ref_collect (; 78 ;) (type $FUNCSIG$v) + (func $~lib/array/Array#__visit_impl (; 87 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/runtime/runtime.collect (; 79 ;) (type $FUNCSIG$v) - call $~lib/collector/dummy/__ref_collect + (func $~lib/array/Array#__visit_impl (; 88 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop ) - (func $~lib/runtime/runtime#constructor (; 80 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#__visit_impl (; 89 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 90 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/builtins/__visit_members (; 91 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $block$16$break + block + end + block $switch$1$leave + block $switch$1$case$23 + block $switch$1$case$22 + block $switch$1$case$21 + block $switch$1$case$20 + block $switch$1$case$19 + block $switch$1$case$16 + block $switch$1$case$3 + block $switch$1$default + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$default $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$3 $switch$1$case$16 $switch$1$case$3 $switch$1$case$3 $switch$1$case$19 $switch$1$case$20 $switch$1$case$21 $switch$1$case$22 $switch$1$case$23 $switch$1$default + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + br $block$16$break + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$16$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + end + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/purerc/__visit + end + return + unreachable + end + unreachable + unreachable + end unreachable ) - (func $start (; 81 ;) (type $FUNCSIG$v) - call $start:std/string - i32.const 0 - call $~lib/runtime/Root#constructor - global.set $~lib/runtime/ROOT - ) - (func $null (; 82 ;) (type $FUNCSIG$v) + (func $null (; 92 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/typedarray.ts b/tests/compiler/std/typedarray.ts index 912ca7f0..a53bff9b 100644 --- a/tests/compiler/std/typedarray.ts +++ b/tests/compiler/std/typedarray.ts @@ -193,9 +193,9 @@ assert(sub32.byteLength == 3 * sizeof()); assert(isInt32ArrayEqual(sub32, [0, 0, 0])); assert(isInt32ArrayEqual(arr32, [1, 0, 0, 0, 2])); -import { BLOCK_OVERHEAD } from "rt/common"; +import { BLOCK_MAXSIZE } from "rt/common"; -const MAX_F64LENGTH = BLOCK_OVERHEAD >> alignof(); +const MAX_F64LENGTH = BLOCK_MAXSIZE >> alignof(); new Float64Array(MAX_F64LENGTH); // 1GB // new Float64Array(MAX_F64 + 1); // throws diff --git a/tests/compiler/switch.optimized.wat b/tests/compiler/switch.optimized.wat index 884f3adc..83b701f9 100644 --- a/tests/compiler/switch.optimized.wat +++ b/tests/compiler/switch.optimized.wat @@ -4,66 +4,174 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\12") - (data (i32.const 24) "s\00w\00i\00t\00c\00h\00.\00t\00s") + (data (i32.const 8) "\12\00\00\00\01\00\00\00\10\00\00\00\12\00\00\00s\00w\00i\00t\00c\00h\00.\00t\00s\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) (export "memory" (memory $0)) (start $start) (func $switch/doSwitch (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - block $case4|0 - block $case2|0 - local.get $0 - i32.const 1 - i32.ne - if - local.get $0 - i32.eqz - br_if $case2|0 - local.get $0 - i32.const 2 - i32.eq - br_if $case4|0 - local.get $0 - i32.const 3 - i32.eq - br_if $case4|0 - br $case2|0 + (local $1 i32) + block $break|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $0 + local.set $1 + local.get $1 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $1 + i32.const 0 + i32.eq + br_if $case1|0 + local.get $1 + i32.const 2 + i32.eq + br_if $case3|0 + local.get $1 + i32.const 3 + i32.eq + br_if $case4|0 + br $case2|0 + end + i32.const 1 + return + end + end + i32.const 0 + return end - i32.const 1 - return end - i32.const 0 + i32.const 23 return + unreachable end - i32.const 23 + unreachable + unreachable ) (func $switch/doSwitchDefaultOmitted (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) block $break|0 block $case2|0 - local.get $0 - i32.const 1 - i32.ne - if - local.get $0 - i32.const 2 - i32.eq - br_if $case2|0 - local.get $0 - i32.const 3 - i32.eq - br_if $case2|0 - br $break|0 + block $case1|0 + block $case0|0 + local.get $0 + local.set $1 + local.get $1 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $1 + i32.const 3 + i32.eq + br_if $case2|0 + br $break|0 + end + i32.const 1 + return end - i32.const 1 - return end i32.const 23 return end i32.const 0 ) - (func $start:switch (; 3 ;) (type $FUNCSIG$v) + (func $switch/doSwitchBreakCase (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + block $break|0 + block $case1|0 + block $case0|0 + local.get $0 + local.set $1 + local.get $1 + i32.const 1 + i32.eq + br_if $case0|0 + br $case1|0 + end + br $break|0 + end + i32.const 2 + return + end + i32.const 1 + ) + (func $switch/doSwitchBreakDefault (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + block $break|0 + block $case1|0 + block $case0|0 + local.get $0 + local.set $1 + local.get $1 + i32.const 1 + i32.eq + br_if $case0|0 + br $case1|0 + end + i32.const 1 + return + end + br $break|0 + end + i32.const 2 + ) + (func $switch/doSwitchFallThroughCase (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + block $break|0 + block $case1|0 + block $case0|0 + local.get $0 + local.set $1 + local.get $1 + i32.const 1 + i32.eq + br_if $case1|0 + br $case0|0 + end + i32.const 2 + return + end + end + i32.const 1 + ) + (func $switch/doSwitchFallThroughDefault (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + block $break|0 + block $case1|0 + block $case0|0 + local.get $0 + local.set $1 + local.get $1 + i32.const 1 + i32.eq + br_if $case0|0 + br $case1|0 + end + i32.const 1 + return + end + end + i32.const 2 + ) + (func $switch/doSwitchEmpty (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + drop + i32.const 2 + ) + (func $start:switch (; 8 ;) (type $FUNCSIG$v) i32.const 0 call $switch/doSwitch + i32.const 0 + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -75,7 +183,8 @@ i32.const 1 call $switch/doSwitch i32.const 1 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -87,7 +196,8 @@ i32.const 2 call $switch/doSwitch i32.const 23 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -99,7 +209,8 @@ i32.const 3 call $switch/doSwitch i32.const 23 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -110,6 +221,9 @@ end i32.const 4 call $switch/doSwitch + i32.const 0 + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -120,6 +234,9 @@ end i32.const 0 call $switch/doSwitch + i32.const 0 + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -131,7 +248,8 @@ i32.const 1 call $switch/doSwitch i32.const 1 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -143,7 +261,8 @@ i32.const 2 call $switch/doSwitch i32.const 23 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -155,7 +274,8 @@ i32.const 3 call $switch/doSwitch i32.const 23 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -166,6 +286,9 @@ end i32.const 4 call $switch/doSwitch + i32.const 0 + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -176,6 +299,9 @@ end i32.const 0 call $switch/doSwitchDefaultOmitted + i32.const 0 + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -187,7 +313,8 @@ i32.const 1 call $switch/doSwitchDefaultOmitted i32.const 1 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -199,7 +326,8 @@ i32.const 2 call $switch/doSwitchDefaultOmitted i32.const 23 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -211,7 +339,8 @@ i32.const 3 call $switch/doSwitchDefaultOmitted i32.const 23 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -222,6 +351,9 @@ end i32.const 4 call $switch/doSwitchDefaultOmitted + i32.const 0 + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -230,11 +362,205 @@ call $~lib/builtins/abort unreachable end + i32.const 0 + call $switch/doSwitchBreakCase + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 51 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $switch/doSwitchBreakCase + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 52 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $switch/doSwitchBreakCase + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 53 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $switch/doSwitchBreakDefault + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 62 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $switch/doSwitchBreakDefault + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 63 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $switch/doSwitchBreakDefault + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 64 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $switch/doSwitchFallThroughCase + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 73 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $switch/doSwitchFallThroughCase + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 74 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $switch/doSwitchFallThroughCase + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 75 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $switch/doSwitchFallThroughDefault + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 84 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $switch/doSwitchFallThroughDefault + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 85 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $switch/doSwitchFallThroughDefault + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 86 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $switch/doSwitchEmpty + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 92 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $switch/doSwitchEmpty + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 93 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $switch/doSwitchEmpty + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 94 + i32.const 0 + call $~lib/builtins/abort + unreachable + end ) - (func $start (; 4 ;) (type $FUNCSIG$v) + (func $start (; 9 ;) (type $FUNCSIG$v) call $start:switch ) - (func $null (; 5 ;) (type $FUNCSIG$v) - nop + (func $null (; 10 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/switch.untouched.wat b/tests/compiler/switch.untouched.wat index 653916ee..83b701f9 100644 --- a/tests/compiler/switch.untouched.wat +++ b/tests/compiler/switch.untouched.wat @@ -4,7 +4,7 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\12\00\00\00\00\00\00\00\00\00\00\00s\00w\00i\00t\00c\00h\00.\00t\00s\00") + (data (i32.const 8) "\12\00\00\00\01\00\00\00\10\00\00\00\12\00\00\00s\00w\00i\00t\00c\00h\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) diff --git a/tests/compiler/wasi.optimized.wat b/tests/compiler/wasi.optimized.wat index e31c1f81..be16b879 100644 --- a/tests/compiler/wasi.optimized.wat +++ b/tests/compiler/wasi.optimized.wat @@ -1,16 +1,545 @@ (module + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\0e") - (data (i32.const 24) "w\00a\00s\00i\00.\00t\00s") + (data (i32.const 8) "\0e\00\00\00\01\00\00\00\10\00\00\00\0e\00\00\00w\00a\00s\00i\00.\00t\00s\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/common/target/Target.WASM32 i32 (i32.const 0)) + (global $~lib/common/target/Target.WASM64 i32 (i32.const 1)) + (global $~lib/common/target/Target.JS i32 (i32.const 2)) + (global $~lib/ASC_TARGET i32 (i32.const 0)) (global $wasi/sig (mut i32) (i32.const 1)) (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $FUNCSIG$v) + (func $start:wasi (; 1 ;) (type $FUNCSIG$v) + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 4 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 5 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 16 + i32.const 16 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 6 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 20 + i32.const 20 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 7 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 24 + i32.const 24 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 8 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 10 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 11 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 10 + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 12 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 16 + i32.const 16 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 13 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 24 + i32.const 24 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 14 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 32 + i32.const 32 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 15 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 17 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 18 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 19 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 16 + i32.const 16 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 20 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 24 + i32.const 24 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 21 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 23 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 24 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 16 + i32.const 16 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 25 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 20 + i32.const 20 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 26 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 24 + i32.const 24 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 27 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 32 + i32.const 32 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 28 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 40 + i32.const 40 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 29 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 48 + i32.const 48 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 30 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 56 + i32.const 56 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 31 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 33 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + block + i32.const 4 + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 35 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 36 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 44 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 45 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 16 + i32.const 16 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 46 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 24 + i32.const 24 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 47 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 32 + i32.const 32 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 48 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 40 + i32.const 40 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 49 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 48 + i32.const 48 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 50 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 56 + i32.const 56 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 51 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 53 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 54 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 16 + i32.const 16 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 55 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 20 + i32.const 20 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 56 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 58 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + block + i32.const 4 + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 60 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 8 + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 61 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + end i32.const 9 global.set $wasi/sig ) - (func $null (; 1 ;) (type $FUNCSIG$v) - nop + (func $start (; 2 ;) (type $FUNCSIG$v) + call $start:wasi + ) + (func $null (; 3 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/wasi.untouched.wat b/tests/compiler/wasi.untouched.wat index b4564bf1..be16b879 100644 --- a/tests/compiler/wasi.untouched.wat +++ b/tests/compiler/wasi.untouched.wat @@ -3,7 +3,7 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00w\00a\00s\00i\00.\00t\00s\00") + (data (i32.const 8) "\0e\00\00\00\01\00\00\00\10\00\00\00\0e\00\00\00w\00a\00s\00i\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/common/target/Target.WASM32 i32 (i32.const 0)) diff --git a/tests/compiler/while.optimized.wat b/tests/compiler/while.optimized.wat index 863d496d..f8bf6182 100644 --- a/tests/compiler/while.optimized.wat +++ b/tests/compiler/while.optimized.wat @@ -3,8 +3,9 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\10") - (data (i32.const 24) "w\00h\00i\00l\00e\00.\00t\00s") + (data (i32.const 8) "\10\00\00\00\01\00\00\00\10\00\00\00\10\00\00\00w\00h\00i\00l\00e\00.\00t\00s\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) (global $while/n (mut i32) (i32.const 10)) (global $while/m (mut i32) (i32.const 0)) (global $while/o (mut i32) (i32.const 0)) @@ -12,21 +13,26 @@ (start $start) (func $start:while (; 1 ;) (type $FUNCSIG$v) (local $0 i32) - loop $continue|0 - global.get $while/n - if + block $break|0 + loop $continue|0 global.get $while/n - i32.const 1 - i32.sub - global.set $while/n - global.get $while/m - i32.const 1 - i32.add - global.set $while/m - br $continue|0 + if + global.get $while/n + i32.const 1 + i32.sub + global.set $while/n + global.get $while/m + i32.const 1 + i32.add + global.set $while/m + br $continue|0 + end end end global.get $while/n + i32.const 0 + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -37,7 +43,8 @@ end global.get $while/m i32.const 10 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -50,55 +57,66 @@ global.set $while/n i32.const 0 global.set $while/m - loop $continue|1 - global.get $while/n - if + block $break|1 + loop $continue|1 global.get $while/n - i32.const 1 - i32.sub - global.set $while/n - global.get $while/m - i32.const 1 - i32.add - global.set $while/m - loop $continue|2 + if global.get $while/n - if - global.get $while/n - i32.const 1 - i32.sub - global.set $while/n - global.get $while/o - i32.const 1 - i32.add - global.set $while/o - br $continue|2 + i32.const 1 + i32.sub + global.set $while/n + global.get $while/m + i32.const 1 + i32.add + global.set $while/m + block $break|2 + loop $continue|2 + global.get $while/n + if + global.get $while/n + i32.const 1 + i32.sub + global.set $while/n + global.get $while/o + i32.const 1 + i32.add + global.set $while/o + br $continue|2 + end + end end - end - global.get $while/n - if + global.get $while/n i32.const 0 - i32.const 24 - i32.const 21 - i32.const 2 - call $~lib/builtins/abort - unreachable + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 21 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $while/o + i32.const 9 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 22 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + br $continue|1 end - global.get $while/o - i32.const 9 - i32.ne - if - i32.const 0 - i32.const 24 - i32.const 22 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - br $continue|1 end end global.get $while/n + i32.const 0 + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -109,7 +127,8 @@ end global.get $while/m i32.const 1 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -120,7 +139,8 @@ end global.get $while/o i32.const 9 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -133,29 +153,36 @@ global.set $while/n i32.const 0 global.set $while/m - loop $continue|3 - global.get $while/n - local.tee $0 - i32.const 1 - i32.sub - global.set $while/n - local.get $0 - if - global.get $while/m - i32.const 1 - i32.add - local.tee $0 - global.set $while/m - else - i32.const 0 - local.set $0 + block $break|3 + loop $continue|3 + block (result i32) + global.get $while/n + local.tee $0 + i32.const 1 + i32.sub + global.set $while/n + local.get $0 + end + if (result i32) + global.get $while/m + i32.const 1 + i32.add + local.tee $0 + global.set $while/m + local.get $0 + else + i32.const 0 + end + if + nop + br $continue|3 + end end - local.get $0 - br_if $continue|3 end global.get $while/n i32.const -1 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -166,7 +193,8 @@ end global.get $while/m i32.const 1 - i32.ne + i32.eq + i32.eqz if i32.const 0 i32.const 24 @@ -180,6 +208,5 @@ call $start:while ) (func $null (; 3 ;) (type $FUNCSIG$v) - nop ) ) diff --git a/tests/compiler/while.untouched.wat b/tests/compiler/while.untouched.wat index 2838d8dc..f8bf6182 100644 --- a/tests/compiler/while.untouched.wat +++ b/tests/compiler/while.untouched.wat @@ -3,7 +3,7 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00w\00h\00i\00l\00e\00.\00t\00s\00") + (data (i32.const 8) "\10\00\00\00\01\00\00\00\10\00\00\00\10\00\00\00w\00h\00i\00l\00e\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $while/n (mut i32) (i32.const 10)) @@ -17,16 +17,14 @@ loop $continue|0 global.get $while/n if - block - global.get $while/n - i32.const 1 - i32.sub - global.set $while/n - global.get $while/m - i32.const 1 - i32.add - global.set $while/m - end + global.get $while/n + i32.const 1 + i32.sub + global.set $while/n + global.get $while/m + i32.const 1 + i32.add + global.set $while/m br $continue|0 end end @@ -63,57 +61,53 @@ loop $continue|1 global.get $while/n if - block - global.get $while/n - i32.const 1 - i32.sub - global.set $while/n - global.get $while/m - i32.const 1 - i32.add - global.set $while/m - block $break|2 - loop $continue|2 + global.get $while/n + i32.const 1 + i32.sub + global.set $while/n + global.get $while/m + i32.const 1 + i32.add + global.set $while/m + block $break|2 + loop $continue|2 + global.get $while/n + if global.get $while/n - if - block - global.get $while/n - i32.const 1 - i32.sub - global.set $while/n - global.get $while/o - i32.const 1 - i32.add - global.set $while/o - end - br $continue|2 - end + i32.const 1 + i32.sub + global.set $while/n + global.get $while/o + i32.const 1 + i32.add + global.set $while/o + br $continue|2 end end - global.get $while/n + end + global.get $while/n + i32.const 0 + i32.eq + i32.eqz + if i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 24 - i32.const 21 - i32.const 2 - call $~lib/builtins/abort - unreachable - end - global.get $while/o - i32.const 9 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 24 - i32.const 22 - i32.const 2 - call $~lib/builtins/abort - unreachable - end + i32.const 24 + i32.const 21 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $while/o + i32.const 9 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 22 + i32.const 2 + call $~lib/builtins/abort + unreachable end br $continue|1 end diff --git a/tests/runtime/optimized.wat b/tests/runtime/optimized.wat index c7a498c4..92e5a555 100644 --- a/tests/runtime/optimized.wat +++ b/tests/runtime/optimized.wat @@ -9,8 +9,7 @@ (type $FUNCSIG$vi (func (param i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\1e") - (data (i32.const 24) "~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") (data (i32.const 56) "\10\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08") (global $~lib/started (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -761,12 +760,9 @@ local.set $2 end local.get $2 - i32.const 0 + i32.const 1 i32.store offset=4 local.get $2 - i32.const 0 - i32.store offset=8 - local.get $2 local.get $1 i32.store offset=12 local.get $0 diff --git a/tests/runtime/untouched.wasm b/tests/runtime/untouched.wasm index e96ae418..e1c64929 100644 Binary files a/tests/runtime/untouched.wasm and b/tests/runtime/untouched.wasm differ diff --git a/tests/runtime/untouched.wat b/tests/runtime/untouched.wat index 565c8962..f96fadeb 100644 --- a/tests/runtime/untouched.wat +++ b/tests/runtime/untouched.wat @@ -9,8 +9,8 @@ (type $FUNCSIG$vi (func (param i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00\1e\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") - (data (i32.const 56) "\10\00\00\00\"\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\10\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00r\00c\00.\00t\00s\00") (data (i32.const 112) "\10\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) @@ -846,61 +846,59 @@ i32.lt_u i32.eqz br_if $break|0 - block - block $~lib/rt/tlsf/SETSL|inlined.0 - local.get $3 - local.set $7 - local.get $4 - local.set $6 - i32.const 0 - local.set $5 - local.get $7 - local.get $6 - i32.const 2 - i32.shl - i32.add + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $4 + local.set $6 + i32.const 0 + local.set $5 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $5 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 local.get $5 - i32.store offset=4 - end - block $break|1 - i32.const 0 - local.set $5 - loop $repeat|1 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $4 + local.set $8 local.get $5 - i32.const 16 - i32.lt_u - i32.eqz - br_if $break|1 - block $~lib/rt/tlsf/SETHEAD|inlined.0 - local.get $3 - local.set $9 - local.get $4 - local.set $8 - local.get $5 - local.set $7 - i32.const 0 - local.set $6 - local.get $9 - local.get $8 - i32.const 4 - i32.shl - local.get $7 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store offset=96 - end - local.get $5 - i32.const 1 + local.set $7 + i32.const 0 + local.set $6 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $7 i32.add - local.set $5 - br $repeat|1 - unreachable + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 unreachable end + unreachable end local.get $4 i32.const 1 @@ -1350,12 +1348,9 @@ unreachable end local.get $3 - i32.const 0 + i32.const 1 i32.store offset=4 local.get $3 - i32.const 0 - i32.store offset=8 - local.get $3 local.get $1 i32.store offset=12 local.get $0 @@ -1419,73 +1414,15 @@ i32.const 7 i32.and if - block - local.get $2 - i32.eqz - if - br $~lib/util/memory/memmove|inlined.0 - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 + local.get $2 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 end - br $continue|0 - end - end - end - block $break|1 - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - end - br $continue|1 - end - end - end - end - block $break|2 - loop $continue|2 - local.get $2 - if - block + local.get $2 + i32.const 1 + i32.sub + local.set $2 block (result i32) local.get $0 local.tee $5 @@ -1504,11 +1441,63 @@ end i32.load8_u i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $2 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store local.get $2 - i32.const 1 + i32.const 8 i32.sub local.set $2 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 end + end + end + end + block $break|2 + loop $continue|2 + local.get $2 + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 br $continue|2 end end @@ -1530,24 +1519,22 @@ i32.const 7 i32.and if - block - local.get $2 - i32.eqz - if - br $~lib/util/memory/memmove|inlined.0 - end - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 + local.get $2 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 end + local.get $0 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + i32.add + local.get $1 + local.get $2 + i32.add + i32.load8_u + i32.store8 br $continue|3 end end @@ -1558,20 +1545,18 @@ i32.const 8 i32.ge_u if - block - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - end + local.get $2 + i32.const 8 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.add + local.get $1 + local.get $2 + i32.add + i64.load + i64.store br $continue|4 end end @@ -2206,64 +2191,62 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $2 - i32.load - local.set $4 + local.get $2 + i32.load + local.set $4 + local.get $4 + i32.load offset=4 + local.set $5 + local.get $5 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if local.get $4 - i32.load offset=4 - local.set $5 + call $~lib/rt/purerc/markGray + local.get $1 + local.get $4 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else local.get $5 i32.const 1879048192 i32.and - i32.const 805306368 + i32.const 0 i32.eq if (result i32) local.get $5 i32.const 268435455 i32.and - i32.const 0 - i32.gt_u + i32.eqz else i32.const 0 end if + global.get $~lib/rt/tlsf/ROOT local.get $4 - call $~lib/rt/purerc/markGray - local.get $1 - local.get $4 - i32.store - local.get $1 - i32.const 4 - i32.add - local.set $1 + call $~lib/rt/tlsf/freeBlock else + local.get $4 local.get $5 - i32.const 1879048192 + i32.const -2147483648 + i32.const -1 + i32.xor i32.and - i32.const 0 - i32.eq - if (result i32) - local.get $5 - i32.const 268435455 - i32.and - i32.eqz - else - i32.const 0 - end - if - global.get $~lib/rt/tlsf/ROOT - local.get $4 - call $~lib/rt/tlsf/freeBlock - else - local.get $4 - local.get $5 - i32.const -2147483648 - i32.const -1 - i32.xor - i32.and - i32.store offset=4 - end + i32.store offset=4 end end local.get $2 @@ -2279,20 +2262,20 @@ global.set $~lib/rt/purerc/CUR block $break|1 local.get $0 - local.set $3 + local.set $5 loop $repeat|1 - local.get $3 + local.get $5 local.get $1 i32.lt_u i32.eqz br_if $break|1 - local.get $3 + local.get $5 i32.load call $~lib/rt/purerc/scan - local.get $3 + local.get $5 i32.const 4 i32.add - local.set $3 + local.set $5 br $repeat|1 unreachable end @@ -2300,32 +2283,30 @@ end block $break|2 local.get $0 - local.set $3 + local.set $5 loop $repeat|2 - local.get $3 + local.get $5 local.get $1 i32.lt_u i32.eqz br_if $break|2 - block - local.get $3 - i32.load - local.set $2 - local.get $2 - local.get $2 - i32.load offset=4 - i32.const -2147483648 - i32.const -1 - i32.xor - i32.and - i32.store offset=4 - local.get $2 - call $~lib/rt/purerc/collectWhite - end - local.get $3 + local.get $5 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + local.get $4 + call $~lib/rt/purerc/collectWhite + local.get $5 i32.const 4 i32.add - local.set $3 + local.set $5 br $repeat|2 unreachable end