From 819d79889dea8d0054beb0bb589990294035a452 Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Sun, 4 Feb 2018 07:51:40 +0100 Subject: [PATCH] Second pass on the programmatic asc API; Make compiler tests use asc directly --- bin/README.md | 42 +- bin/asc | 2 +- bin/asc.js | 331 +-- bin/asc.json | 4 + package-lock.json | 11 +- package.json | 5 +- src/diagnostics.ts | 8 +- src/index.ts | 1 - src/parser.ts | 2 +- tests/compiler.js | 294 +- tests/compiler/assert.optimized.wast | 21 +- tests/compiler/assert.wast | 137 +- tests/compiler/binary.optimized.wast | 222 -- tests/compiler/binary.wast | 53 - tests/compiler/builtins.optimized.wast | 439 +-- tests/compiler/builtins.wast | 517 +++- tests/compiler/class-extends.optimized.wast | 6 - tests/compiler/class-extends.wast | 51 - tests/compiler/class.optimized.wast | 86 +- tests/compiler/class.wast | 80 +- tests/compiler/comma.optimized.wast | 143 +- tests/compiler/comma.wast | 147 +- tests/compiler/declare.optimized.wast | 49 +- tests/compiler/declare.ts | 22 +- tests/compiler/declare.wast | 123 +- tests/compiler/do.optimized.wast | 131 +- tests/compiler/do.wast | 138 +- tests/compiler/empty.wast | 48 - tests/compiler/enum.optimized.wast | 8 +- tests/compiler/enum.wast | 58 - tests/compiler/export.optimized.wast | 6 - tests/compiler/export.wast | 63 - tests/compiler/fmod.optimized.wast | 401 +-- tests/compiler/fmod.wast | 142 +- tests/compiler/for.optimized.wast | 52 +- tests/compiler/for.wast | 76 +- tests/compiler/function.optimized.wast | 138 +- tests/compiler/function.wast | 63 - tests/compiler/game-of-life.optimized.wast | 100 - tests/compiler/game-of-life.wast | 56 - tests/compiler/getter-setter.optimized.wast | 60 +- tests/compiler/getter-setter.wast | 92 +- tests/compiler/i64-polyfill.optimized.wast | 370 --- tests/compiler/i64-polyfill.wast | 142 - tests/compiler/if.optimized.wast | 103 +- tests/compiler/if.wast | 130 +- tests/compiler/import.optimized.wast | 42 +- tests/compiler/import.wast | 70 - tests/compiler/infer-type.optimized.wast | 39 +- tests/compiler/infer-type.wast | 60 - tests/compiler/inlining.optimized.wast | 24 +- tests/compiler/inlining.wast | 69 +- tests/compiler/limits.wast | 48 - tests/compiler/literals.wast | 48 - tests/compiler/logical.optimized.wast | 119 +- tests/compiler/logical.wast | 139 +- tests/compiler/memcpy.optimized.wast | 643 +---- tests/compiler/memcpy.wast | 180 +- tests/compiler/memmove.optimized.wast | 292 +- tests/compiler/memmove.wast | 180 +- tests/compiler/memset.optimized.wast | 263 +- tests/compiler/memset.wast | 119 +- tests/compiler/namespace.optimized.wast | 17 +- tests/compiler/namespace.wast | 55 - .../portable-conversions.optimized.wast | 34 - tests/compiler/portable-conversions.wast | 52 - tests/compiler/recursive.optimized.wast | 10 - tests/compiler/recursive.wast | 49 - tests/compiler/reexport.optimized.wast | 12 - tests/compiler/reexport.wast | 77 - tests/compiler/retain-i32.optimized.wast | 582 ++-- tests/compiler/retain-i32.wast | 380 ++- tests/compiler/scoped.optimized.wast | 10 - tests/compiler/scoped.wast | 51 - tests/compiler/showcase.optimized.wast | 2412 +++++------------ tests/compiler/showcase.wast | 974 +++++-- .../std/allocator_arena.optimized.wast | 814 +----- tests/compiler/std/allocator_arena.wast | 139 - tests/compiler/std/array.optimized.wast | 1209 +-------- tests/compiler/std/array.wast | 137 - tests/compiler/std/carray.optimized.wast | 70 - tests/compiler/std/carray.wast | 120 - tests/compiler/std/new.optimized.wast | 70 +- tests/compiler/std/new.wast | 138 - tests/compiler/std/set.optimized.wast | 1130 ++------ tests/compiler/std/set.wast | 136 - tests/compiler/std/string.optimized.wast | 458 +--- tests/compiler/std/string.wast | 122 - tests/compiler/switch.optimized.wast | 22 - tests/compiler/switch.wast | 53 - tests/compiler/ternary.optimized.wast | 3 - tests/compiler/ternary.wast | 49 - tests/compiler/tlsf.optimized.wast | 334 +-- tests/compiler/tlsf.wast | 233 +- tests/compiler/typealias.optimized.wast | 1 - tests/compiler/typealias.wast | 49 - tests/compiler/unary.optimized.wast | 208 +- tests/compiler/unary.wast | 52 - tests/compiler/while.optimized.wast | 138 +- tests/compiler/while.wast | 148 +- tests/parser.js | 2 +- 101 files changed, 5815 insertions(+), 12243 deletions(-) diff --git a/bin/README.md b/bin/README.md index c8c2088f..ba20f205 100644 --- a/bin/README.md +++ b/bin/README.md @@ -1 +1,41 @@ -Compiler frontend for node.js. +Compiler frontend for node.js +============================= + +Usage +----- + +For an up to date list of available command line options, see: + +``` +$> asc --help +``` + +API +--- + +The API accepts the same options as the CLI but also lets you override stdout and stderr and/or provide a callback. Example: + +```js +const asc = require("assemblyscript/bin/asc.js"); +asc.main([ + "myModule.ts", + "-b", "myModule.wasm", + "-O", + "--sourceMap", + "--measure" +], { + stdout: process.stdout, + stderr: process.stderr +}, function(err) { + if (err) + throw err; + ... +}); +``` + +Available command line options can also be obtained programmatically: + +```js +const options = require("assemblyscript/bin/asc.json"); +... +``` diff --git a/bin/asc b/bin/asc index c0fcce22..c62e7ad7 100755 --- a/bin/asc +++ b/bin/asc @@ -1,2 +1,2 @@ #!/usr/bin/env node -require("./asc.js").main(process.argv.slice(2)); +process.exitCode = require("./asc.js").main(process.argv.slice(2)); diff --git a/bin/asc.js b/bin/asc.js index 5bd60ae4..a363dbe9 100644 --- a/bin/asc.js +++ b/bin/asc.js @@ -1,5 +1,6 @@ const fs = require("fs"); const path = require("path"); +const os = require("os"); // Use distribution files if present, otherwise run the sources directly var assemblyscript; @@ -24,20 +25,42 @@ const DEFAULT_SHRINK_LEVEL = 1; exports.VERSION = VERSION; -function main(argv, callback) { +function main(argv, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else if (!options) + options = {}; + + const stdout = options.stdout || process.stdout; + const stderr = options.stderr || process.stderr; + + // Record compilation times + var stats = createStats(); + const args = parseArguments(argv); const indent = 24; + // Use default callback is none is provided + if (!callback) callback = function defaultCallback(err) { + var code = 0; + if (err) { + stderr.write(err + os.EOL); + code = 1; + } else if (args.measure) + printStats(stats, stderr); + return code; + }; + // Just print the version if requested if (args.version) { - console.log("Version " + VERSION); - if (callback) return callback(null); - process.exit(0); + stdout.write("Version " + VERSION + os.EOL); + return callback(null); } // Print the help message if requested or no source files are provided if (args.help || args._.length < 1) { - const options = []; + const opts = []; Object.keys(OPTIONS).forEach(name => { var option = OPTIONS[name]; var text = " "; @@ -47,16 +70,16 @@ function main(argv, callback) { while (text.length < indent) text += " "; if (Array.isArray(option.desc)) { - options.push(text + option.desc[0] + option.desc.slice(1).map(line => { + opts.push(text + option.desc[0] + option.desc.slice(1).map(line => { for (var i = 0; i < indent; ++i) line = " " + line; - return "\n" + line; + return os.EOL + line; }).join("")); } else - options.push(text + option.desc); + opts.push(text + option.desc); }); - (args.help ? console.log : console.error)([ + (args.help ? stdout : stderr).write([ "Version " + VERSION, "Syntax: asc [entryFile ...] [options]", "", @@ -65,13 +88,12 @@ function main(argv, callback) { " asc hello1.ts hello2.ts -b -O > hello.wasm", "", "Options:" - ].concat(options).join("\n")); - if (callback) return callback(args.help ? null : Error("usage")); - process.exit(args.help ? 0 : 1); + ].concat(opts).join(os.EOL) + os.EOL); + return callback(null); } - // Record compilation times - var stats = createStats(); + // Set up base directory + const baseDir = args.baseDir != null ? path.resolve(args.baseDir) : process.cwd(); // Include standard library if --noLib isn't set const libDirs = args.noLib ? [] : [ path.join(__dirname, "..", "std", "assembly") ]; @@ -87,22 +109,6 @@ function main(argv, callback) { // Begin parsing var parser = null; - // Include library components - libDirs.forEach(libDir => { - var notReadTime = 0; - stats.readTime += measure(() => { - require("glob").sync("*.ts", { cwd: libDir }).forEach(file => { - var nextText = fs.readFileSync(path.join(libDir, file), { encoding: "utf8" }); - ++stats.readCount; - var time = measure(() => { - parser = assemblyscript.parseFile(nextText, LIBRARY_PREFIX + file, parser, false); - }); - stats.parseTime += time; - notReadTime += time; - }); - }) - notReadTime; - }); - // Include entry files for (let i = 0, k = args._.length; i < k; ++i) { const filename = args._[i]; @@ -113,22 +119,20 @@ function main(argv, callback) { // Try entryPath.ts, then entryPath/index.ts try { stats.readTime += measure(() => { - entryText = fs.readFileSync(entryPath + ".ts", { encoding: "utf8" }); + entryText = fs.readFileSync(path.join(baseDir, entryPath) + ".ts", { encoding: "utf8" }); entryPath += ".ts"; }); ++stats.readCount; } catch (e) { try { stats.readTime += measure(() => { - entryText = fs.readFileSync(entryPath + "/index.ts", { encoding: "utf8" }); + entryText = fs.readFileSync(path.join(baseDir, entryPath, "index.ts"), { encoding: "utf8" }); entryPath += "/index.ts"; }); ++stats.readCount; entryPath = entryPath + "/index"; } catch (e) { - console.error("File '" + entryPath + ".ts' not found."); - if (callback) return callback(Error("file not found")); - process.exit(1); + return callback(Error("Entry file '" + entryPath + ".ts' not found.")); } } @@ -161,7 +165,7 @@ function main(argv, callback) { } else { stats.readTime += measure(() => { try { - nextText = fs.readFileSync(nextFile + ".ts", { encoding: "utf8" }); + nextText = fs.readFileSync(path.join(baseDir, nextFile + ".ts"), { encoding: "utf8" }); nextFile = nextFile + ".ts"; found = true; } catch (e) {} @@ -170,44 +174,70 @@ function main(argv, callback) { if (!found) { stats.readTime += measure(() => { try { - nextText = fs.readFileSync(nextFile + "/index.ts", { encoding: "utf8" }); + nextText = fs.readFileSync(path.join(baseDir, nextFile, "index.ts"), { encoding: "utf8" }); nextFile = nextFile + "/index.ts"; found = true; } catch (e) {} }); ++stats.readCount; } + if (!found) { + for (let i = 0; i < libDirs.length; ++i) { + stats.readTime += measure(() => { + try { + nextText = fs.readFileSync(path.join(libDirs[i], nextFile + ".ts"), { encoding: "utf8" }); + nextFile = LIBRARY_PREFIX + nextFile + ".ts"; + found = true; + } catch (e) {} + }); + ++stats.readCount; + if (found) + break; + } + } } - if (!found) { - console.error("Imported file '" + nextFile + ".ts' not found."); - process.exit(1); - } + if (!found) + return callback(Error("Import file '" + nextFile + ".ts' not found.")); stats.parseTime += measure(() => { assemblyscript.parseFile(nextText, nextFile, parser); }); } - if (checkDiagnostics(parser)) { - if (callback) return callback(Error("compilation error")); - process.exit(1); - } + if (checkDiagnostics(parser, stderr)) + return callback(Error("Parse error")); + } + + // Include library components + for (let i = 0, k = libDirs.length; i < k; ++i) { + let libDir = libDirs[i]; + let notReadTime = 0; + stats.readTime += measure(() => { + require("glob").sync("*.ts", { cwd: libDir }).forEach(file => { + var nextText = fs.readFileSync(path.join(libDir, file), { encoding: "utf8" }); + ++stats.readCount; + var time = measure(() => { + parser = assemblyscript.parseFile(nextText, LIBRARY_PREFIX + file, parser, false); + }); + stats.parseTime += time; + notReadTime += time; + }); + }) - notReadTime; } // Begin compilation - const options = assemblyscript.createOptions(); - assemblyscript.setTarget(options, 0); - assemblyscript.setNoTreeShaking(options, args.noTreeShaking); - assemblyscript.setNoAssert(options, args.noAssert); - assemblyscript.setNoMemory(options, args.noMemory); - assemblyscript.setSourceMap(options, args.sourceMap != null); + const compilerOptions = assemblyscript.createOptions(); + assemblyscript.setTarget(compilerOptions, 0); + assemblyscript.setNoTreeShaking(compilerOptions, !!args.noTreeShaking); + assemblyscript.setNoAssert(compilerOptions, !!args.noAssert); + assemblyscript.setNoMemory(compilerOptions, !!args.noMemory); + assemblyscript.setSourceMap(compilerOptions, args.sourceMap != null); var module; stats.compileTime += measure(() => { - module = assemblyscript.compile(parser, options); + module = assemblyscript.compile(parser, compilerOptions); }); - if (checkDiagnostics(parser)) { + if (checkDiagnostics(parser, stderr)) { if (module) module.dispose(); - if (callback) return callback(Error("errored")); - process.exit(1); + return callback(Error("Compile error")); } // Validate the module if requested @@ -215,9 +245,7 @@ function main(argv, callback) { stats.validateTime += measure(() => { if (!module.validate()) { module.dispose(); - if (callback) return callback(Error("validation failed")); - console.error("Validation failed"); - process.exit(1); + return callback(Error("Validate error")); } }); } @@ -229,9 +257,7 @@ function main(argv, callback) { stats.optimizeTime += measure(() => module.runPasses([ "trap-mode-js" ])); } else if (args.trapMode !== "allow") { module.dispose(); - console.error("Unsupported trap mode"); - if (callback) return callback(Error("unsupported trap mode")); - process.exit(1); + return callback(Error("Unsupported trap mode")); } var optimizeLevel = -1; @@ -294,7 +320,7 @@ function main(argv, callback) { // Prepare output if (!args.noEmit) { - var hasOutput = false; + let hasStdout = false; if (args.outFile != null) { if (/\.wast$/.test(args.outFile) && args.textFile == null) @@ -305,71 +331,91 @@ function main(argv, callback) { args.binaryFile = args.outFile; } - if (args.binaryFile != null && args.binaryFile.length) { - var sourceMapURL = args.sourceMap != null + // Write binary + if (args.binaryFile != null) { + let sourceMapURL = args.sourceMap != null ? args.sourceMap.length ? args.sourceMap : path.basename(args.binaryFile) + ".map" : null; - var binary; - stats.writeTime += measure(() => { - // FIXME: 'not a valid URL' in FF (wants http(s)://.../url) - binary = module.toBinary(sourceMapURL); - fs.writeFileSync(args.binaryFile, binary.output); - }); - ++stats.writeCount; - if (binary.sourceMap != null) { - postProcessSourceMap(binary.sourceMap, sourceMapURL, libDirs, stats).then(sourceMap => { - stats.writeTime += measure(() => { - fs.writeFileSync(path.join(path.dirname(args.binaryFile), path.basename(sourceMapURL)), sourceMap, { encoding: "utf8" }); - }, err => { - throw err; - }); - ++stats.writeCount; - }).catch(err => { - // FIXME: as this is asynchronous, we cannot properly terminate main - console.error(err); - }); - } - hasOutput = true; - } - if (args.textFile != null && args.textFile.length) { - stats.writeTime += measure(() => fs.writeFileSync(args.textFile, module.toText(), { encoding: "utf8" })); - ++stats.writeCount; - hasOutput = true; - } + let binary; + stats.writeTime += measure(() => binary = module.toBinary(sourceMapURL)); - if (args.asmjsFile != null && args.asmjsFile.length) { - stats.writeTime += measure(() => fs.writeFileSync(args.asmjsFile, module.toAsmjs(), { encoding: "utf8" })); - ++stats.writeCount; - hasOutput = true; - } - - if (!hasOutput) { - if (args.binaryFile === "") { - stats.writeTime += measure(() => process.stdout.write(Buffer.from(module.toBinary().output))); - ++stats.writeCount; - } else if (args.asmjsFile === "") { - stats.writeTime += measure(() => module.printAsmjs()); + if (args.binaryFile.length) { + stats.writeTime += measure(() => fs.writeFileSync(path.join(baseDir, args.binaryFile), binary.output)); ++stats.writeCount; } else { - stats.writeTime += measure(() => module.print()); + stats.writeTime += measure(() => stdout.write(Buffer.from(binary.output))); ++stats.writeCount; + hasStdout = true; + } + + // Post-process source map + if (binary.sourceMap != null) { + if (args.binaryFile.length) { + let sourceMap = JSON.parse(binary.sourceMap); + sourceMap.sourceRoot = SOURCEMAP_ROOT; + sourceMap.sources.forEach((name, index) => { + var text, found = false; + if (name.startsWith(LIBRARY_PREFIX)) { + for (var i = 0, k = libDirs.length; i < k; ++i) { + stats.readTime += measure(() => { + try { + text = fs.readFileSync(path.join(libDirs[i], name.substring(LIBRARY_PREFIX.length)), { encoding: "utf8" }); + found = true; + } catch (e) {} + }); + ++stats.readCount; + } + } else { + stats.readTime += measure(() => { + try { + text = fs.readFileSync(path.join(baseDir, name), { encoding: "utf8" }); + found = true; + } catch (e) {} + }); + ++stats.readCount; + } + if (!found) + return callback(Error("Source file '" + name + "' not found.")); + (sourceMap.sourceContents || (sourceMap.sourceContents = []))[index] = text; + }); + stats.writeTime += measure(() => fs.writeFileSync(path.join(baseDir, path.dirname(args.binaryFile), path.basename(sourceMapURL)), JSON.stringify(sourceMap), { encoding: "utf8" })); + ++stats.writeCount; + } else { + stderr.write("Cannot write source map because binary already uses stdout." + os.EOL); + } + } + } + + // Write text + if (args.textFile != null) { + if (args.textFile.length) { + stats.writeTime += measure(() => fs.writeFileSync(path.join(baseDir, args.textFile), module.toText(), { encoding: "utf8" })); + ++stats.writeCount; + } else if (!hasStdout) { + stats.writeTime += measure(() => stdout.write(module.toText())); + ++stats.writeCount; + hasStdout = true; + } + } + + // Write asm.js + if (args.asmjsFile != null && args.asmjsFile.length) { + if (args.asmjsFile.length) { + stats.writeTime += measure(() => fs.writeFileSync(path.join(baseDir, args.asmjsFile), module.toAsmjs(), { encoding: "utf8" })); + ++stats.writeCount; + } else if (!hasStdout) { + stats.writeTime += measure(() => stdout.write(Buffer.from(module.toBinary().output))); + ++stats.writeCount; + hasStdout = true; } } } module.dispose(); - - if (args.measure) process.on("beforeExit", () => console.error([ - "I/O Read : " + (stats.readTime ? (stats.readTime / 1e6).toFixed(3) + " ms (" + stats.readCount + " files)" : "N/A"), - "I/O Write : " + (stats.writeTime ? (stats.writeTime / 1e6).toFixed(3) + " ms (" + stats.writeCount + " files)" : "N/A"), - "Parse : " + (stats.parseTime ? (stats.parseTime / 1e6).toFixed(3) + " ms" : "N/A"), - "Compile : " + (stats.compileTime ? (stats.compileTime / 1e6).toFixed(3) + " ms" : "N/A"), - "Validate : " + (stats.validateTime ? (stats.validateTime / 1e6).toFixed(3) + " ms" : "N/A"), - "Optimize : " + (stats.optimizeTime ? (stats.optimizeTime / 1e6).toFixed(3) + " ms" : "N/A") - ].join("\n"))); + return callback(null); } exports.main = main; @@ -392,11 +438,11 @@ function parseArguments(argv) { exports.parseArguments = parseArguments; -function checkDiagnostics(parser) { +function checkDiagnostics(parser, stderr) { var diagnostic; var hasErrors = false; while ((diagnostic = assemblyscript.nextDiagnostic(parser)) != null) { - console.error(assemblyscript.formatDiagnostic(diagnostic, process.stderr.isTTY, true)); + stderr.write(assemblyscript.formatDiagnostic(diagnostic, stderr.isTTY, true) + os.EOL + os.EOL); if (assemblyscript.isError(diagnostic)) hasErrors = true; } return hasErrors; @@ -404,44 +450,6 @@ function checkDiagnostics(parser) { exports.checkDiagnostics = checkDiagnostics; -function postProcessSourceMap(sourceMap, sourceMapURL, libDirs, stats) { - const { SourceMapConsumer, SourceMapGenerator } = require("source-map"); - const json = JSON.parse(sourceMap); - json.sourceRoot = SOURCEMAP_ROOT; - return SourceMapConsumer.with(json, undefined, consumer => { - const generator = SourceMapGenerator.fromSourceMap(consumer); - json.sources.forEach(name => { - var text, found = false; - if (name.startsWith(LIBRARY_PREFIX)) { - for (var i = 0, k = libDirs.length; i < k; ++i) { - stats.readTime += measure(() => { - try { - text = fs.readFileSync(path.join(libDirs[i], name.substring(LIBRARY_PREFIX.length)), { encoding: "utf8" }); - found = true; - } catch (e) {} - }); - ++stats.readCount; - } - } else { - stats.readTime += measure(() => { - try { - text = fs.readFileSync(name, { encoding: "utf8" }); - found = true; - } catch (e) {} - }); - ++stats.readCount; - } - if (found) - generator.setSourceContent(name, text); - else - console.error("No source content found for file '" + name + "'."); - }); - return Promise.resolve(generator.toString()); - }); -} - -exports.processSourceMap = postProcessSourceMap; - function createStats() { return { readTime: 0, @@ -455,9 +463,26 @@ function createStats() { }; } +exports.createStats = createStats; + function measure(fn) { const start = process.hrtime(); fn(); const times = process.hrtime(start); return times[0] * 1e9 + times[1]; } + +exports.measure = measure; + +function printStats(stats, output) { + (output || process.stdout).write([ + "I/O Read : " + (stats.readTime ? (stats.readTime / 1e6).toFixed(3) + " ms (" + stats.readCount + " files)" : "N/A"), + "I/O Write : " + (stats.writeTime ? (stats.writeTime / 1e6).toFixed(3) + " ms (" + stats.writeCount + " files)" : "N/A"), + "Parse : " + (stats.parseTime ? (stats.parseTime / 1e6).toFixed(3) + " ms" : "N/A"), + "Compile : " + (stats.compileTime ? (stats.compileTime / 1e6).toFixed(3) + " ms" : "N/A"), + "Validate : " + (stats.validateTime ? (stats.validateTime / 1e6).toFixed(3) + " ms" : "N/A"), + "Optimize : " + (stats.optimizeTime ? (stats.optimizeTime / 1e6).toFixed(3) + " ms" : "N/A") + ].join(os.EOL) + os.EOL); +} + +exports.printStats = printStats; diff --git a/bin/asc.json b/bin/asc.json index 065f087e..09cccd1f 100644 --- a/bin/asc.json +++ b/bin/asc.json @@ -38,6 +38,10 @@ "type": "boolean", "aliases": [ "c", "check" ] }, + "baseDir": { + "desc": "Specifies the base directory of input and output files.", + "type": "string" + }, "outFile": { "desc": "Specifies the output file. File extension indicates format.", "type": "string", diff --git a/package-lock.json b/package-lock.json index 94688bb2..776f69d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2538,9 +2538,9 @@ "dev": true }, "long": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", - "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", "dev": true }, "longest": { @@ -3589,11 +3589,6 @@ "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==", "dev": true }, - "source-map": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.0.tgz", - "integrity": "sha512-JsXsCYrKzxA5kU8LanQJHIPoEY3fEH5WYSMJ8Z77ESByI18VFEoxB46H2eNHqK2nVqTRjUe5DYvNHmyT3JOd1w==" - }, "source-map-resolve": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", diff --git a/package.json b/package.json index 8853d551..915703df 100644 --- a/package.json +++ b/package.json @@ -13,13 +13,12 @@ "dependencies": { "binaryen": "42.0.0-nightly.20180202", "glob": "^7.1.2", - "minimist": "^1.2.0", - "source-map": "^0.7.0" + "minimist": "^1.2.0" }, "devDependencies": { "chalk": "^2.3.0", "diff": "^3.4.0", - "long": "^3.2.0", + "long": "^4.0.0", "source-map-support": "^0.5.3", "ts-loader": "^3.4.0", "ts-node": "^4.1.0", diff --git a/src/diagnostics.ts b/src/diagnostics.ts index 1dc6f4af..21143ca8 100644 --- a/src/diagnostics.ts +++ b/src/diagnostics.ts @@ -161,7 +161,7 @@ export function formatDiagnosticContext(range: Range, useColors: bool = false): export abstract class DiagnosticEmitter { diagnostics: DiagnosticMessage[]; - silentDiagnostics: bool = false; + // silentDiagnostics: bool = false; constructor(diagnostics: DiagnosticMessage[] | null = null) { this.diagnostics = diagnostics ? diagnostics : new Array(); @@ -170,10 +170,10 @@ export abstract class DiagnosticEmitter { emitDiagnostic(code: DiagnosticCode, category: DiagnosticCategory, range: Range, arg0: string | null = null, arg1: string | null = null) { var message = DiagnosticMessage.create(code, category, arg0, arg1).withRange(range); this.diagnostics.push(message); - if (!this.silentDiagnostics) { + /* if (!this.silentDiagnostics) { console.log(formatDiagnosticMessage(message, true, true) + "\n"); // temporary - // console.log(new Error("stack").stack); - } + console.log(new Error("stack").stack); + } */ } error(code: DiagnosticCode, range: Range, arg0: string | null = null, arg1: string | null = null): void { diff --git a/src/index.ts b/src/index.ts index af24741d..98c1a653 100644 --- a/src/index.ts +++ b/src/index.ts @@ -138,4 +138,3 @@ export function decompile(module: Module): string { decompiler.decompile(module); return decompiler.finish(); } - diff --git a/src/parser.ts b/src/parser.ts index c265416a..976786d7 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -111,7 +111,7 @@ export class Parser extends DiagnosticEmitter { this.program.sources.push(source); var tn = new Tokenizer(source, this.program.diagnostics); - tn.silentDiagnostics = this.silentDiagnostics; + // tn.silentDiagnostics = this.silentDiagnostics; source.tokenizer = tn; while (!tn.skip(Token.ENDOFFILE)) { diff --git a/tests/compiler.js b/tests/compiler.js index d7185e47..ba390e34 100644 --- a/tests/compiler.js +++ b/tests/compiler.js @@ -1,170 +1,146 @@ -const fs = require("fs"); +const fs = require("fs"); const path = require("path"); +const os = require("os"); const chalk = require("chalk"); const glob = require("glob"); +const minimist = require("minimist"); const diff = require("./util/diff"); +const asc = require("../bin/asc.js"); -require("ts-node").register({ project: require("path").join(__dirname, "..", "src") }); -require("../src/glue/js"); - -const { Compiler, Options } = require("../src/compiler"); -const { Module } = require("../src/module"); -const { Parser } = require("../src/parser"); -const { ElementKind, LIBRARY_PREFIX } = require("../src/program"); - -var isCreate = process.argv[2] === "--create"; -var filter = process.argv.length > 2 && !isCreate ? "**/" + process.argv[2] + ".ts" : "**/*.ts"; - -var stdDir = path.join(__dirname, "..", "std", "assembly"); -var stdFiles = glob.sync("*.ts", { cwd: stdDir }); - -var success = 0; -var failures = 0; - -glob.sync(filter, { cwd: path.join(__dirname, "compiler") }).forEach(filename => { - if (filename.charAt(0) == "_") return; - console.log(chalk.whiteBright("Testing compiler/" + filename)); - - var fixture = path.basename(filename, ".ts"); - var startTime = process.hrtime(); - var parser = new Parser(); - var cwd = path.join(__dirname, "compiler"); - - // include stdlib in std/ tests only. doing this to reduce the sheer amount of - // program elements listed at the bottom of the basic fixtures. - if (filename.startsWith("std/")) { - stdFiles.forEach(file => parser.parseFile(fs.readFileSync(path.join(stdDir, file), { encoding: "utf8" }), LIBRARY_PREFIX + path.basename(file), false)); - fixture = "std/" + fixture; - } - - var sourceText = fs.readFileSync(path.join(cwd, filename), { encoding: "utf8" }); - parser.parseFile(sourceText, filename, true); - var nextFile; - while ((nextFile = parser.nextFile()) !== null) { - if (nextFile.startsWith(LIBRARY_PREFIX)) { - sourceText = fs.readFileSync(path.join(stdDir, nextFile.substring(LIBRARY_PREFIX.length) + ".ts"), { encoding: "utf8" }); - nextFile = nextFile + ".ts"; - } else { - try { - sourceText = fs.readFileSync(path.join(cwd, nextFile + ".ts"), { encoding: "utf8" }); - nextFile += ".ts"; - } catch (e) { - try { - sourceText = fs.readFileSync(path.join(cwd, nextFile, "index.ts"), { encoding: "utf8" }); - nextFile += "/index.ts"; - } catch (e) { - sourceText = fs.readFileSync(path.join(stdDir, nextFile + ".ts"), { encoding: "utf8" }); - nextFile = LIBRARY_PREFIX + nextFile + ".ts"; - // FIXME: what exactly is swallowing the error here? - } - } - } - parser.parseFile(sourceText, nextFile, false); - } - var program = parser.finish(); - var options = new Options(); - options.sourceMap = true; - var parseTime = process.hrtime(startTime); - startTime = process.hrtime(); - var module; - try { - module = Compiler.compile(program, options); - } catch (e) { - failed = true; - module = Module.create(); - console.log(chalk.red("compile ERROR: ") + e.stack); - } - var compileTime = process.hrtime(startTime); - var actual = module.toText() + "(;\n[program.elements]\n " + elements(program.elements) - + "\n[program.exports]\n " + elements(program.exports) - + "\n;)\n"; - var actualOptimized = null; - - console.log("parse incl. I/O: " + ((parseTime[0] * 1e9 + parseTime[1]) / 1e6).toFixed(3) + "ms / compile: " + ((compileTime[0] * 1e9 + compileTime[1]) / 1e6).toFixed(3) + "ms"); - - var failed = false; - if (module.validate()) { - console.log(chalk.green("validate OK")); - try { - var binary = module.toBinary(); - var wasmModule = new WebAssembly.Module(binary.output); - var wasmInstance = new WebAssembly.Instance(wasmModule, { - env: { - abort: function(msg, file, line, column) { - throw new Error("Assertion failed"); - }, - externalFunc: function(arg0, arg1, arg2) { - console.log("env.externalFunc called with: " + arg0 + ", " + arg1 + ", " + arg2); - }, - externalConst: 1, - allocate_memory: function(size) { - console.log("env.allocate_memory called with: " + size); - return 0; - }, - free_memory: function(ptr) { - console.log("env.free_memory called with: " + ptr); - } - }, - external: { - externalFunc: function(arg0, arg1, arg2) { - console.log("external.externalFunc called with: " + arg0 + ", " + arg1 + ", " + arg2); - }, - externalConst: 2 - } - }); - console.log(chalk.green("instantiate OK")); - } catch (e) { - failed = true; - console.log(chalk.red("instantiate ERROR: ") + e.stack); - } - module.optimize(); - actualOptimized = module.toText(); - if (isCreate) { - var binary = module.toBinary(fixture + ".optimized.wasm.map"); - fs.writeFileSync(__dirname + "/compiler/" + fixture + ".optimized.wasm", binary.output); - if (binary.sourceMap != null) - fs.writeFileSync(__dirname + "/compiler/" + fixture + ".optimized.wasm.map", binary.sourceMap, { encoding: "utf8" }); - } - } else { - failed = true; - console.log(chalk.red("validate ERROR")); - } - - if (isCreate) { - fs.writeFileSync(__dirname + "/compiler/" + fixture + ".wast", actual, { encoding: "utf8" }); - console.log("Created"); - if (actualOptimized != null) { - fs.writeFileSync(__dirname + "/compiler/" + fixture + ".optimized.wast", actualOptimized, { encoding: "utf8" }); - console.log("Created optimized"); - } - } else { - var expected; - try { - expected = fs.readFileSync(__dirname + "/compiler/" + fixture + ".wast", { encoding: "utf8" }); - } catch (e) { - expected = e.message + "\n"; - } - var diffs = diff(filename + ".wast", expected, actual); - if (diffs !== null) { - console.log(diffs); - console.log(chalk.red("diff ERROR")); - failed = true; - } else - console.log(chalk.green("diff OK")); - } - - module.dispose(); - console.log(); - if (failed) - ++failures; +const args = minimist(process.argv.slice(2), { + boolean: [ "create", "help" ], + alias: { h: "help" } }); -function elements(map) { - var arr = []; - map.forEach((value, key) => { - arr.push(ElementKind[value.kind] + ": " + key); +if (args.help) { + console.log("Usage: npm run test:compiler -- [test1, test2 ...] [--create]\n"); + console.log("Runs all tests if no tests have been specified."); + console.log("Recreates affected fixtures if --create is specified."); + process.exit(0); +} + +var successes = 0; +var failures = 0; + +const basedir = path.join(__dirname, "compiler"); + +// Get a list of all tests +var tests = glob.sync("**/!(_)*.ts", { cwd: basedir }); + +// Run specific tests only if arguments are provided +if (args._.length) { + tests = tests.filter(filename => args._.indexOf(filename.replace(/\.ts$/, "")) >= 0); + if (!tests.length) { + console.error("No matching tests: " + args._.join(" ")); + process.exit(1); + } +} + +// TODO: asc's callback is synchronous here. This might change. +tests.forEach(filename => { + console.log(chalk.whiteBright("Testing compiler/" + filename)); + + const basename = filename.replace(/\.ts$/, ""); + + const stdout = createMemoryStream(); + const stderr = createMemoryStream(true); + + var failed = false; + + // TODO: also stdout/stderr and diff it (-> expected failures) + + // Build unoptimized + asc.main([ + filename, + "--baseDir", basedir, + "-t", // -> stdout + "--sourceMap" + ], { + stdout: stdout, + stderr: stderr + }, err => { + if (err) + stderr.write(err + os.EOL); + if (args.create) { + fs.writeFileSync(path.join(basedir, basename + ".wast"), stdout.toString(), { encoding: "utf8" }); + console.log("Recreated fixture."); + } else { + let actual = stdout.toString(); + let expected = fs.readFileSync(path.join(basedir, basename + ".wast"), { encoding: "utf8" }); + let diffs = diff(basename + ".wast", expected, actual); + if (diffs !== null) { + console.log(diffs); + console.log(chalk.red("diff ERROR")); + failed = true; + } else + console.log(chalk.green("diff OK")); + } + + stdout.length = 0; + stderr.length = 0; + stderr.print = false; + + // Build optimized + asc.main([ + filename, + "--baseDir", basedir, + "-t", basename + ".optimized.wast", + "-b", // -> stdout + "-O" + ], { + stdout: stdout, + stderr: stderr + }, err => { + if (err) + stderr.write(err + os.EOL); + + // Instantiate + try { + let exports = new WebAssembly.Instance(new WebAssembly.Module(stdout.toBuffer()), { + env: { + abort: function(msg, file, line, column) { + // TODO + }, + externalFunction: function() { }, + externalConstant: 1 + }, + my: { + externalFunction: function() { }, + externalConstant: 2 + } + }); + console.log(chalk.green("instantiate OK")); + } catch (e) { + console.log(chalk.red("instantiate ERROR: ") + e); + failed = true; + } + + if (failed) ++failures; + else ++successes; + console.log(); + }); }); - return arr.join("\n "); +}); + +function createMemoryStream(print) { + var stream = []; + if (stream.print = print) + stream.isTTY = process.stderr.isTTY; + stream.write = function(chunk) { + if (typeof chunk === "string") { + this.push(Buffer.from(chunk, "utf8")); + if (stream.print) + process.stderr.write(chunk); + } else + this.push(chunk); + }; + stream.toBuffer = function() { + return Buffer.concat(this); + }; + stream.toString = function() { + return this.toBuffer().toString("utf8"); + }; + return stream; } if (failures) { diff --git a/tests/compiler/assert.optimized.wast b/tests/compiler/assert.optimized.wast index a9751edd..5735445b 100644 --- a/tests/compiler/assert.optimized.wast +++ b/tests/compiler/assert.optimized.wast @@ -1,25 +1,32 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (memory $0 1) + (data (i32.const 8) "\t\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s") + (data (i32.const 32) "\0c\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e") (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $start (; 1 ;) (type $v) (local $0 i32) - ;;@ assert.ts:10:0 (if - ;;@ assert.ts:10:4 (i32.eqz - ;;@ assert.ts:10:5 (if (result i32) (tee_local $0 - ;;@ assert.ts:10:12 (i32.const 1) ) (get_local $0) - (unreachable) + (block + (call $abort + (i32.const 32) + (i32.const 8) + (i32.const 10) + (i32.const 5) + ) + (unreachable) + ) ) ) - ;;@ assert.ts:11:2 (unreachable) ) ) diff --git a/tests/compiler/assert.wast b/tests/compiler/assert.wast index 5b2636f7..0688affc 100644 --- a/tests/compiler/assert.wast +++ b/tests/compiler/assert.wast @@ -1,10 +1,14 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) - (global $HEAP_BASE i32 (i32.const 4)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) + (global $HEAP_BASE i32 (i32.const 60)) (memory $0 1) + (data (i32.const 8) "\t\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s\00") + (data (i32.const 32) "\0c\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e\00") (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $start (; 1 ;) (type $v) (local $0 i32) ;;@ assert.ts:1:0 (if @@ -12,7 +16,15 @@ ;;@ assert.ts:1:7 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 1) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ assert.ts:2:0 (if @@ -20,7 +32,15 @@ ;;@ assert.ts:2:7 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 2) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ assert.ts:3:0 (if @@ -32,7 +52,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 3) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ assert.ts:4:0 (if @@ -41,7 +69,15 @@ (f64.const 0.5) (f64.const 0) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 4) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ assert.ts:5:0 (if @@ -53,7 +89,15 @@ (f64.const 0.4) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 5) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ assert.ts:6:0 (if @@ -61,7 +105,15 @@ ;;@ assert.ts:6:7 (i64.const 4294967296) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 6) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ assert.ts:7:0 (if @@ -73,7 +125,15 @@ (i64.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 7) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ assert.ts:10:0 (if @@ -87,7 +147,16 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + ;;@ assert.ts:10:18 + (i32.const 32) + (i32.const 8) + (i32.const 10) + (i32.const 5) + ) + (unreachable) + ) (get_local $0) ) ) @@ -96,51 +165,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE -[program.exports] - -;) diff --git a/tests/compiler/binary.optimized.wast b/tests/compiler/binary.optimized.wast index 479fc25e..17505639 100644 --- a/tests/compiler/binary.optimized.wast +++ b/tests/compiler/binary.optimized.wast @@ -9,729 +9,507 @@ (export "memory" (memory $0)) (start $start) (func $start (; 0 ;) (type $v) - ;;@ binary.ts:14:0 (drop (i32.div_s (get_global $binary/i) - ;;@ binary.ts:14:4 (i32.const 1) ) ) - ;;@ binary.ts:15:0 (drop (i32.rem_s (get_global $binary/i) - ;;@ binary.ts:15:4 (i32.const 1) ) ) - ;;@ binary.ts:23:0 (set_global $binary/b - ;;@ binary.ts:23:4 (i32.lt_s (get_global $binary/i) - ;;@ binary.ts:23:8 (i32.const 1) ) ) - ;;@ binary.ts:24:0 (set_global $binary/b - ;;@ binary.ts:24:4 (i32.gt_s (get_global $binary/i) - ;;@ binary.ts:24:8 (i32.const 1) ) ) - ;;@ binary.ts:25:0 (set_global $binary/b - ;;@ binary.ts:25:4 (i32.le_s (get_global $binary/i) - ;;@ binary.ts:25:9 (i32.const 1) ) ) - ;;@ binary.ts:26:0 (set_global $binary/b - ;;@ binary.ts:26:4 (i32.ge_s (get_global $binary/i) - ;;@ binary.ts:26:9 (i32.const 1) ) ) - ;;@ binary.ts:27:0 (set_global $binary/b - ;;@ binary.ts:27:4 (i32.eq (get_global $binary/i) - ;;@ binary.ts:27:9 (i32.const 1) ) ) - ;;@ binary.ts:28:0 (set_global $binary/b - ;;@ binary.ts:28:4 (i32.eq (get_global $binary/i) - ;;@ binary.ts:28:10 (i32.const 1) ) ) - ;;@ binary.ts:29:0 (set_global $binary/i - ;;@ binary.ts:29:4 (i32.add (get_global $binary/i) - ;;@ binary.ts:29:8 (i32.const 1) ) ) - ;;@ binary.ts:30:0 (set_global $binary/i - ;;@ binary.ts:30:4 (i32.sub (get_global $binary/i) - ;;@ binary.ts:30:8 (i32.const 1) ) ) - ;;@ binary.ts:31:0 (set_global $binary/i - ;;@ binary.ts:31:4 (i32.mul (get_global $binary/i) - ;;@ binary.ts:31:8 (i32.const 1) ) ) - ;;@ binary.ts:32:0 (set_global $binary/i - ;;@ binary.ts:32:4 (i32.div_s (get_global $binary/i) - ;;@ binary.ts:32:8 (i32.const 1) ) ) - ;;@ binary.ts:33:0 (set_global $binary/i - ;;@ binary.ts:33:4 (i32.rem_s (get_global $binary/i) - ;;@ binary.ts:33:8 (i32.const 1) ) ) - ;;@ binary.ts:34:0 (set_global $binary/i - ;;@ binary.ts:34:4 (i32.shl (get_global $binary/i) - ;;@ binary.ts:34:9 (i32.const 1) ) ) - ;;@ binary.ts:35:0 (set_global $binary/i - ;;@ binary.ts:35:4 (i32.shr_s (get_global $binary/i) - ;;@ binary.ts:35:9 (i32.const 1) ) ) - ;;@ binary.ts:36:0 (set_global $binary/i - ;;@ binary.ts:36:4 (i32.shr_u (get_global $binary/i) - ;;@ binary.ts:36:10 (i32.const 1) ) ) - ;;@ binary.ts:37:0 (set_global $binary/i - ;;@ binary.ts:37:4 (i32.and (get_global $binary/i) - ;;@ binary.ts:37:8 (i32.const 1) ) ) - ;;@ binary.ts:38:0 (set_global $binary/i - ;;@ binary.ts:38:4 (i32.or (get_global $binary/i) - ;;@ binary.ts:38:8 (i32.const 1) ) ) - ;;@ binary.ts:39:0 (set_global $binary/i - ;;@ binary.ts:39:4 (i32.xor (get_global $binary/i) - ;;@ binary.ts:39:8 (i32.const 1) ) ) - ;;@ binary.ts:41:0 (set_global $binary/i (i32.add (get_global $binary/i) - ;;@ binary.ts:41:5 (i32.const 1) ) ) - ;;@ binary.ts:42:0 (set_global $binary/i (i32.sub (get_global $binary/i) - ;;@ binary.ts:42:5 (i32.const 1) ) ) - ;;@ binary.ts:43:0 (set_global $binary/i (i32.mul (get_global $binary/i) - ;;@ binary.ts:43:5 (i32.const 1) ) ) - ;;@ binary.ts:44:0 (set_global $binary/i (i32.rem_s (get_global $binary/i) - ;;@ binary.ts:44:5 (i32.const 1) ) ) - ;;@ binary.ts:45:0 (set_global $binary/i (i32.shl (get_global $binary/i) - ;;@ binary.ts:45:6 (i32.const 1) ) ) - ;;@ binary.ts:46:0 (set_global $binary/i (i32.shr_s (get_global $binary/i) - ;;@ binary.ts:46:6 (i32.const 1) ) ) - ;;@ binary.ts:47:0 (set_global $binary/i (i32.shr_u (get_global $binary/i) - ;;@ binary.ts:47:7 (i32.const 1) ) ) - ;;@ binary.ts:48:0 (set_global $binary/i (i32.and (get_global $binary/i) - ;;@ binary.ts:48:5 (i32.const 1) ) ) - ;;@ binary.ts:49:0 (set_global $binary/i (i32.or (get_global $binary/i) - ;;@ binary.ts:49:5 (i32.const 1) ) ) - ;;@ binary.ts:50:0 (set_global $binary/i (i32.xor (get_global $binary/i) - ;;@ binary.ts:50:5 (i32.const 1) ) ) - ;;@ binary.ts:63:0 (drop (i64.div_s (get_global $binary/I) - ;;@ binary.ts:63:4 (i64.const 1) ) ) - ;;@ binary.ts:64:0 (drop (i64.rem_s (get_global $binary/I) - ;;@ binary.ts:64:4 (i64.const 1) ) ) - ;;@ binary.ts:72:0 (set_global $binary/b - ;;@ binary.ts:72:4 (i64.lt_s (get_global $binary/I) - ;;@ binary.ts:72:8 (i64.const 1) ) ) - ;;@ binary.ts:73:0 (set_global $binary/b - ;;@ binary.ts:73:4 (i64.gt_s (get_global $binary/I) - ;;@ binary.ts:73:8 (i64.const 1) ) ) - ;;@ binary.ts:74:0 (set_global $binary/b - ;;@ binary.ts:74:4 (i64.le_s (get_global $binary/I) - ;;@ binary.ts:74:9 (i64.const 1) ) ) - ;;@ binary.ts:75:0 (set_global $binary/b - ;;@ binary.ts:75:4 (i64.ge_s (get_global $binary/I) - ;;@ binary.ts:75:9 (i64.const 1) ) ) - ;;@ binary.ts:76:0 (set_global $binary/b - ;;@ binary.ts:76:4 (i64.eq (get_global $binary/I) - ;;@ binary.ts:76:9 (i64.const 1) ) ) - ;;@ binary.ts:77:0 (set_global $binary/b - ;;@ binary.ts:77:4 (i64.eq (get_global $binary/I) - ;;@ binary.ts:77:10 (i64.const 1) ) ) - ;;@ binary.ts:78:0 (set_global $binary/I - ;;@ binary.ts:78:4 (i64.add (get_global $binary/I) - ;;@ binary.ts:78:8 (i64.const 1) ) ) - ;;@ binary.ts:79:0 (set_global $binary/I - ;;@ binary.ts:79:4 (i64.sub (get_global $binary/I) - ;;@ binary.ts:79:8 (i64.const 1) ) ) - ;;@ binary.ts:80:0 (set_global $binary/I - ;;@ binary.ts:80:4 (i64.mul (get_global $binary/I) - ;;@ binary.ts:80:8 (i64.const 1) ) ) - ;;@ binary.ts:81:0 (set_global $binary/I - ;;@ binary.ts:81:4 (i64.div_s (get_global $binary/I) - ;;@ binary.ts:81:8 (i64.const 1) ) ) - ;;@ binary.ts:82:0 (set_global $binary/I - ;;@ binary.ts:82:4 (i64.rem_s (get_global $binary/I) - ;;@ binary.ts:82:8 (i64.const 1) ) ) - ;;@ binary.ts:83:0 (set_global $binary/I - ;;@ binary.ts:83:4 (i64.shl (get_global $binary/I) - ;;@ binary.ts:83:9 (i64.const 1) ) ) - ;;@ binary.ts:84:0 (set_global $binary/I - ;;@ binary.ts:84:4 (i64.shr_s (get_global $binary/I) - ;;@ binary.ts:84:9 (i64.const 1) ) ) - ;;@ binary.ts:85:0 (set_global $binary/I - ;;@ binary.ts:85:4 (i64.shr_u (get_global $binary/I) - ;;@ binary.ts:85:10 (i64.const 1) ) ) - ;;@ binary.ts:86:0 (set_global $binary/I - ;;@ binary.ts:86:4 (i64.and (get_global $binary/I) - ;;@ binary.ts:86:8 (i64.const 1) ) ) - ;;@ binary.ts:87:0 (set_global $binary/I - ;;@ binary.ts:87:4 (i64.or (get_global $binary/I) - ;;@ binary.ts:87:8 (i64.const 1) ) ) - ;;@ binary.ts:88:0 (set_global $binary/I - ;;@ binary.ts:88:4 (i64.xor (get_global $binary/I) - ;;@ binary.ts:88:8 (i64.const 1) ) ) - ;;@ binary.ts:90:0 (set_global $binary/I (i64.add (get_global $binary/I) - ;;@ binary.ts:90:5 (i64.const 1) ) ) - ;;@ binary.ts:91:0 (set_global $binary/I (i64.sub (get_global $binary/I) - ;;@ binary.ts:91:5 (i64.const 1) ) ) - ;;@ binary.ts:92:0 (set_global $binary/I (i64.mul (get_global $binary/I) - ;;@ binary.ts:92:5 (i64.const 1) ) ) - ;;@ binary.ts:93:0 (set_global $binary/I (i64.rem_s (get_global $binary/I) - ;;@ binary.ts:93:5 (i64.const 1) ) ) - ;;@ binary.ts:94:0 (set_global $binary/I (i64.shl (get_global $binary/I) - ;;@ binary.ts:94:6 (i64.const 1) ) ) - ;;@ binary.ts:95:0 (set_global $binary/I (i64.shr_s (get_global $binary/I) - ;;@ binary.ts:95:6 (i64.const 1) ) ) - ;;@ binary.ts:96:0 (set_global $binary/I (i64.shr_u (get_global $binary/I) - ;;@ binary.ts:96:7 (i64.const 1) ) ) - ;;@ binary.ts:97:0 (set_global $binary/I (i64.and (get_global $binary/I) - ;;@ binary.ts:97:5 (i64.const 1) ) ) - ;;@ binary.ts:98:0 (set_global $binary/I (i64.or (get_global $binary/I) - ;;@ binary.ts:98:5 (i64.const 1) ) ) - ;;@ binary.ts:99:0 (set_global $binary/I (i64.xor (get_global $binary/I) - ;;@ binary.ts:99:5 (i64.const 1) ) ) - ;;@ binary.ts:115:0 (set_global $binary/b - ;;@ binary.ts:115:4 (f32.lt (get_global $binary/f) - ;;@ binary.ts:115:8 (f32.const 1) ) ) - ;;@ binary.ts:116:0 (set_global $binary/b - ;;@ binary.ts:116:4 (f32.gt (get_global $binary/f) - ;;@ binary.ts:116:8 (f32.const 1) ) ) - ;;@ binary.ts:117:0 (set_global $binary/b - ;;@ binary.ts:117:4 (f32.le (get_global $binary/f) - ;;@ binary.ts:117:9 (f32.const 1) ) ) - ;;@ binary.ts:118:0 (set_global $binary/b - ;;@ binary.ts:118:4 (f32.ge (get_global $binary/f) - ;;@ binary.ts:118:9 (f32.const 1) ) ) - ;;@ binary.ts:119:0 (set_global $binary/b - ;;@ binary.ts:119:4 (f32.eq (get_global $binary/f) - ;;@ binary.ts:119:9 (f32.const 1) ) ) - ;;@ binary.ts:120:0 (set_global $binary/b - ;;@ binary.ts:120:4 (f32.eq (get_global $binary/f) - ;;@ binary.ts:120:10 (f32.const 1) ) ) - ;;@ binary.ts:121:0 (set_global $binary/f - ;;@ binary.ts:121:4 (f32.add (get_global $binary/f) - ;;@ binary.ts:121:8 (f32.const 1) ) ) - ;;@ binary.ts:122:0 (set_global $binary/f - ;;@ binary.ts:122:4 (f32.sub (get_global $binary/f) - ;;@ binary.ts:122:8 (f32.const 1) ) ) - ;;@ binary.ts:123:0 (set_global $binary/f - ;;@ binary.ts:123:4 (f32.mul (get_global $binary/f) - ;;@ binary.ts:123:8 (f32.const 1) ) ) - ;;@ binary.ts:124:0 (set_global $binary/f - ;;@ binary.ts:124:4 (f32.div (get_global $binary/f) - ;;@ binary.ts:124:8 (f32.const 1) ) ) - ;;@ binary.ts:127:0 (set_global $binary/f (f32.add (get_global $binary/f) - ;;@ binary.ts:127:5 (f32.const 1) ) ) - ;;@ binary.ts:128:0 (set_global $binary/f (f32.sub (get_global $binary/f) - ;;@ binary.ts:128:5 (f32.const 1) ) ) - ;;@ binary.ts:129:0 (set_global $binary/f (f32.mul (get_global $binary/f) - ;;@ binary.ts:129:5 (f32.const 1) ) ) - ;;@ binary.ts:146:0 (set_global $binary/b - ;;@ binary.ts:146:4 (f64.lt (get_global $binary/F) - ;;@ binary.ts:146:8 (f64.const 1) ) ) - ;;@ binary.ts:147:0 (set_global $binary/b - ;;@ binary.ts:147:4 (f64.gt (get_global $binary/F) - ;;@ binary.ts:147:8 (f64.const 1) ) ) - ;;@ binary.ts:148:0 (set_global $binary/b - ;;@ binary.ts:148:4 (f64.le (get_global $binary/F) - ;;@ binary.ts:148:9 (f64.const 1) ) ) - ;;@ binary.ts:149:0 (set_global $binary/b - ;;@ binary.ts:149:4 (f64.ge (get_global $binary/F) - ;;@ binary.ts:149:9 (f64.const 1) ) ) - ;;@ binary.ts:150:0 (set_global $binary/b - ;;@ binary.ts:150:4 (f64.eq (get_global $binary/F) - ;;@ binary.ts:150:9 (f64.const 1) ) ) - ;;@ binary.ts:151:0 (set_global $binary/b - ;;@ binary.ts:151:4 (f64.eq (get_global $binary/F) - ;;@ binary.ts:151:10 (f64.const 1) ) ) - ;;@ binary.ts:152:0 (set_global $binary/F - ;;@ binary.ts:152:4 (f64.add (get_global $binary/F) - ;;@ binary.ts:152:8 (f64.const 1) ) ) - ;;@ binary.ts:153:0 (set_global $binary/F - ;;@ binary.ts:153:4 (f64.sub (get_global $binary/F) - ;;@ binary.ts:153:8 (f64.const 1) ) ) - ;;@ binary.ts:154:0 (set_global $binary/F - ;;@ binary.ts:154:4 (f64.mul (get_global $binary/F) - ;;@ binary.ts:154:8 (f64.const 1) ) ) - ;;@ binary.ts:155:0 (set_global $binary/F - ;;@ binary.ts:155:4 (f64.div (get_global $binary/F) - ;;@ binary.ts:155:8 (f64.const 1) ) ) - ;;@ binary.ts:158:0 (set_global $binary/F (f64.add (get_global $binary/F) - ;;@ binary.ts:158:5 (f64.const 1) ) ) - ;;@ binary.ts:159:0 (set_global $binary/F (f64.sub (get_global $binary/F) - ;;@ binary.ts:159:5 (f64.const 1) ) ) - ;;@ binary.ts:160:0 (set_global $binary/F (f64.mul (get_global $binary/F) - ;;@ binary.ts:160:5 (f64.const 1) ) ) diff --git a/tests/compiler/binary.wast b/tests/compiler/binary.wast index 56fc727f..431ac9ab 100644 --- a/tests/compiler/binary.wast +++ b/tests/compiler/binary.wast @@ -1138,56 +1138,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: binary/b - GLOBAL: binary/i - GLOBAL: binary/I - GLOBAL: binary/f - GLOBAL: binary/F -[program.exports] - -;) diff --git a/tests/compiler/builtins.optimized.wast b/tests/compiler/builtins.optimized.wast index f734ae4c..d5a79156 100644 --- a/tests/compiler/builtins.optimized.wast +++ b/tests/compiler/builtins.optimized.wast @@ -1,5 +1,7 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $builtins/b (mut i32) (i32.const 0)) (global $builtins/i (mut i32) (i32.const 0)) (global $builtins/I (mut i64) (i64.const 0)) @@ -9,28 +11,26 @@ (global $builtins/U (mut i64) (i64.const 0)) (global $builtins/s (mut i32) (i32.const 0)) (memory $0 1) + (data (i32.const 8) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s") (export "test" (func $builtins/test)) (export "memory" (memory $0)) (start $start) - (func $builtins/test (; 0 ;) (type $v) + (func $builtins/test (; 1 ;) (type $v) (nop) ) - (func $start (; 1 ;) (type $v) + (func $start (; 2 ;) (type $v) (local $0 f32) (local $1 f64) (local $2 i32) (local $3 i32) (local $4 i64) (local $5 i64) - ;;@ builtins.ts:13:0 (drop (select (tee_local $2 - ;;@ builtins.ts:13:9 (i32.const 1) ) (tee_local $3 - ;;@ builtins.ts:13:12 (i32.const 2) ) (i32.gt_s @@ -39,29 +39,22 @@ ) ) ) - ;;@ builtins.ts:16:0 (set_global $builtins/i (i32.const 31) ) - ;;@ builtins.ts:17:0 (set_global $builtins/i (i32.const 0) ) - ;;@ builtins.ts:18:0 (set_global $builtins/i (i32.const 1) ) - ;;@ builtins.ts:19:0 (set_global $builtins/i (i32.const 2) ) - ;;@ builtins.ts:20:0 (set_global $builtins/i (i32.const -2147483648) ) - ;;@ builtins.ts:21:0 (set_global $builtins/i - ;;@ builtins.ts:21:4 (select (tee_local $2 (i32.const -42) @@ -76,25 +69,26 @@ ) ) ) - ;;@ builtins.ts:21:19 (if - ;;@ builtins.ts:21:26 (i32.ne (get_global $builtins/i) - ;;@ builtins.ts:21:31 (i32.const 42) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 21) + (i32.const 19) + ) + (unreachable) + ) ) - ;;@ builtins.ts:22:0 (set_global $builtins/i - ;;@ builtins.ts:22:4 (select (tee_local $2 - ;;@ builtins.ts:22:13 (i32.const 1) ) - ;;@ builtins.ts:22:16 (i32.const 2) (i32.gt_s (get_local $2) @@ -102,23 +96,24 @@ ) ) ) - ;;@ builtins.ts:22:20 (if - ;;@ builtins.ts:22:27 (i32.ne (get_global $builtins/i) - ;;@ builtins.ts:22:32 (i32.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 22) + (i32.const 20) + ) + (unreachable) + ) ) - ;;@ builtins.ts:23:0 (set_global $builtins/i - ;;@ builtins.ts:23:4 (select - ;;@ builtins.ts:23:13 (i32.const 1) - ;;@ builtins.ts:23:16 (i32.const 2) (i32.lt_s (get_local $2) @@ -126,39 +121,37 @@ ) ) ) - ;;@ builtins.ts:23:20 (if - ;;@ builtins.ts:23:27 (i32.ne (get_global $builtins/i) - ;;@ builtins.ts:23:32 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 23) + (i32.const 20) + ) + (unreachable) + ) ) - ;;@ builtins.ts:34:0 (set_global $builtins/I (i64.const 63) ) - ;;@ builtins.ts:35:0 (set_global $builtins/I (i64.const 0) ) - ;;@ builtins.ts:36:0 (set_global $builtins/I (i64.const 1) ) - ;;@ builtins.ts:37:0 (set_global $builtins/I (i64.const 2) ) - ;;@ builtins.ts:38:0 (set_global $builtins/I (i64.const -9223372036854775808) ) - ;;@ builtins.ts:39:0 (set_global $builtins/I - ;;@ builtins.ts:39:4 (select (tee_local $4 (i64.const -42) @@ -173,26 +166,27 @@ ) ) ) - ;;@ builtins.ts:39:19 (if - ;;@ builtins.ts:39:26 (i64.ne (get_global $builtins/I) - ;;@ builtins.ts:39:31 (i64.const 42) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 39) + (i32.const 19) + ) + (unreachable) + ) ) - ;;@ builtins.ts:40:0 (set_global $builtins/I - ;;@ builtins.ts:40:4 (select (tee_local $4 - ;;@ builtins.ts:40:13 (i64.const 1) ) (tee_local $5 - ;;@ builtins.ts:40:16 (i64.const 2) ) (i64.gt_s @@ -201,23 +195,24 @@ ) ) ) - ;;@ builtins.ts:40:20 (if - ;;@ builtins.ts:40:27 (i64.ne (get_global $builtins/I) - ;;@ builtins.ts:40:32 (i64.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 40) + (i32.const 20) + ) + (unreachable) + ) ) - ;;@ builtins.ts:41:0 (set_global $builtins/I - ;;@ builtins.ts:41:4 (select - ;;@ builtins.ts:41:13 (i64.const 1) - ;;@ builtins.ts:41:16 (i64.const 2) (i64.lt_s (get_local $4) @@ -225,80 +220,66 @@ ) ) ) - ;;@ builtins.ts:41:20 (if - ;;@ builtins.ts:41:27 (i32.ne (get_global $builtins/i) - ;;@ builtins.ts:41:32 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 41) + (i32.const 20) + ) + (unreachable) + ) ) - ;;@ builtins.ts:61:0 (set_global $builtins/f - ;;@ builtins.ts:61:4 (f32.const nan:0x400000) ) - ;;@ builtins.ts:62:0 (set_global $builtins/f - ;;@ builtins.ts:62:4 (f32.const inf) ) - ;;@ builtins.ts:63:0 (set_global $builtins/f (f32.const 1.25) ) - ;;@ builtins.ts:64:0 (set_global $builtins/f (f32.const 2) ) - ;;@ builtins.ts:65:0 (set_global $builtins/f (f32.const 1.25) ) - ;;@ builtins.ts:66:0 (set_global $builtins/f (f32.const 1) ) - ;;@ builtins.ts:67:0 (set_global $builtins/f (f32.const 2.5) ) - ;;@ builtins.ts:68:0 (set_global $builtins/f (f32.const 1.25) ) - ;;@ builtins.ts:69:0 (set_global $builtins/f (f32.const 1.25) ) - ;;@ builtins.ts:70:0 (set_global $builtins/f (f32.const 1.1180340051651) ) - ;;@ builtins.ts:71:0 (set_global $builtins/f (f32.const 1) ) - ;;@ builtins.ts:72:0 (set_global $builtins/b - ;;@ builtins.ts:72:4 (f32.ne (tee_local $0 - ;;@ builtins.ts:72:15 (f32.const 1.25) ) (get_local $0) ) ) - ;;@ builtins.ts:73:0 (set_global $builtins/b - ;;@ builtins.ts:73:4 (select (f32.ne (f32.abs - ;;@ builtins.ts:73:18 (f32.const 1.25) ) (f32.const inf) @@ -310,70 +291,51 @@ ) ) ) - ;;@ builtins.ts:93:0 (set_global $builtins/F - ;;@ builtins.ts:93:4 (f64.const nan:0x8000000000000) ) - ;;@ builtins.ts:94:0 (set_global $builtins/F - ;;@ builtins.ts:94:4 (f64.const inf) ) - ;;@ builtins.ts:95:0 (set_global $builtins/F (f64.const 1.25) ) - ;;@ builtins.ts:96:0 (set_global $builtins/F (f64.const 2) ) - ;;@ builtins.ts:97:0 (set_global $builtins/F (f64.const 1.25) ) - ;;@ builtins.ts:98:0 (set_global $builtins/F (f64.const 1) ) - ;;@ builtins.ts:99:0 (set_global $builtins/F (f64.const 2.5) ) - ;;@ builtins.ts:100:0 (set_global $builtins/F (f64.const 1.25) ) - ;;@ builtins.ts:101:0 (set_global $builtins/F (f64.const 1) ) - ;;@ builtins.ts:102:0 (set_global $builtins/F (f64.const 1.118033988749895) ) - ;;@ builtins.ts:103:0 (set_global $builtins/F (f64.const 1) ) - ;;@ builtins.ts:104:0 (set_global $builtins/b - ;;@ builtins.ts:104:4 (f64.ne (tee_local $1 - ;;@ builtins.ts:104:15 (f64.const 1.25) ) (get_local $1) ) ) - ;;@ builtins.ts:105:0 (set_global $builtins/b - ;;@ builtins.ts:105:4 (select (f64.ne (f64.abs - ;;@ builtins.ts:105:18 (f64.const 1.25) ) (f64.const inf) @@ -385,509 +347,337 @@ ) ) ) - ;;@ builtins.ts:109:0 (set_global $builtins/i - ;;@ builtins.ts:109:4 (i32.load - ;;@ builtins.ts:109:14 (i32.const 8) ) ) - ;;@ builtins.ts:109:18 (i32.store - ;;@ builtins.ts:109:29 (i32.const 8) - ;;@ builtins.ts:109:32 (get_global $builtins/i) ) - ;;@ builtins.ts:110:0 (i32.store - ;;@ builtins.ts:110:11 (i32.const 8) - ;;@ builtins.ts:110:14 (i32.load - ;;@ builtins.ts:110:24 (i32.const 8) ) ) - ;;@ builtins.ts:111:0 (set_global $builtins/I - ;;@ builtins.ts:111:4 (i64.load - ;;@ builtins.ts:111:14 (i32.const 8) ) ) - ;;@ builtins.ts:111:18 (i64.store - ;;@ builtins.ts:111:29 (i32.const 8) - ;;@ builtins.ts:111:32 (get_global $builtins/I) ) - ;;@ builtins.ts:112:0 (i64.store - ;;@ builtins.ts:112:11 (i32.const 8) - ;;@ builtins.ts:112:14 (i64.load - ;;@ builtins.ts:112:24 (i32.const 8) ) ) - ;;@ builtins.ts:113:0 (set_global $builtins/f - ;;@ builtins.ts:113:4 (f32.load - ;;@ builtins.ts:113:14 (i32.const 8) ) ) - ;;@ builtins.ts:113:18 (f32.store - ;;@ builtins.ts:113:29 (i32.const 8) - ;;@ builtins.ts:113:32 (get_global $builtins/f) ) - ;;@ builtins.ts:114:0 (f32.store - ;;@ builtins.ts:114:11 (i32.const 8) - ;;@ builtins.ts:114:14 (f32.load - ;;@ builtins.ts:114:24 (i32.const 8) ) ) - ;;@ builtins.ts:115:0 (set_global $builtins/F - ;;@ builtins.ts:115:4 (f64.load - ;;@ builtins.ts:115:14 (i32.const 8) ) ) - ;;@ builtins.ts:115:18 (f64.store - ;;@ builtins.ts:115:29 (i32.const 8) - ;;@ builtins.ts:115:32 (get_global $builtins/F) ) - ;;@ builtins.ts:116:0 (f64.store - ;;@ builtins.ts:116:11 (i32.const 8) - ;;@ builtins.ts:116:14 (f64.load - ;;@ builtins.ts:116:24 (i32.const 8) ) ) - ;;@ builtins.ts:119:0 (set_global $builtins/i - ;;@ builtins.ts:119:4 (i32.load - ;;@ builtins.ts:119:14 (i32.const 8) ) ) - ;;@ builtins.ts:119:34 (i32.store - ;;@ builtins.ts:119:45 (i32.const 8) - ;;@ builtins.ts:119:48 (get_global $builtins/i) ) - ;;@ builtins.ts:120:0 (i32.store - ;;@ builtins.ts:120:11 (i32.const 8) - ;;@ builtins.ts:120:14 (i32.load - ;;@ builtins.ts:120:24 (i32.const 8) ) ) - ;;@ builtins.ts:121:0 (set_global $builtins/I - ;;@ builtins.ts:121:4 (i64.load - ;;@ builtins.ts:121:14 (i32.const 8) ) ) - ;;@ builtins.ts:121:34 (i64.store - ;;@ builtins.ts:121:45 (i32.const 8) - ;;@ builtins.ts:121:48 (get_global $builtins/I) ) - ;;@ builtins.ts:122:0 (i64.store - ;;@ builtins.ts:122:11 (i32.const 8) - ;;@ builtins.ts:122:14 (i64.load - ;;@ builtins.ts:122:24 (i32.const 8) ) ) - ;;@ builtins.ts:123:0 (set_global $builtins/f - ;;@ builtins.ts:123:4 (f32.load - ;;@ builtins.ts:123:14 (i32.const 8) ) ) - ;;@ builtins.ts:123:34 (f32.store - ;;@ builtins.ts:123:45 (i32.const 8) - ;;@ builtins.ts:123:48 (get_global $builtins/f) ) - ;;@ builtins.ts:124:0 (f32.store - ;;@ builtins.ts:124:11 (i32.const 8) - ;;@ builtins.ts:124:14 (f32.load - ;;@ builtins.ts:124:24 (i32.const 8) ) ) - ;;@ builtins.ts:125:0 (set_global $builtins/F - ;;@ builtins.ts:125:4 (f64.load - ;;@ builtins.ts:125:14 (i32.const 8) ) ) - ;;@ builtins.ts:125:34 (f64.store - ;;@ builtins.ts:125:45 (i32.const 8) - ;;@ builtins.ts:125:48 (get_global $builtins/F) ) - ;;@ builtins.ts:126:0 (f64.store - ;;@ builtins.ts:126:11 (i32.const 8) - ;;@ builtins.ts:126:14 (f64.load - ;;@ builtins.ts:126:24 (i32.const 8) ) ) - ;;@ builtins.ts:130:0 (set_global $builtins/i - ;;@ builtins.ts:130:4 (i32.load8_s - ;;@ builtins.ts:130:13 (i32.const 8) ) ) - ;;@ builtins.ts:131:0 (set_global $builtins/i - ;;@ builtins.ts:131:4 (i32.load16_s - ;;@ builtins.ts:131:14 (i32.const 8) ) ) - ;;@ builtins.ts:132:0 (set_global $builtins/i - ;;@ builtins.ts:132:4 (i32.load - ;;@ builtins.ts:132:14 (i32.const 8) ) ) - ;;@ builtins.ts:134:0 (set_global $builtins/i - ;;@ builtins.ts:134:4 (i32.load8_u - ;;@ builtins.ts:134:13 (i32.const 8) ) ) - ;;@ builtins.ts:135:0 (set_global $builtins/i - ;;@ builtins.ts:135:4 (i32.load16_u - ;;@ builtins.ts:135:14 (i32.const 8) ) ) - ;;@ builtins.ts:136:0 (set_global $builtins/i - ;;@ builtins.ts:136:4 (i32.load - ;;@ builtins.ts:136:14 (i32.const 8) ) ) - ;;@ builtins.ts:139:0 (set_global $builtins/u - ;;@ builtins.ts:139:4 (i32.load8_u - ;;@ builtins.ts:139:13 (i32.const 8) ) ) - ;;@ builtins.ts:140:0 (set_global $builtins/u - ;;@ builtins.ts:140:4 (i32.load16_u - ;;@ builtins.ts:140:14 (i32.const 8) ) ) - ;;@ builtins.ts:141:0 (set_global $builtins/u - ;;@ builtins.ts:141:4 (i32.load - ;;@ builtins.ts:141:14 (i32.const 8) ) ) - ;;@ builtins.ts:143:0 (set_global $builtins/u - ;;@ builtins.ts:143:4 (i32.load8_s - ;;@ builtins.ts:143:13 (i32.const 8) ) ) - ;;@ builtins.ts:144:0 (set_global $builtins/u - ;;@ builtins.ts:144:4 (i32.load16_s - ;;@ builtins.ts:144:14 (i32.const 8) ) ) - ;;@ builtins.ts:145:0 (set_global $builtins/u - ;;@ builtins.ts:145:4 (i32.load - ;;@ builtins.ts:145:14 (i32.const 8) ) ) - ;;@ builtins.ts:147:0 (set_global $builtins/I - ;;@ builtins.ts:147:4 (i64.load8_s - ;;@ builtins.ts:147:13 (i32.const 8) ) ) - ;;@ builtins.ts:148:0 (set_global $builtins/I - ;;@ builtins.ts:148:4 (i64.load16_s - ;;@ builtins.ts:148:14 (i32.const 8) ) ) - ;;@ builtins.ts:149:0 (set_global $builtins/I - ;;@ builtins.ts:149:4 (i64.load32_s - ;;@ builtins.ts:149:14 (i32.const 8) ) ) - ;;@ builtins.ts:150:0 (set_global $builtins/I - ;;@ builtins.ts:150:4 (i64.load - ;;@ builtins.ts:150:14 (i32.const 8) ) ) - ;;@ builtins.ts:153:0 (set_global $builtins/U - ;;@ builtins.ts:153:4 (i64.load8_u - ;;@ builtins.ts:153:13 (i32.const 8) ) ) - ;;@ builtins.ts:154:0 (set_global $builtins/U - ;;@ builtins.ts:154:4 (i64.load16_u - ;;@ builtins.ts:154:14 (i32.const 8) ) ) - ;;@ builtins.ts:155:0 (set_global $builtins/U - ;;@ builtins.ts:155:4 (i64.load32_u - ;;@ builtins.ts:155:14 (i32.const 8) ) ) - ;;@ builtins.ts:156:0 (set_global $builtins/U - ;;@ builtins.ts:156:4 (i64.load - ;;@ builtins.ts:156:14 (i32.const 8) ) ) - ;;@ builtins.ts:158:0 (i32.store8 - ;;@ builtins.ts:158:10 (i32.const 8) - ;;@ builtins.ts:158:13 (i32.const 1) ) - ;;@ builtins.ts:159:0 (i32.store16 - ;;@ builtins.ts:159:11 (i32.const 8) - ;;@ builtins.ts:159:14 (i32.const 1) ) - ;;@ builtins.ts:160:0 (i32.store - ;;@ builtins.ts:160:11 (i32.const 8) - ;;@ builtins.ts:160:14 (i32.const 1) ) - ;;@ builtins.ts:162:0 (i64.store8 - ;;@ builtins.ts:162:10 (i32.const 8) - ;;@ builtins.ts:162:13 (i64.const 1) ) - ;;@ builtins.ts:163:0 (i64.store16 - ;;@ builtins.ts:163:11 (i32.const 8) - ;;@ builtins.ts:163:14 (i64.const 1) ) - ;;@ builtins.ts:164:0 (i64.store32 - ;;@ builtins.ts:164:11 (i32.const 8) - ;;@ builtins.ts:164:14 (i64.const 1) ) - ;;@ builtins.ts:165:0 (i64.store - ;;@ builtins.ts:165:11 (i32.const 8) - ;;@ builtins.ts:165:14 (i64.const 1) ) - ;;@ builtins.ts:167:0 (i64.store - ;;@ builtins.ts:167:11 (i32.const 8) (i64.const 1) ) - ;;@ builtins.ts:176:0 (set_global $builtins/i (i32.const 1067450368) ) - ;;@ builtins.ts:177:0 (set_global $builtins/f (f32.const 3.5032461608120427e-44) ) - ;;@ builtins.ts:178:0 (set_global $builtins/I (i64.const 4608308318706860032) ) - ;;@ builtins.ts:179:0 (set_global $builtins/F (f64.const 1.24e-322) ) - ;;@ builtins.ts:185:0 (drop (current_memory) ) - ;;@ builtins.ts:186:0 (drop (grow_memory - ;;@ builtins.ts:186:12 (i32.const 1) ) ) - ;;@ builtins.ts:188:0 (set_global $builtins/s - ;;@ builtins.ts:188:4 (current_memory) ) - ;;@ builtins.ts:189:0 (set_global $builtins/s - ;;@ builtins.ts:189:4 (grow_memory - ;;@ builtins.ts:189:16 (i32.const 1) ) ) - ;;@ builtins.ts:198:0 (set_global $builtins/i (i32.const 10) ) - ;;@ builtins.ts:199:0 (set_global $builtins/I (i64.const 200) ) - ;;@ builtins.ts:200:0 (set_global $builtins/f (f32.const 1.25) ) - ;;@ builtins.ts:201:0 (set_global $builtins/F (f64.const 25) ) - ;;@ builtins.ts:222:0 (if - ;;@ builtins.ts:222:7 (f32.eq (tee_local $0 - ;;@ builtins.ts:222:18 (f32.const nan:0x400000) ) (get_local $0) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 222) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ builtins.ts:223:0 (if - ;;@ builtins.ts:223:7 (f64.eq (tee_local $1 - ;;@ builtins.ts:223:18 (f64.const nan:0x8000000000000) ) (get_local $1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 223) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ builtins.ts:224:0 (if - ;;@ builtins.ts:224:8 (select (f32.ne (f32.abs (tee_local $0 - ;;@ builtins.ts:224:22 (f32.const nan:0x400000) ) ) @@ -899,16 +689,21 @@ (get_local $0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 224) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ builtins.ts:225:0 (if - ;;@ builtins.ts:225:8 (select (f32.ne (f32.abs (tee_local $0 - ;;@ builtins.ts:225:22 (f32.const inf) ) ) @@ -920,16 +715,21 @@ (get_local $0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 225) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ builtins.ts:226:0 (if - ;;@ builtins.ts:226:8 (select (f64.ne (f64.abs (tee_local $1 - ;;@ builtins.ts:226:22 (f64.const nan:0x8000000000000) ) ) @@ -941,16 +741,21 @@ (get_local $1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 226) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ builtins.ts:227:0 (if - ;;@ builtins.ts:227:8 (select (f64.ne (f64.abs (tee_local $1 - ;;@ builtins.ts:227:22 (f64.const inf) ) ) @@ -962,17 +767,22 @@ (get_local $1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 227) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ builtins.ts:228:0 (if (i32.eqz - ;;@ builtins.ts:228:7 (select (f32.ne (f32.abs (tee_local $0 - ;;@ builtins.ts:228:21 (f32.const 0) ) ) @@ -985,17 +795,22 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 228) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ builtins.ts:229:0 (if (i32.eqz - ;;@ builtins.ts:229:7 (select (f64.ne (f64.abs (tee_local $1 - ;;@ builtins.ts:229:21 (f64.const 0) ) ) @@ -1008,7 +823,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 229) + (i32.const 0) + ) + (unreachable) + ) ) ) ) diff --git a/tests/compiler/builtins.wast b/tests/compiler/builtins.wast index b79ffcdc..1b6095c1 100644 --- a/tests/compiler/builtins.wast +++ b/tests/compiler/builtins.wast @@ -1,6 +1,8 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $i (func (result i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $builtins/b (mut i32) (i32.const 0)) (global $builtins/i (mut i32) (i32.const 0)) (global $builtins/I (mut i64) (i64.const 0)) @@ -38,14 +40,15 @@ (global $f64.MIN_SAFE_INTEGER f64 (f64.const -9007199254740991)) (global $f64.MAX_SAFE_INTEGER f64 (f64.const 9007199254740991)) (global $f64.EPSILON f64 (f64.const 2.220446049250313e-16)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 36)) (memory $0 1) + (data (i32.const 8) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s\00") (export "test" (func $builtins/test)) (export "memory" (memory $0)) (start $start) - (func $builtins/test (; 0 ;) (type $v) + (func $builtins/test (; 1 ;) (type $v) ) - (func $start (; 1 ;) (type $v) + (func $start (; 2 ;) (type $v) (local $0 i32) (local $1 i32) (local $2 i64) @@ -222,7 +225,15 @@ (i32.const 42) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 21) + (i32.const 19) + ) + (unreachable) + ) ) ;;@ builtins.ts:22:0 (set_global $builtins/i @@ -252,7 +263,15 @@ (i32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 22) + (i32.const 20) + ) + (unreachable) + ) ) ;;@ builtins.ts:23:0 (set_global $builtins/i @@ -282,7 +301,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 23) + (i32.const 20) + ) + (unreachable) + ) ) ;;@ builtins.ts:27:0 (drop @@ -420,7 +447,15 @@ (i64.const 42) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 39) + (i32.const 19) + ) + (unreachable) + ) ) ;;@ builtins.ts:40:0 (set_global $builtins/I @@ -450,7 +485,15 @@ (i64.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 40) + (i32.const 20) + ) + (unreachable) + ) ) ;;@ builtins.ts:41:0 (set_global $builtins/I @@ -480,7 +523,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 41) + (i32.const 20) + ) + (unreachable) + ) ) ;;@ builtins.ts:47:0 (drop @@ -1607,7 +1658,15 @@ (f64.const nan:0x8000000000000) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 221) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:222:0 (if @@ -1621,7 +1680,15 @@ (get_local $4) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 222) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:223:0 (if @@ -1635,7 +1702,15 @@ (get_local $5) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 223) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:224:0 (if @@ -1661,7 +1736,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 224) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:225:0 (if @@ -1687,7 +1770,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 225) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:226:0 (if @@ -1713,7 +1804,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 226) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:227:0 (if @@ -1739,7 +1838,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 227) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:228:0 (if @@ -1762,7 +1869,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 228) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:229:0 (if @@ -1785,7 +1900,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 229) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:242:0 (if @@ -1797,7 +1920,15 @@ (i32.const -128) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 242) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:243:0 (if @@ -1809,7 +1940,15 @@ (i32.const 127) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 243) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:244:0 (if @@ -1821,7 +1960,15 @@ (i32.const -32768) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 244) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:245:0 (if @@ -1833,7 +1980,15 @@ (i32.const 32767) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 245) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:246:0 (if @@ -1845,7 +2000,15 @@ (i32.const -2147483648) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 246) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:247:0 (if @@ -1857,7 +2020,15 @@ (i32.const 2147483647) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 247) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:248:0 (if @@ -1869,7 +2040,15 @@ (i64.const -9223372036854775808) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 248) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:249:0 (if @@ -1881,7 +2060,15 @@ (i64.const 9223372036854775807) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 249) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:251:0 (if @@ -1893,7 +2080,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 251) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:252:0 (if @@ -1905,7 +2100,15 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 252) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:253:0 (if @@ -1917,7 +2120,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 253) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:254:0 (if @@ -1929,7 +2140,15 @@ (i32.const 65535) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 254) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:255:0 (if @@ -1941,7 +2160,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 255) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:256:0 (if @@ -1953,7 +2180,15 @@ (i32.const -1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 256) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:257:0 (if @@ -1965,7 +2200,15 @@ (i64.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 257) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:258:0 (if @@ -1977,7 +2220,15 @@ (i64.const -1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 258) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:259:0 (if @@ -1989,7 +2240,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 259) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:259:29 (if @@ -2001,7 +2260,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 259) + (i32.const 29) + ) + (unreachable) + ) ) ;;@ builtins.ts:260:0 (if @@ -2013,7 +2280,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 260) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:260:29 (if @@ -2025,7 +2300,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 260) + (i32.const 29) + ) + (unreachable) + ) ) ;;@ builtins.ts:262:0 (if @@ -2040,7 +2323,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 262) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:263:0 (if @@ -2052,7 +2343,15 @@ (f32.const 3402823466385288598117041e14) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 263) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:264:0 (if @@ -2067,7 +2366,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 264) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:265:0 (if @@ -2079,7 +2386,15 @@ (f32.const 16777215) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 265) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:266:0 (if @@ -2091,7 +2406,15 @@ (f32.const 1.1920928955078125e-07) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 266) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:267:0 (if @@ -2106,7 +2429,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 267) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:268:0 (if @@ -2118,7 +2449,15 @@ (f64.const 1797693134862315708145274e284) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 268) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:269:0 (if @@ -2133,7 +2472,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 269) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:270:0 (if @@ -2145,7 +2492,15 @@ (f64.const 9007199254740991) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 270) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:271:0 (if @@ -2157,65 +2512,15 @@ (f64.const 2.220446049250313e-16) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 271) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: builtins/b - GLOBAL: builtins/i - GLOBAL: builtins/I - GLOBAL: builtins/f - GLOBAL: builtins/F - GLOBAL: builtins/constantOffset - GLOBAL: builtins/u - GLOBAL: builtins/U - GLOBAL: builtins/s - FUNCTION_PROTOTYPE: builtins/test -[program.exports] - FUNCTION_PROTOTYPE: builtins/test -;) diff --git a/tests/compiler/class-extends.optimized.wast b/tests/compiler/class-extends.optimized.wast index 3fc6ef4b..bb1cfa98 100644 --- a/tests/compiler/class-extends.optimized.wast +++ b/tests/compiler/class-extends.optimized.wast @@ -4,28 +4,22 @@ (export "test" (func $class-extends/test)) (export "memory" (memory $0)) (func $class-extends/test (; 0 ;) (type $iv) (param $0 i32) - ;;@ class-extends.ts:10:2 (drop (i32.load (get_local $0) ) ) - ;;@ class-extends.ts:11:2 (drop (i32.load16_s offset=4 (get_local $0) ) ) - ;;@ class-extends.ts:12:2 (i32.store (get_local $0) - ;;@ class-extends.ts:12:8 (i32.const 2) ) - ;;@ class-extends.ts:13:2 (i32.store16 offset=4 (get_local $0) - ;;@ class-extends.ts:13:8 (i32.const 3) ) ) diff --git a/tests/compiler/class-extends.wast b/tests/compiler/class-extends.wast index 9d548954..36d78e7e 100644 --- a/tests/compiler/class-extends.wast +++ b/tests/compiler/class-extends.wast @@ -31,54 +31,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - CLASS_PROTOTYPE: class-extends/A - CLASS_PROTOTYPE: class-extends/B - FUNCTION_PROTOTYPE: class-extends/test -[program.exports] - FUNCTION_PROTOTYPE: class-extends/test -;) diff --git a/tests/compiler/class.optimized.wast b/tests/compiler/class.optimized.wast index 37cec1da..a00f2c0e 100644 --- a/tests/compiler/class.optimized.wast +++ b/tests/compiler/class.optimized.wast @@ -1,50 +1,112 @@ (module + (type $iii (func (param i32 i32) (result i32))) + (type $fff (func (param f32 f32) (result f32))) + (type $iiii (func (param i32 i32 i32) (result i32))) + (type $ifff (func (param i32 f32 f32) (result f32))) (type $ii (func (param i32) (result i32))) (type $v (func)) + (global $class/Animal.ONE (mut i32) (i32.const 1)) (memory $0 1) + (data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s") (export "test" (func $class/test)) (export "memory" (memory $0)) (start $start) - (func $class/test (; 0 ;) (type $ii) (param $0 i32) (result i32) - ;;@ class.ts:23:2 + (func $class/Animal.add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (get_global $class/Animal.ONE) + ) + ) + (func $class/Animal.sub (; 1 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) + (f32.add + (f32.sub + (get_local $0) + (get_local $1) + ) + (f32.convert_s/i32 + (get_global $class/Animal.ONE) + ) + ) + ) + (func $class/Animal#instanceAdd (; 2 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (i32.add + (i32.add + (get_local $1) + (get_local $2) + ) + (get_global $class/Animal.ONE) + ) + ) + (func $class/Animal#instanceSub (; 3 ;) (type $ifff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32) + (f32.add + (f32.sub + (get_local $1) + (get_local $2) + ) + (f32.convert_s/i32 + (get_global $class/Animal.ONE) + ) + ) + ) + (func $class/test (; 4 ;) (type $ii) (param $0 i32) (result i32) + (drop + (call $class/Animal#instanceAdd + (get_local $0) + (i32.const 1) + (i32.const 2) + ) + ) + (drop + (call $class/Animal#instanceSub + (get_local $0) + (f32.const 1) + (f32.const 2) + ) + ) (drop (i32.load (get_local $0) ) ) - ;;@ class.ts:24:2 (drop (i32.load16_s offset=4 (get_local $0) ) ) - ;;@ class.ts:25:2 (drop (i32.load8_s offset=6 (get_local $0) ) ) - ;;@ class.ts:27:2 (i32.store (get_local $0) (i32.const 1) ) - ;;@ class.ts:28:2 (i32.store16 offset=4 (get_local $0) - ;;@ class.ts:28:19 (i32.const 2) ) - ;;@ class.ts:29:2 (i32.store8 offset=6 (get_local $0) - ;;@ class.ts:29:25 (i32.const 3) ) - ;;@ class.ts:31:12 (get_local $0) ) - (func $start (; 1 ;) (type $v) - (nop) + (func $start (; 5 ;) (type $v) + (drop + (call $class/Animal.add + (i32.const 1) + (i32.const 2) + ) + ) + (drop + (call $class/Animal.sub + (f32.const 1) + (f32.const 2) + ) + ) ) ) diff --git a/tests/compiler/class.wast b/tests/compiler/class.wast index 4ce45766..be7e16f7 100644 --- a/tests/compiler/class.wast +++ b/tests/compiler/class.wast @@ -1,17 +1,20 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $iii (func (param i32 i32) (result i32))) (type $fff (func (param f32 f32) (result f32))) (type $iiii (func (param i32 i32 i32) (result i32))) (type $ifff (func (param i32 f32 f32) (result f32))) (type $ii (func (param i32) (result i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $class/Animal.ONE (mut i32) (i32.const 1)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 28)) (memory $0 1) + (data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s\00") (export "test" (func $class/test)) (export "memory" (memory $0)) (start $start) - (func $class/Animal.add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $class/Animal.add (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) ;;@ class.ts:3:58 (return ;;@ class.ts:3:43 @@ -26,7 +29,7 @@ ) ) ) - (func $class/Animal.sub (; 1 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) + (func $class/Animal.sub (; 2 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) ;;@ class.ts:4:58 (return ;;@ class.ts:4:40 @@ -43,7 +46,7 @@ ) ) ) - (func $class/Animal#instanceAdd (; 2 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $class/Animal#instanceAdd (; 3 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) ;;@ class.ts:9:59 (return ;;@ class.ts:9:44 @@ -58,7 +61,7 @@ ) ) ) - (func $class/Animal#instanceSub (; 3 ;) (type $ifff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32) + (func $class/Animal#instanceSub (; 4 ;) (type $ifff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32) ;;@ class.ts:10:59 (return ;;@ class.ts:10:41 @@ -75,7 +78,7 @@ ) ) ) - (func $class/test (; 4 ;) (type $ii) (param $0 i32) (result i32) + (func $class/test (; 5 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) ;;@ class.ts:20:9 @@ -179,7 +182,7 @@ (get_local $2) ) ) - (func $start (; 5 ;) (type $v) + (func $start (; 6 ;) (type $v) ;;@ class.ts:13:0 (if (i32.eqz @@ -190,7 +193,15 @@ (i32.const 4) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 13) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ class.ts:15:0 (drop @@ -216,56 +227,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - CLASS_PROTOTYPE: class/Animal - GLOBAL: class/Animal.ONE - FUNCTION_PROTOTYPE: class/Animal.add - FUNCTION_PROTOTYPE: class/Animal.sub - FUNCTION_PROTOTYPE: class/test -[program.exports] - FUNCTION_PROTOTYPE: class/test -;) diff --git a/tests/compiler/comma.optimized.wast b/tests/compiler/comma.optimized.wast index 8bebf0ea..9c37feaf 100644 --- a/tests/compiler/comma.optimized.wast +++ b/tests/compiler/comma.optimized.wast @@ -1,15 +1,16 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $comma/a (mut i32) (i32.const 0)) (global $comma/b (mut i32) (i32.const 0)) (memory $0 1) + (data (i32.const 8) "\08\00\00\00c\00o\00m\00m\00a\00.\00t\00s") (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $start (; 1 ;) (type $v) (local $0 i32) - ;;@ comma.ts:3:0 (set_global $comma/b - ;;@ comma.ts:3:4 (block (result i32) (set_global $comma/a (i32.add @@ -22,105 +23,123 @@ (get_local $0) ) ) - ;;@ comma.ts:4:0 (if - ;;@ comma.ts:4:7 (i32.ne (get_global $comma/a) - ;;@ comma.ts:4:12 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 4) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ comma.ts:5:0 (if - ;;@ comma.ts:5:7 (get_global $comma/b) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 5) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ comma.ts:7:0 (set_global $comma/a (i32.add (get_global $comma/a) (i32.const 1) ) ) - ;;@ comma.ts:7:5 (set_global $comma/b - ;;@ comma.ts:7:9 (get_global $comma/a) ) - ;;@ comma.ts:8:0 (if - ;;@ comma.ts:8:7 (i32.ne (get_global $comma/a) - ;;@ comma.ts:8:12 (i32.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 8) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ comma.ts:9:0 (if - ;;@ comma.ts:9:7 (i32.ne (get_global $comma/b) - ;;@ comma.ts:9:12 (i32.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 9) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ comma.ts:11:0 (set_global $comma/a - ;;@ comma.ts:11:4 (block (result i32) (set_global $comma/b - ;;@ comma.ts:11:8 (i32.const 0) ) (get_global $comma/b) ) ) - ;;@ comma.ts:13:0 (set_global $comma/b - ;;@ comma.ts:13:4 (block (result i32) - ;;@ comma.ts:13:5 (set_global $comma/a (i32.add (get_global $comma/a) (i32.const 1) ) ) - ;;@ comma.ts:13:10 (get_global $comma/a) ) ) - ;;@ comma.ts:14:0 (if - ;;@ comma.ts:14:7 (i32.ne (get_global $comma/a) - ;;@ comma.ts:14:12 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 14) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ comma.ts:15:0 (if - ;;@ comma.ts:15:7 (i32.ne (get_global $comma/b) - ;;@ comma.ts:15:12 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 15) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ comma.ts:17:0 (set_global $comma/a - ;;@ comma.ts:17:4 (block (result i32) - ;;@ comma.ts:17:5 (set_global $comma/a (i32.add (get_global $comma/a) @@ -128,54 +147,57 @@ ) ) (set_global $comma/b - ;;@ comma.ts:17:14 (get_global $comma/a) ) (get_global $comma/b) ) ) - ;;@ comma.ts:18:0 (if - ;;@ comma.ts:18:7 (i32.ne (get_global $comma/a) - ;;@ comma.ts:18:12 (i32.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 18) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ comma.ts:19:0 (if - ;;@ comma.ts:19:7 (i32.ne (get_global $comma/b) - ;;@ comma.ts:19:12 (i32.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 19) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ comma.ts:21:5 (set_local $0 - ;;@ comma.ts:21:13 (i32.const 0) ) (loop $continue|0 (if - ;;@ comma.ts:21:16 (i32.lt_u (get_local $0) - ;;@ comma.ts:21:20 (get_global $comma/a) ) (block - ;;@ comma.ts:21:23 (set_global $comma/a (i32.sub (get_global $comma/a) (i32.const 1) ) ) - ;;@ comma.ts:21:28 (set_local $0 (i32.add (get_local $0) @@ -186,15 +208,20 @@ ) ) ) - ;;@ comma.ts:22:0 (if - ;;@ comma.ts:22:7 (i32.ne (get_local $0) - ;;@ comma.ts:22:12 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 22) + (i32.const 0) + ) + (unreachable) + ) ) ) ) diff --git a/tests/compiler/comma.wast b/tests/compiler/comma.wast index b1b4b365..d9d0dda5 100644 --- a/tests/compiler/comma.wast +++ b/tests/compiler/comma.wast @@ -1,12 +1,15 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $comma/a (mut i32) (i32.const 0)) (global $comma/b (mut i32) (i32.const 0)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 28)) (memory $0 1) + (data (i32.const 8) "\08\00\00\00c\00o\00m\00m\00a\00.\00t\00s\00") (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $start (; 1 ;) (type $v) (local $0 i32) (local $1 i32) ;;@ comma.ts:3:0 @@ -41,7 +44,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 4) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ comma.ts:5:0 (if @@ -53,7 +64,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 5) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ comma.ts:7:0 (block @@ -79,7 +98,15 @@ (i32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 8) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ comma.ts:9:0 (if @@ -91,7 +118,15 @@ (i32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 9) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ comma.ts:11:0 (set_global $comma/a @@ -129,7 +164,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 14) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ comma.ts:15:0 (if @@ -141,7 +184,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 15) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ comma.ts:17:0 (set_global $comma/a @@ -174,7 +225,15 @@ (i32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 18) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ comma.ts:19:0 (if @@ -186,7 +245,15 @@ (i32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 19) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ comma.ts:21:0 (block $break|0 @@ -237,7 +304,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 22) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ comma.ts:24:0 (block @@ -255,53 +330,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: comma/a - GLOBAL: comma/b -[program.exports] - -;) diff --git a/tests/compiler/declare.optimized.wast b/tests/compiler/declare.optimized.wast index c1a5692a..b1d9ae6d 100644 --- a/tests/compiler/declare.optimized.wast +++ b/tests/compiler/declare.optimized.wast @@ -1,14 +1,47 @@ (module (type $v (func)) - (import "env" "externalFunc" (func $declare/externalFunc)) - (import "external" "externalFunc" (func $declare/external.externalFunc)) + (type $iiiiv (func (param i32 i32 i32 i32))) + (import "env" "externalConstant" (global $declare/externalConstant i32)) + (import "env" "externalFunction" (func $declare/externalFunction)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) + (import "my" "externalFunction" (func $declare/my.externalFunction)) + (import "my" "externalConstant" (global $declare/my.externalConstant i32)) (memory $0 1) - (export "test" (func $declare/test)) + (data (i32.const 8) "\n\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s") (export "memory" (memory $0)) - (func $declare/test (; 2 ;) (type $v) - ;;@ declare.ts:11:2 - (call $declare/externalFunc) - ;;@ declare.ts:13:11 - (call $declare/external.externalFunc) + (start $start) + (func $start (; 3 ;) (type $v) + (call $declare/externalFunction) + (if + (i32.ne + (get_global $declare/externalConstant) + (i32.const 1) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 5) + (i32.const 0) + ) + (unreachable) + ) + ) + (call $declare/my.externalFunction) + (if + (i32.ne + (get_global $declare/my.externalConstant) + (i32.const 2) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 13) + (i32.const 0) + ) + (unreachable) + ) + ) ) ) diff --git a/tests/compiler/declare.ts b/tests/compiler/declare.ts index 400288fc..858ee82d 100644 --- a/tests/compiler/declare.ts +++ b/tests/compiler/declare.ts @@ -1,15 +1,13 @@ -declare function externalFunc(): void; -declare const externalConst: i32; +declare function externalFunction(): void; +declare const externalConstant: i32; -namespace external { - export declare function externalFunc(): void; - export declare const externalConst: i32; +externalFunction(); +assert(externalConstant == 1); + +namespace my { + export declare function externalFunction(): void; + export declare const externalConstant: i32; } -export function test(): void { - // cannot be interpreted - externalFunc(); - externalConst; - external.externalFunc(); - external.externalConst; -} +my.externalFunction(); +assert(my.externalConstant == 2); diff --git a/tests/compiler/declare.wast b/tests/compiler/declare.wast index a9727654..cc461660 100644 --- a/tests/compiler/declare.wast +++ b/tests/compiler/declare.wast @@ -1,79 +1,60 @@ (module (type $v (func)) - (import "env" "externalConst" (global $declare/externalConst i32)) - (import "env" "externalFunc" (func $declare/externalFunc)) - (import "external" "externalFunc" (func $declare/external.externalFunc)) - (import "external" "externalConst" (global $declare/external.externalConst i32)) - (global $HEAP_BASE i32 (i32.const 4)) + (type $iiiiv (func (param i32 i32 i32 i32))) + (import "env" "externalConstant" (global $declare/externalConstant i32)) + (import "env" "externalFunction" (func $declare/externalFunction)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) + (import "my" "externalFunction" (func $declare/my.externalFunction)) + (import "my" "externalConstant" (global $declare/my.externalConstant i32)) + (global $HEAP_BASE i32 (i32.const 32)) (memory $0 1) - (export "test" (func $declare/test)) + (data (i32.const 8) "\n\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s\00") (export "memory" (memory $0)) - (func $declare/test (; 2 ;) (type $v) - ;;@ declare.ts:11:2 - (call $declare/externalFunc) - ;;@ declare.ts:12:2 - (drop - (get_global $declare/externalConst) + (start $start) + (func $start (; 3 ;) (type $v) + ;;@ declare.ts:4:0 + (call $declare/externalFunction) + ;;@ declare.ts:5:0 + (if + (i32.eqz + ;;@ declare.ts:5:7 + (i32.eq + (get_global $declare/externalConstant) + ;;@ declare.ts:5:27 + (i32.const 1) + ) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 5) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ declare.ts:13:11 - (call $declare/external.externalFunc) - ;;@ declare.ts:14:2 - (drop - (get_global $declare/external.externalConst) + ;;@ declare.ts:12:3 + (call $declare/my.externalFunction) + ;;@ declare.ts:13:0 + (if + (i32.eqz + ;;@ declare.ts:13:7 + (i32.eq + (get_global $declare/my.externalConstant) + ;;@ declare.ts:13:30 + (i32.const 2) + ) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 13) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: declare/externalFunc - GLOBAL: declare/externalConst - NAMESPACE: declare/external - FUNCTION_PROTOTYPE: declare/external.externalFunc - GLOBAL: declare/external.externalConst - FUNCTION_PROTOTYPE: declare/test -[program.exports] - FUNCTION_PROTOTYPE: declare/test -;) diff --git a/tests/compiler/do.optimized.wast b/tests/compiler/do.optimized.wast index facd86da..17bf46be 100644 --- a/tests/compiler/do.optimized.wast +++ b/tests/compiler/do.optimized.wast @@ -1,22 +1,23 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $do/n (mut i32) (i32.const 10)) (global $do/m (mut i32) (i32.const 0)) (global $do/o (mut i32) (i32.const 0)) (memory $0 1) + (data (i32.const 8) "\05\00\00\00d\00o\00.\00t\00s") (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $start (; 1 ;) (type $v) (local $0 i32) (loop $continue|0 - ;;@ do.ts:4:2 (set_global $do/n (i32.sub (get_global $do/n) (i32.const 1) ) ) - ;;@ do.ts:5:2 (set_global $do/m (i32.add (get_global $do/m) @@ -24,36 +25,43 @@ ) ) (br_if $continue|0 - ;;@ do.ts:6:9 (get_global $do/n) ) ) - ;;@ do.ts:7:0 (if - ;;@ do.ts:7:7 (get_global $do/n) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 7) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ do.ts:8:0 (if - ;;@ do.ts:8:7 (i32.ne (get_global $do/m) - ;;@ do.ts:8:12 (i32.const 10) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 8) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ do.ts:10:0 (set_global $do/n - ;;@ do.ts:10:4 (i32.const 10) ) (loop $continue|1 (set_global $do/n (i32.sub (tee_local $0 - ;;@ do.ts:11:10 (get_global $do/n) ) (i32.const 1) @@ -63,34 +71,34 @@ (get_local $0) ) ) - ;;@ do.ts:12:0 (if - ;;@ do.ts:12:7 (i32.ne (get_global $do/n) (i32.const -1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 12) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ do.ts:14:0 (set_global $do/n - ;;@ do.ts:14:4 (i32.const 10) ) - ;;@ do.ts:15:0 (set_global $do/m - ;;@ do.ts:15:4 (i32.const 0) ) (loop $continue|2 - ;;@ do.ts:18:2 (set_global $do/n (i32.sub (get_global $do/n) (i32.const 1) ) ) - ;;@ do.ts:19:2 (set_global $do/m (i32.add (get_global $do/m) @@ -98,14 +106,12 @@ ) ) (loop $continue|3 - ;;@ do.ts:21:4 (set_global $do/n (i32.sub (get_global $do/n) (i32.const 1) ) ) - ;;@ do.ts:22:4 (set_global $do/o (i32.add (get_global $do/o) @@ -113,56 +119,81 @@ ) ) (br_if $continue|3 - ;;@ do.ts:23:11 (get_global $do/n) ) ) - ;;@ do.ts:24:2 (if - ;;@ do.ts:24:9 (get_global $do/n) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 24) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ do.ts:25:2 (if - ;;@ do.ts:25:9 (i32.ne (get_global $do/o) - ;;@ do.ts:25:14 (i32.const 9) ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 25) + (i32.const 2) + ) + (unreachable) + ) + ) + (br_if $continue|2 + (get_global $do/n) + ) + ) + (if + (get_global $do/n) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 27) + (i32.const 0) + ) (unreachable) ) - (br_if $continue|2 - ;;@ do.ts:26:9 - (get_global $do/n) - ) ) - ;;@ do.ts:27:0 (if - ;;@ do.ts:27:7 - (get_global $do/n) - (unreachable) - ) - ;;@ do.ts:28:0 - (if - ;;@ do.ts:28:7 (i32.ne (get_global $do/m) - ;;@ do.ts:28:12 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 28) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ do.ts:29:0 (if - ;;@ do.ts:29:7 (i32.ne (get_global $do/o) - ;;@ do.ts:29:12 (i32.const 9) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 29) + (i32.const 0) + ) + (unreachable) + ) ) ) ) diff --git a/tests/compiler/do.wast b/tests/compiler/do.wast index 11791ae6..9be52622 100644 --- a/tests/compiler/do.wast +++ b/tests/compiler/do.wast @@ -1,13 +1,16 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $do/n (mut i32) (i32.const 10)) (global $do/m (mut i32) (i32.const 0)) (global $do/o (mut i32) (i32.const 0)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 24)) (memory $0 1) + (data (i32.const 8) "\05\00\00\00d\00o\00.\00t\00s\00") (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $start (; 1 ;) (type $v) (local $0 i32) ;;@ do.ts:3:0 (block $break|0 @@ -45,7 +48,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 7) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ do.ts:8:0 (if @@ -57,7 +68,15 @@ (i32.const 10) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 8) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ do.ts:10:0 (set_global $do/n @@ -100,7 +119,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 12) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ do.ts:14:0 (set_global $do/n @@ -167,7 +194,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 24) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ do.ts:25:2 (if @@ -179,7 +214,15 @@ (i32.const 9) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 25) + (i32.const 2) + ) + (unreachable) + ) ) ) (br_if $continue|2 @@ -198,7 +241,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 27) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ do.ts:28:0 (if @@ -210,7 +261,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 28) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ do.ts:29:0 (if @@ -222,58 +281,15 @@ (i32.const 9) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 29) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: do/n - GLOBAL: do/m - GLOBAL: do/o -[program.exports] - -;) diff --git a/tests/compiler/empty.wast b/tests/compiler/empty.wast index 0aee0ba0..eee09c0f 100644 --- a/tests/compiler/empty.wast +++ b/tests/compiler/empty.wast @@ -3,51 +3,3 @@ (memory $0 1) (export "memory" (memory $0)) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE -[program.exports] - -;) diff --git a/tests/compiler/enum.optimized.wast b/tests/compiler/enum.optimized.wast index 11f60e7d..70edcc98 100644 --- a/tests/compiler/enum.optimized.wast +++ b/tests/compiler/enum.optimized.wast @@ -1,4 +1,5 @@ (module + (type $i (func (result i32))) (type $v (func)) (global $enum/Implicit.ZERO i32 (i32.const 0)) (global $enum/Implicit.ONE i32 (i32.const 1)) @@ -33,9 +34,12 @@ (export "enum/SelfReference.ONE" (global $enum/SelfReference.ONE)) (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $enum/getZero (; 0 ;) (type $i) (result i32) + (i32.const 0) + ) + (func $start (; 1 ;) (type $v) (set_global $enum/NonConstant.ZERO - (i32.const 0) + (call $enum/getZero) ) (set_global $enum/NonConstant.ONE (i32.add diff --git a/tests/compiler/enum.wast b/tests/compiler/enum.wast index 2bf6ad56..3fdc92b4 100644 --- a/tests/compiler/enum.wast +++ b/tests/compiler/enum.wast @@ -54,61 +54,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - ENUM: enum/Implicit - ENUM: enum/Explicit - ENUM: enum/Mixed - FUNCTION_PROTOTYPE: enum/getZero - ENUM: enum/NonConstant - ENUM: enum/SelfReference -[program.exports] - ENUM: enum/Implicit - ENUM: enum/Explicit - ENUM: enum/Mixed - ENUM: enum/NonConstant - ENUM: enum/SelfReference -;) diff --git a/tests/compiler/export.optimized.wast b/tests/compiler/export.optimized.wast index 793b1808..2ca90ee7 100644 --- a/tests/compiler/export.optimized.wast +++ b/tests/compiler/export.optimized.wast @@ -14,26 +14,20 @@ (export "two" (func $export/ns.two)) (export "memory" (memory $0)) (func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - ;;@ export.ts:2:9 (i32.add (get_local $0) - ;;@ export.ts:2:13 (get_local $1) ) ) (func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - ;;@ export.ts:6:9 (i32.sub (get_local $0) - ;;@ export.ts:6:13 (get_local $1) ) ) (func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - ;;@ export.ts:12:9 (i32.mul (get_local $0) - ;;@ export.ts:12:13 (get_local $1) ) ) diff --git a/tests/compiler/export.wast b/tests/compiler/export.wast index 9de3cb1b..fbfdd55c 100644 --- a/tests/compiler/export.wast +++ b/tests/compiler/export.wast @@ -50,66 +50,3 @@ (func $export/ns.two (; 3 ;) (type $v) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: export/add - FUNCTION_PROTOTYPE: export/sub - FUNCTION_PROTOTYPE: export/mul - GLOBAL: export/a - GLOBAL: export/b - GLOBAL: export/c - NAMESPACE: export/ns - FUNCTION_PROTOTYPE: export/ns.one - FUNCTION_PROTOTYPE: export/ns.two -[program.exports] - FUNCTION_PROTOTYPE: export/add - FUNCTION_PROTOTYPE: export/sub - FUNCTION_PROTOTYPE: export/renamed_mul - GLOBAL: export/a - GLOBAL: export/b - GLOBAL: export/renamed_c - NAMESPACE: export/ns -;) diff --git a/tests/compiler/fmod.optimized.wast b/tests/compiler/fmod.optimized.wast index ba10f1ab..cfa7f2f5 100644 --- a/tests/compiler/fmod.optimized.wast +++ b/tests/compiler/fmod.optimized.wast @@ -1,13 +1,16 @@ (module (type $FFF (func (param f64 f64) (result f64))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $fff (func (param f32 f32) (result f32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (memory $0 1) + (data (i32.const 8) "\07\00\00\00f\00m\00o\00d\00.\00t\00s") (export "fmod" (func $fmod/fmod)) (export "fmodf" (func $fmod/fmodf)) (export "memory" (memory $0)) (start $start) - (func $fmod/fmod (; 0 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) + (func $fmod/fmod (; 1 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i32) (local $4 i64) @@ -16,55 +19,37 @@ (local $7 i32) (local $8 f64) (block $folding-inner0 - ;;@ fmod.ts:5:2 (set_local $3 - ;;@ fmod.ts:5:11 (i32.wrap/i64 - ;;@ fmod.ts:5:17 (i64.and (i64.shr_u - ;;@ fmod.ts:3:2 (tee_local $2 - ;;@ fmod.ts:3:11 (i64.reinterpret/f64 - ;;@ fmod.ts:3:28 (get_local $0) ) ) - ;;@ fmod.ts:5:23 (i64.const 52) ) - ;;@ fmod.ts:5:28 (i64.const 2047) ) ) ) - ;;@ fmod.ts:6:2 (set_local $6 - ;;@ fmod.ts:6:11 (i32.wrap/i64 - ;;@ fmod.ts:6:17 (i64.and (i64.shr_u - ;;@ fmod.ts:4:2 (tee_local $5 - ;;@ fmod.ts:4:11 (i64.reinterpret/f64 - ;;@ fmod.ts:4:28 (get_local $1) ) ) - ;;@ fmod.ts:6:23 (i64.const 52) ) - ;;@ fmod.ts:6:28 (i64.const 2047) ) ) ) - ;;@ fmod.ts:9:2 (if - ;;@ fmod.ts:9:6 (i32.and (if (result i32) (tee_local $7 @@ -74,18 +59,14 @@ (i64.eq (i64.shl (get_local $5) - ;;@ fmod.ts:9:12 (i64.const 1) ) - ;;@ fmod.ts:9:17 (i64.const 0) ) ) (get_local $7) - ;;@ fmod.ts:9:22 (f64.ne (tee_local $8 - ;;@ fmod.ts:9:33 (get_local $1) ) (get_local $8) @@ -95,137 +76,98 @@ ) ) (get_local $7) - ;;@ fmod.ts:9:39 (i32.eq (get_local $3) - ;;@ fmod.ts:9:45 (i32.const 2047) ) ) (i32.const 1) ) - ;;@ fmod.ts:10:27 (return - ;;@ fmod.ts:10:11 (f64.div (f64.mul - ;;@ fmod.ts:10:12 (get_local $0) - ;;@ fmod.ts:10:16 (get_local $1) ) - ;;@ fmod.ts:10:21 (f64.mul - ;;@ fmod.ts:10:22 (get_local $0) - ;;@ fmod.ts:10:26 (get_local $1) ) ) ) ) - ;;@ fmod.ts:11:2 (if - ;;@ fmod.ts:11:6 (i64.le_u (i64.shl (get_local $2) - ;;@ fmod.ts:11:12 (i64.const 1) ) - ;;@ fmod.ts:11:17 (i64.shl (get_local $5) - ;;@ fmod.ts:11:23 (i64.const 1) ) ) - ;;@ fmod.ts:11:26 (block (br_if $folding-inner0 - ;;@ fmod.ts:12:8 (i64.eq (i64.shl (get_local $2) - ;;@ fmod.ts:12:14 (i64.const 1) ) - ;;@ fmod.ts:12:19 (i64.shl (get_local $5) - ;;@ fmod.ts:12:25 (i64.const 1) ) ) ) - ;;@ fmod.ts:14:11 (return (get_local $0) ) ) ) - ;;@ fmod.ts:7:2 (set_local $7 - ;;@ fmod.ts:7:11 (i32.wrap/i64 - ;;@ fmod.ts:7:17 (i64.shr_u (get_local $2) - ;;@ fmod.ts:7:23 (i64.const 63) ) ) ) (set_local $2 - ;;@ fmod.ts:18:2 (if (result i64) - ;;@ fmod.ts:18:7 (get_local $3) (i64.or (i64.and - ;;@ fmod.ts:23:4 (get_local $2) (i64.const 4503599627370495) ) (i64.const 4503599627370496) ) - ;;@ fmod.ts:18:11 (block (result i64) - ;;@ fmod.ts:19:9 (set_local $4 - ;;@ fmod.ts:19:17 (i64.shl (get_local $2) - ;;@ fmod.ts:19:23 (i64.const 12) ) ) (loop $continue|0 (if - ;;@ fmod.ts:19:27 (i64.eqz - ;;@ fmod.ts:19:28 (i64.shr_u - ;;@ fmod.ts:19:29 (get_local $4) - ;;@ fmod.ts:19:34 (i64.const 63) ) ) (block - ;;@ fmod.ts:20:6 (set_local $3 (i32.sub - ;;@ fmod.ts:20:8 (get_local $3) (i32.const 1) ) ) - ;;@ fmod.ts:19:39 (set_local $4 (i64.shl (get_local $4) - ;;@ fmod.ts:19:45 (i64.const 1) ) ) @@ -234,14 +176,10 @@ ) ) (i64.shl - ;;@ fmod.ts:21:4 (get_local $2) - ;;@ fmod.ts:21:11 (i64.extend_u/i32 (i32.sub - ;;@ fmod.ts:21:17 (i32.const 1) - ;;@ fmod.ts:21:12 (get_local $3) ) ) @@ -250,55 +188,40 @@ ) ) (set_local $5 - ;;@ fmod.ts:26:2 (if (result i64) - ;;@ fmod.ts:26:7 (get_local $6) (i64.or (i64.and - ;;@ fmod.ts:31:4 (get_local $5) (i64.const 4503599627370495) ) (i64.const 4503599627370496) ) - ;;@ fmod.ts:26:11 (block (result i64) - ;;@ fmod.ts:27:9 (set_local $4 - ;;@ fmod.ts:27:13 (i64.shl (get_local $5) - ;;@ fmod.ts:27:19 (i64.const 12) ) ) (loop $continue|1 (if - ;;@ fmod.ts:27:23 (i64.eqz - ;;@ fmod.ts:27:24 (i64.shr_u - ;;@ fmod.ts:27:25 (get_local $4) - ;;@ fmod.ts:27:30 (i64.const 63) ) ) (block - ;;@ fmod.ts:28:6 (set_local $6 (i32.sub - ;;@ fmod.ts:28:8 (get_local $6) (i32.const 1) ) ) - ;;@ fmod.ts:27:35 (set_local $4 (i64.shl (get_local $4) - ;;@ fmod.ts:27:41 (i64.const 1) ) ) @@ -307,14 +230,10 @@ ) ) (i64.shl - ;;@ fmod.ts:29:4 (get_local $5) - ;;@ fmod.ts:29:11 (i64.extend_u/i32 (i32.sub - ;;@ fmod.ts:29:17 (i32.const 1) - ;;@ fmod.ts:29:12 (get_local $6) ) ) @@ -324,57 +243,40 @@ ) (loop $continue|2 (if - ;;@ fmod.ts:36:9 (i32.gt_s (get_local $3) - ;;@ fmod.ts:36:14 (get_local $6) ) (block - ;;@ fmod.ts:38:4 (if - ;;@ fmod.ts:38:8 (i64.eqz - ;;@ fmod.ts:38:9 (i64.shr_u - ;;@ fmod.ts:37:4 (tee_local $4 - ;;@ fmod.ts:37:8 (i64.sub (get_local $2) - ;;@ fmod.ts:37:13 (get_local $5) ) ) - ;;@ fmod.ts:38:15 (i64.const 63) ) ) - ;;@ fmod.ts:38:20 (block (br_if $folding-inner0 - ;;@ fmod.ts:39:10 (i64.eqz - ;;@ fmod.ts:39:11 (get_local $4) ) ) - ;;@ fmod.ts:41:6 (set_local $2 - ;;@ fmod.ts:41:11 (get_local $4) ) ) ) - ;;@ fmod.ts:43:4 (set_local $2 (i64.shl (get_local $2) - ;;@ fmod.ts:43:11 (i64.const 1) ) ) - ;;@ fmod.ts:36:18 (set_local $3 (i32.sub (get_local $3) @@ -385,67 +287,47 @@ ) ) ) - ;;@ fmod.ts:46:2 (if - ;;@ fmod.ts:46:6 (i64.eqz - ;;@ fmod.ts:46:7 (i64.shr_u - ;;@ fmod.ts:45:2 (tee_local $4 - ;;@ fmod.ts:45:6 (i64.sub (get_local $2) - ;;@ fmod.ts:45:11 (get_local $5) ) ) - ;;@ fmod.ts:46:13 (i64.const 63) ) ) - ;;@ fmod.ts:46:18 (block (br_if $folding-inner0 - ;;@ fmod.ts:47:8 (i64.eqz - ;;@ fmod.ts:47:9 (get_local $4) ) ) - ;;@ fmod.ts:49:4 (set_local $2 - ;;@ fmod.ts:49:9 (get_local $4) ) ) ) (loop $continue|3 (if - ;;@ fmod.ts:51:9 (i64.eqz - ;;@ fmod.ts:51:10 (i64.shr_u - ;;@ fmod.ts:51:11 (get_local $2) - ;;@ fmod.ts:51:17 (i64.const 52) ) ) (block - ;;@ fmod.ts:52:4 (set_local $3 (i32.sub - ;;@ fmod.ts:52:6 (get_local $3) (i32.const 1) ) ) - ;;@ fmod.ts:51:22 (set_local $2 (i64.shl (get_local $2) - ;;@ fmod.ts:51:29 (i64.const 1) ) ) @@ -454,67 +336,53 @@ ) ) (return - ;;@ fmod.ts:62:9 (f64.reinterpret/i64 (i64.or (tee_local $2 (select (i64.or (i64.sub - ;;@ fmod.ts:56:4 (get_local $2) (i64.const 4503599627370496) ) - ;;@ fmod.ts:57:10 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ fmod.ts:57:21 (i64.const 52) ) ) (i64.shr_u - ;;@ fmod.ts:59:4 (get_local $2) - ;;@ fmod.ts:59:11 (i64.extend_u/i32 (i32.sub - ;;@ fmod.ts:59:17 (i32.const 1) - ;;@ fmod.ts:59:12 (get_local $3) ) ) ) - ;;@ fmod.ts:55:6 (i32.gt_s (get_local $3) - ;;@ fmod.ts:55:11 (i32.const 0) ) ) ) - ;;@ fmod.ts:61:8 (i64.shl (i64.extend_u/i32 (get_local $7) ) - ;;@ fmod.ts:61:19 (i64.const 63) ) ) ) ) ) - ;;@ fmod.ts:13:13 (f64.mul (f64.const 0) - ;;@ fmod.ts:13:17 (get_local $0) ) ) - (func $fmod/fmodf (; 1 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) + (func $fmod/fmodf (; 2 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -523,51 +391,33 @@ (local $7 f32) (local $8 i32) (block $folding-inner0 - ;;@ fmod.ts:74:2 (set_local $4 - ;;@ fmod.ts:74:11 (i32.and - ;;@ fmod.ts:74:17 (i32.shr_u - ;;@ fmod.ts:72:2 (tee_local $2 - ;;@ fmod.ts:72:11 (i32.reinterpret/f32 - ;;@ fmod.ts:72:28 (get_local $0) ) ) - ;;@ fmod.ts:74:23 (i32.const 23) ) - ;;@ fmod.ts:74:28 (i32.const 255) ) ) - ;;@ fmod.ts:75:2 (set_local $6 - ;;@ fmod.ts:75:11 (i32.and - ;;@ fmod.ts:75:17 (i32.shr_u - ;;@ fmod.ts:73:2 (tee_local $5 - ;;@ fmod.ts:73:11 (i32.reinterpret/f32 - ;;@ fmod.ts:73:28 (get_local $1) ) ) - ;;@ fmod.ts:75:23 (i32.const 23) ) - ;;@ fmod.ts:75:28 (i32.const 255) ) ) - ;;@ fmod.ts:78:2 (if - ;;@ fmod.ts:78:6 (i32.and (if (result i32) (tee_local $3 @@ -577,16 +427,13 @@ (i32.eqz (i32.shl (get_local $5) - ;;@ fmod.ts:78:12 (i32.const 1) ) ) ) (get_local $3) - ;;@ fmod.ts:78:22 (f32.ne (tee_local $7 - ;;@ fmod.ts:78:33 (get_local $1) ) (get_local $7) @@ -596,134 +443,96 @@ ) ) (get_local $3) - ;;@ fmod.ts:78:39 (i32.eq (get_local $4) - ;;@ fmod.ts:78:45 (i32.const 255) ) ) (i32.const 1) ) - ;;@ fmod.ts:79:27 (return - ;;@ fmod.ts:79:11 (f32.div (f32.mul - ;;@ fmod.ts:79:12 (get_local $0) - ;;@ fmod.ts:79:16 (get_local $1) ) - ;;@ fmod.ts:79:21 (f32.mul - ;;@ fmod.ts:79:22 (get_local $0) - ;;@ fmod.ts:79:26 (get_local $1) ) ) ) ) - ;;@ fmod.ts:80:2 (if - ;;@ fmod.ts:80:6 (i32.le_u (i32.shl (get_local $2) - ;;@ fmod.ts:80:12 (i32.const 1) ) - ;;@ fmod.ts:80:17 (i32.shl (get_local $5) - ;;@ fmod.ts:80:23 (i32.const 1) ) ) - ;;@ fmod.ts:80:26 (block (br_if $folding-inner0 - ;;@ fmod.ts:81:8 (i32.eq (i32.shl (get_local $2) - ;;@ fmod.ts:81:14 (i32.const 1) ) - ;;@ fmod.ts:81:19 (i32.shl (get_local $5) - ;;@ fmod.ts:81:25 (i32.const 1) ) ) ) - ;;@ fmod.ts:83:11 (return (get_local $0) ) ) ) - ;;@ fmod.ts:76:2 (set_local $8 - ;;@ fmod.ts:76:11 (i32.and (get_local $2) - ;;@ fmod.ts:76:16 (i32.const -2147483648) ) ) (set_local $2 - ;;@ fmod.ts:87:2 (if (result i32) - ;;@ fmod.ts:87:7 (get_local $4) (i32.or (i32.and - ;;@ fmod.ts:92:4 (get_local $2) (i32.const 8388607) ) (i32.const 8388608) ) - ;;@ fmod.ts:87:11 (block (result i32) - ;;@ fmod.ts:88:9 (set_local $3 - ;;@ fmod.ts:88:17 (i32.shl (get_local $2) - ;;@ fmod.ts:88:23 (i32.const 9) ) ) (loop $continue|0 (if - ;;@ fmod.ts:88:26 (i32.eqz - ;;@ fmod.ts:88:27 (i32.shr_u - ;;@ fmod.ts:88:28 (get_local $3) - ;;@ fmod.ts:88:33 (i32.const 31) ) ) (block - ;;@ fmod.ts:89:6 (set_local $4 (i32.sub - ;;@ fmod.ts:89:8 (get_local $4) (i32.const 1) ) ) - ;;@ fmod.ts:88:38 (set_local $3 (i32.shl (get_local $3) - ;;@ fmod.ts:88:44 (i32.const 1) ) ) @@ -732,13 +541,9 @@ ) ) (i32.shl - ;;@ fmod.ts:90:4 (get_local $2) - ;;@ fmod.ts:90:11 (i32.sub - ;;@ fmod.ts:90:17 (i32.const 1) - ;;@ fmod.ts:90:12 (get_local $4) ) ) @@ -746,55 +551,40 @@ ) ) (set_local $5 - ;;@ fmod.ts:95:2 (if (result i32) - ;;@ fmod.ts:95:7 (get_local $6) (i32.or (i32.and - ;;@ fmod.ts:100:4 (get_local $5) (i32.const 8388607) ) (i32.const 8388608) ) - ;;@ fmod.ts:95:11 (block (result i32) - ;;@ fmod.ts:96:9 (set_local $3 - ;;@ fmod.ts:96:13 (i32.shl (get_local $5) - ;;@ fmod.ts:96:19 (i32.const 9) ) ) (loop $continue|1 (if - ;;@ fmod.ts:96:22 (i32.eqz - ;;@ fmod.ts:96:23 (i32.shr_u - ;;@ fmod.ts:96:24 (get_local $3) - ;;@ fmod.ts:96:29 (i32.const 31) ) ) (block - ;;@ fmod.ts:97:6 (set_local $6 (i32.sub - ;;@ fmod.ts:97:8 (get_local $6) (i32.const 1) ) ) - ;;@ fmod.ts:96:34 (set_local $3 (i32.shl (get_local $3) - ;;@ fmod.ts:96:40 (i32.const 1) ) ) @@ -803,13 +593,9 @@ ) ) (i32.shl - ;;@ fmod.ts:98:4 (get_local $5) - ;;@ fmod.ts:98:11 (i32.sub - ;;@ fmod.ts:98:17 (i32.const 1) - ;;@ fmod.ts:98:12 (get_local $6) ) ) @@ -818,60 +604,42 @@ ) (loop $continue|2 (if - ;;@ fmod.ts:105:9 (i32.gt_s (get_local $4) - ;;@ fmod.ts:105:14 (get_local $6) ) (block - ;;@ fmod.ts:107:4 (if - ;;@ fmod.ts:107:8 (i32.eqz - ;;@ fmod.ts:107:9 (i32.shr_u - ;;@ fmod.ts:106:4 (tee_local $3 - ;;@ fmod.ts:106:8 (i32.sub (get_local $2) - ;;@ fmod.ts:106:13 (get_local $5) ) ) - ;;@ fmod.ts:107:15 (i32.const 31) ) ) - ;;@ fmod.ts:107:20 (block (br_if $folding-inner0 - ;;@ fmod.ts:108:10 (i32.eqz - ;;@ fmod.ts:108:11 (get_local $3) ) ) - ;;@ fmod.ts:110:6 (set_local $2 - ;;@ fmod.ts:110:11 (get_local $3) ) ) ) - ;;@ fmod.ts:112:4 (set_local $2 (i32.shl (get_local $2) - ;;@ fmod.ts:112:11 (i32.const 1) ) ) - ;;@ fmod.ts:105:18 (set_local $4 (i32.sub - ;;@ fmod.ts:105:20 (get_local $4) (i32.const 1) ) @@ -880,67 +648,47 @@ ) ) ) - ;;@ fmod.ts:115:2 (if - ;;@ fmod.ts:115:6 (i32.eqz - ;;@ fmod.ts:115:7 (i32.shr_u - ;;@ fmod.ts:114:2 (tee_local $3 - ;;@ fmod.ts:114:6 (i32.sub (get_local $2) - ;;@ fmod.ts:114:11 (get_local $5) ) ) - ;;@ fmod.ts:115:13 (i32.const 31) ) ) - ;;@ fmod.ts:115:18 (block (br_if $folding-inner0 - ;;@ fmod.ts:116:8 (i32.eqz - ;;@ fmod.ts:116:9 (get_local $3) ) ) - ;;@ fmod.ts:118:4 (set_local $2 - ;;@ fmod.ts:118:9 (get_local $3) ) ) ) (loop $continue|3 (if - ;;@ fmod.ts:120:9 (i32.eqz - ;;@ fmod.ts:120:10 (i32.shr_u - ;;@ fmod.ts:120:11 (get_local $2) - ;;@ fmod.ts:120:17 (i32.const 23) ) ) (block - ;;@ fmod.ts:121:4 (set_local $4 (i32.sub - ;;@ fmod.ts:121:6 (get_local $4) (i32.const 1) ) ) - ;;@ fmod.ts:120:22 (set_local $2 (i32.shl (get_local $2) - ;;@ fmod.ts:120:29 (i32.const 1) ) ) @@ -949,206 +697,213 @@ ) ) (return - ;;@ fmod.ts:131:9 (f32.reinterpret/i32 (i32.or (tee_local $2 (select (i32.or (i32.sub - ;;@ fmod.ts:125:4 (get_local $2) (i32.const 8388608) ) - ;;@ fmod.ts:126:10 (i32.shl (get_local $4) - ;;@ fmod.ts:126:21 (i32.const 23) ) ) (i32.shr_u - ;;@ fmod.ts:128:4 (get_local $2) - ;;@ fmod.ts:128:11 (i32.sub - ;;@ fmod.ts:128:17 (i32.const 1) - ;;@ fmod.ts:128:12 (get_local $4) ) ) - ;;@ fmod.ts:124:6 (i32.gt_s (get_local $4) - ;;@ fmod.ts:124:11 (i32.const 0) ) ) ) - ;;@ fmod.ts:130:8 (get_local $8) ) ) ) ) - ;;@ fmod.ts:82:13 (f32.mul (f32.const 0) - ;;@ fmod.ts:82:17 (get_local $0) ) ) - (func $start (; 2 ;) (type $v) + (func $start (; 3 ;) (type $v) (local $0 f64) (local $1 f32) - ;;@ fmod.ts:65:0 (if - ;;@ fmod.ts:65:7 (f64.eq (tee_local $0 - ;;@ fmod.ts:65:18 (call $fmod/fmod - ;;@ fmod.ts:65:23 (f64.const 1) - ;;@ fmod.ts:65:26 (f64.const nan:0x8000000000000) ) ) (get_local $0) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 65) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:66:0 (if - ;;@ fmod.ts:66:7 (f64.ne (call $fmod/fmod - ;;@ fmod.ts:66:12 (f64.const 1.5) - ;;@ fmod.ts:66:17 (f64.const 1) ) - ;;@ fmod.ts:66:25 (f64.const 0.5) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 66) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:67:0 (if (i32.eqz - ;;@ fmod.ts:67:7 (f64.lt (f64.sub (call $fmod/fmod - ;;@ fmod.ts:67:12 (f64.const 9.2) - ;;@ fmod.ts:67:17 (f64.const 2) ) - ;;@ fmod.ts:67:24 (f64.const 1.2) ) - ;;@ fmod.ts:67:30 (f64.const 2.220446049250313e-16) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 67) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:68:0 (if (i32.eqz - ;;@ fmod.ts:68:7 (f64.lt (f64.sub (call $fmod/fmod - ;;@ fmod.ts:68:12 (f64.const 9.2) - ;;@ fmod.ts:68:17 (f64.const 3.7) ) - ;;@ fmod.ts:68:24 (f64.const 1.8) ) - ;;@ fmod.ts:68:30 (f64.const 2.220446049250313e-16) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 68) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:134:0 (if - ;;@ fmod.ts:134:7 (f32.eq (tee_local $1 - ;;@ fmod.ts:134:18 (call $fmod/fmodf - ;;@ fmod.ts:134:24 (f32.const 1) - ;;@ fmod.ts:134:27 (f32.const nan:0x400000) ) ) (get_local $1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 134) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:135:0 (if - ;;@ fmod.ts:135:7 (f32.ne (call $fmod/fmodf - ;;@ fmod.ts:135:13 (f32.const 1.5) - ;;@ fmod.ts:135:18 (f32.const 1) ) - ;;@ fmod.ts:135:26 (f32.const 0.5) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 135) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:136:0 (if (i32.eqz - ;;@ fmod.ts:136:7 (f32.lt (f32.sub (call $fmod/fmodf - ;;@ fmod.ts:136:13 (f32.const 9.199999809265137) - ;;@ fmod.ts:136:18 (f32.const 2) ) - ;;@ fmod.ts:136:25 (f32.const 1.2000000476837158) ) - ;;@ fmod.ts:136:31 (f32.const 1.1920928955078125e-07) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 136) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:137:0 (if (i32.eqz - ;;@ fmod.ts:137:7 (f32.lt (f32.sub (call $fmod/fmodf - ;;@ fmod.ts:137:13 (f32.const 9.199999809265137) - ;;@ fmod.ts:137:18 (f32.const 3.700000047683716) ) - ;;@ fmod.ts:137:25 (f32.const 1.7999999523162842) ) - ;;@ fmod.ts:137:31 (f32.const 1.1920928955078125e-07) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 137) + (i32.const 0) + ) + (unreachable) + ) ) ) ) diff --git a/tests/compiler/fmod.wast b/tests/compiler/fmod.wast index e3afbeb9..e9bcedeb 100644 --- a/tests/compiler/fmod.wast +++ b/tests/compiler/fmod.wast @@ -1,16 +1,19 @@ (module (type $FFF (func (param f64 f64) (result f64))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $fff (func (param f32 f32) (result f32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $f64.EPSILON f64 (f64.const 2.220446049250313e-16)) (global $f32.EPSILON f32 (f32.const 1.1920928955078125e-07)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 28)) (memory $0 1) + (data (i32.const 8) "\07\00\00\00f\00m\00o\00d\00.\00t\00s\00") (export "fmod" (func $fmod/fmod)) (export "fmodf" (func $fmod/fmodf)) (export "memory" (memory $0)) (start $start) - (func $fmod/fmod (; 0 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) + (func $fmod/fmod (; 1 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i32) @@ -649,7 +652,7 @@ ) ) ) - (func $fmod/fmodf (; 1 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) + (func $fmod/fmodf (; 2 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1268,7 +1271,7 @@ ) ) ) - (func $start (; 2 ;) (type $v) + (func $start (; 3 ;) (type $v) (local $0 f64) (local $1 f32) ;;@ fmod.ts:65:0 @@ -1288,7 +1291,15 @@ (get_local $0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 65) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:66:0 (if @@ -1305,7 +1316,15 @@ (f64.const 0.5) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 66) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:67:0 (if @@ -1326,7 +1345,15 @@ (f64.const 2.220446049250313e-16) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 67) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:68:0 (if @@ -1347,7 +1374,15 @@ (f64.const 2.220446049250313e-16) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 68) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:134:0 (if @@ -1366,7 +1401,15 @@ (get_local $1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 134) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:135:0 (if @@ -1383,7 +1426,15 @@ (f32.const 0.5) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 135) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:136:0 (if @@ -1404,7 +1455,15 @@ (f32.const 1.1920928955078125e-07) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 136) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:137:0 (if @@ -1425,58 +1484,15 @@ (f32.const 1.1920928955078125e-07) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 137) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: fmod/fmod - FUNCTION_PROTOTYPE: fmod/fmodf -[program.exports] - FUNCTION_PROTOTYPE: fmod/fmod - FUNCTION_PROTOTYPE: fmod/fmodf -;) diff --git a/tests/compiler/for.optimized.wast b/tests/compiler/for.optimized.wast index 88f2308a..86383f6c 100644 --- a/tests/compiler/for.optimized.wast +++ b/tests/compiler/for.optimized.wast @@ -1,29 +1,26 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $for/i (mut i32) (i32.const 0)) (memory $0 1) + (data (i32.const 8) "\06\00\00\00f\00o\00r\00.\00t\00s") (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $start (; 1 ;) (type $v) (local $0 i32) - ;;@ for.ts:2:5 (set_global $for/i - ;;@ for.ts:2:9 (i32.const 0) ) (loop $continue|0 (if - ;;@ for.ts:2:12 (i32.lt_s (get_global $for/i) - ;;@ for.ts:2:16 (i32.const 10) ) (block - ;;@ for.ts:2:20 (set_global $for/i (i32.add - ;;@ for.ts:2:22 (get_global $for/i) (i32.const 1) ) @@ -32,29 +29,30 @@ ) ) ) - ;;@ for.ts:5:0 (if - ;;@ for.ts:5:7 (i32.ne (get_global $for/i) - ;;@ for.ts:5:12 (i32.const 10) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 5) + (i32.const 0) + ) + (unreachable) + ) ) (loop $continue|1 (if - ;;@ for.ts:7:21 (i32.lt_s (get_local $0) - ;;@ for.ts:7:25 (i32.const 10) ) (block - ;;@ for.ts:7:29 (set_local $0 (i32.add - ;;@ for.ts:7:31 (get_local $0) (i32.const 1) ) @@ -65,17 +63,13 @@ ) (loop $continue|2 (if - ;;@ for.ts:11:7 (i32.gt_s (get_global $for/i) - ;;@ for.ts:11:11 (i32.const 0) ) (block - ;;@ for.ts:11:14 (set_global $for/i (i32.sub - ;;@ for.ts:11:16 (get_global $for/i) (i32.const 1) ) @@ -84,28 +78,28 @@ ) ) ) - ;;@ for.ts:12:0 (if - ;;@ for.ts:12:7 (get_global $for/i) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 12) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ for.ts:14:0 (block $break|3 (loop $continue|3 - ;;@ for.ts:16:4 (br_if $break|3 - ;;@ for.ts:15:6 (i32.eq (get_global $for/i) - ;;@ for.ts:15:11 (i32.const 10) ) ) - ;;@ for.ts:14:8 (set_global $for/i (i32.add - ;;@ for.ts:14:10 (get_global $for/i) (i32.const 1) ) @@ -116,12 +110,10 @@ (loop $continue|4 (set_global $for/i (i32.sub - ;;@ for.ts:19:8 (get_global $for/i) (i32.const 1) ) ) - ;;@ for.ts:20:4 (br_if $continue|4 (get_global $for/i) ) diff --git a/tests/compiler/for.wast b/tests/compiler/for.wast index d8e21533..1805384f 100644 --- a/tests/compiler/for.wast +++ b/tests/compiler/for.wast @@ -1,11 +1,14 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $for/i (mut i32) (i32.const 0)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 24)) (memory $0 1) + (data (i32.const 8) "\06\00\00\00f\00o\00r\00.\00t\00s\00") (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $start (; 1 ;) (type $v) (local $0 i32) ;;@ for.ts:2:0 (block $break|0 @@ -50,7 +53,15 @@ (i32.const 10) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 5) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ for.ts:7:0 (block $break|1 @@ -122,7 +133,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 12) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ for.ts:14:0 (block $break|3 @@ -190,52 +209,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: for/i -[program.exports] - -;) diff --git a/tests/compiler/function.optimized.wast b/tests/compiler/function.optimized.wast index bfec40ca..c710d8a5 100644 --- a/tests/compiler/function.optimized.wast +++ b/tests/compiler/function.optimized.wast @@ -1,9 +1,145 @@ (module (type $v (func)) + (type $i (func (result i32))) + (type $I (func (result i64))) + (type $f (func (result f32))) + (type $F (func (result f64))) + (type $iv (func (param i32))) + (type $ii (func (param i32) (result i32))) + (type $II (func (param i64) (result i64))) + (type $ff (func (param f32) (result f32))) + (type $FF (func (param f64) (result f64))) + (type $iiv (func (param i32 i32))) + (type $iii (func (param i32 i32) (result i32))) + (type $IiI (func (param i64 i32) (result i64))) + (type $fff (func (param f32 f32) (result f32))) + (type $FFF (func (param f64 f64) (result f64))) (memory $0 1) (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $function/v (; 0 ;) (type $v) (nop) ) + (func $function/i (; 1 ;) (type $i) (result i32) + (i32.const 0) + ) + (func $function/I (; 2 ;) (type $I) (result i64) + (i64.const 0) + ) + (func $function/f (; 3 ;) (type $f) (result f32) + (f32.const 0) + ) + (func $function/F (; 4 ;) (type $F) (result f64) + (f64.const 0) + ) + (func $function/iv (; 5 ;) (type $iv) (param $0 i32) + (nop) + ) + (func $function/ii (; 6 ;) (type $ii) (param $0 i32) (result i32) + (get_local $0) + ) + (func $function/II (; 7 ;) (type $II) (param $0 i64) (result i64) + (get_local $0) + ) + (func $function/ff (; 8 ;) (type $ff) (param $0 f32) (result f32) + (get_local $0) + ) + (func $function/FF (; 9 ;) (type $FF) (param $0 f64) (result f64) + (get_local $0) + ) + (func $function/iiv (; 10 ;) (type $iiv) (param $0 i32) (param $1 i32) + (nop) + ) + (func $function/iii (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (i32.add + (get_local $0) + (get_local $1) + ) + ) + (func $function/III (; 12 ;) (type $IiI) (param $0 i64) (param $1 i32) (result i64) + (i64.add + (get_local $0) + (i64.extend_s/i32 + (get_local $1) + ) + ) + ) + (func $function/fff (; 13 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) + (f32.add + (get_local $0) + (get_local $1) + ) + ) + (func $function/FFF (; 14 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) + (f64.add + (get_local $0) + (get_local $1) + ) + ) + (func $start (; 15 ;) (type $v) + (call $function/v) + (drop + (call $function/i) + ) + (drop + (call $function/I) + ) + (drop + (call $function/f) + ) + (drop + (call $function/F) + ) + (call $function/iv + (i32.const 0) + ) + (drop + (call $function/ii + (i32.const 0) + ) + ) + (drop + (call $function/II + (i64.const 0) + ) + ) + (drop + (call $function/ff + (f32.const 0) + ) + ) + (drop + (call $function/FF + (f64.const 0) + ) + ) + (call $function/iiv + (i32.const 1) + (i32.const 2) + ) + (drop + (call $function/iii + (i32.const 1) + (i32.const 2) + ) + ) + (drop + (call $function/III + (i64.const 1) + (i32.const 2) + ) + ) + (drop + (call $function/fff + (f32.const 1) + (f32.const 2) + ) + ) + (drop + (call $function/FFF + (f64.const 1) + (f64.const 2) + ) + ) + ) ) diff --git a/tests/compiler/function.wast b/tests/compiler/function.wast index 76abb40d..542a0481 100644 --- a/tests/compiler/function.wast +++ b/tests/compiler/function.wast @@ -215,66 +215,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: function/v - FUNCTION_PROTOTYPE: function/i - FUNCTION_PROTOTYPE: function/I - FUNCTION_PROTOTYPE: function/f - FUNCTION_PROTOTYPE: function/F - FUNCTION_PROTOTYPE: function/iv - FUNCTION_PROTOTYPE: function/ii - FUNCTION_PROTOTYPE: function/II - FUNCTION_PROTOTYPE: function/ff - FUNCTION_PROTOTYPE: function/FF - FUNCTION_PROTOTYPE: function/iiv - FUNCTION_PROTOTYPE: function/iii - FUNCTION_PROTOTYPE: function/III - FUNCTION_PROTOTYPE: function/fff - FUNCTION_PROTOTYPE: function/FFF -[program.exports] - -;) diff --git a/tests/compiler/game-of-life.optimized.wast b/tests/compiler/game-of-life.optimized.wast index 61c64876..28073769 100644 --- a/tests/compiler/game-of-life.optimized.wast +++ b/tests/compiler/game-of-life.optimized.wast @@ -9,22 +9,15 @@ (export "step" (func $../../examples/game-of-life/assembly/game-of-life/step)) (export "memory" (memory $0)) (func $../../examples/game-of-life/assembly/game-of-life/init (; 0 ;) (type $iiv) (param $0 i32) (param $1 i32) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:9:2 (set_global $../../examples/game-of-life/assembly/game-of-life/w - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:9:6 (get_local $0) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:10:2 (set_global $../../examples/game-of-life/assembly/game-of-life/h - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:10:6 (get_local $1) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:11:2 (set_global $../../examples/game-of-life/assembly/game-of-life/s - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:11:6 (i32.mul (get_global $../../examples/game-of-life/assembly/game-of-life/w) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:11:10 (get_global $../../examples/game-of-life/assembly/game-of-life/h) ) ) @@ -39,83 +32,59 @@ (local $6 i32) (local $7 i32) (set_local $6 - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:16:12 (i32.sub (get_global $../../examples/game-of-life/assembly/game-of-life/h) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:16:16 (i32.const 1) ) ) (set_local $7 - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:17:12 (i32.sub (get_global $../../examples/game-of-life/assembly/game-of-life/w) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:17:16 (i32.const 1) ) ) (loop $continue|0 (if - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:18:23 (i32.lt_u (get_local $0) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:18:27 (get_global $../../examples/game-of-life/assembly/game-of-life/h) ) (block (set_local $4 - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:19:14 (select - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:19:31 (i32.sub (get_local $0) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:19:35 (i32.const 1) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:19:26 (get_local $6) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:19:38 (get_local $0) ) ) (set_local $5 - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:20:14 (select - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:20:26 (i32.const 0) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:20:29 (i32.add (get_local $0) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:20:33 (i32.const 1) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:20:36 (i32.eq (get_local $0) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:20:41 (get_local $6) ) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:21:9 (set_local $1 - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:21:22 (i32.const 0) ) (loop $continue|1 (if - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:21:25 (i32.lt_u (get_local $1) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:21:29 (get_global $../../examples/game-of-life/assembly/game-of-life/w) ) (block - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:24:6 (set_local $2 - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:24:14 (i32.add - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:25:8 (i32.add (i32.add (i32.add @@ -123,68 +92,48 @@ (i32.add (i32.add (i32.load8_u - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:25:17 (i32.add (i32.mul (get_local $4) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:25:23 (get_global $../../examples/game-of-life/assembly/game-of-life/w) ) (tee_local $2 - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:22:16 (select - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:22:33 (i32.sub (get_local $1) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:22:37 (i32.const 1) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:22:28 (get_local $7) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:22:40 (get_local $1) ) ) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:25:34 (i32.load8_u - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:25:43 (i32.add (i32.mul (get_local $4) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:25:49 (get_global $../../examples/game-of-life/assembly/game-of-life/w) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:25:53 (get_local $1) ) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:25:58 (i32.load8_u - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:25:67 (i32.add (i32.mul (get_local $4) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:25:73 (get_global $../../examples/game-of-life/assembly/game-of-life/w) ) (tee_local $3 - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:23:16 (select - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:23:28 (i32.const 0) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:23:31 (i32.add (get_local $1) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:23:35 (i32.const 1) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:23:38 (i32.eq (get_local $1) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:23:43 (get_local $7) ) ) @@ -192,167 +141,120 @@ ) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:26:8 (i32.load8_u - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:26:17 (i32.add (i32.mul (get_local $0) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:26:23 (get_global $../../examples/game-of-life/assembly/game-of-life/w) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:26:27 (get_local $2) ) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:26:58 (i32.load8_u - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:26:67 (i32.add (i32.mul (get_local $0) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:26:73 (get_global $../../examples/game-of-life/assembly/game-of-life/w) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:26:77 (get_local $3) ) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:27:8 (i32.load8_u - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:27:17 (i32.add (i32.mul (get_local $5) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:27:23 (get_global $../../examples/game-of-life/assembly/game-of-life/w) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:27:27 (get_local $2) ) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:27:34 (i32.load8_u - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:27:43 (i32.add (i32.mul (get_local $5) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:27:49 (get_global $../../examples/game-of-life/assembly/game-of-life/w) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:27:53 (get_local $1) ) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:27:58 (i32.load8_u - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:27:67 (i32.add (i32.mul (get_local $5) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:27:73 (get_global $../../examples/game-of-life/assembly/game-of-life/w) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:27:77 (get_local $3) ) ) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:29:6 (if - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:29:10 (i32.load8_u - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:29:19 (i32.add (i32.mul (get_local $0) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:29:23 (get_global $../../examples/game-of-life/assembly/game-of-life/w) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:29:27 (get_local $1) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:30:8 (if - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:30:12 (i32.and (if (result i32) (tee_local $3 (i32.lt_s (get_local $2) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:30:16 (i32.const 2) ) ) (get_local $3) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:30:21 (i32.gt_s (get_local $2) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:30:25 (i32.const 3) ) ) (i32.const 1) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:31:10 (i32.store8 - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:31:20 (i32.add (i32.add (get_global $../../examples/game-of-life/assembly/game-of-life/s) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:31:24 (i32.mul (get_local $0) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:31:28 (get_global $../../examples/game-of-life/assembly/game-of-life/w) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:31:32 (get_local $1) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:31:35 (i32.const 0) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:32:13 (if - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:32:17 (i32.eq (get_local $2) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:32:22 (i32.const 3) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:33:8 (i32.store8 - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:33:18 (i32.add (i32.add (get_global $../../examples/game-of-life/assembly/game-of-life/s) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:33:22 (i32.mul (get_local $0) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:33:26 (get_global $../../examples/game-of-life/assembly/game-of-life/w) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:33:30 (get_local $1) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:33:33 (i32.const 1) ) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:21:32 (set_local $1 (i32.add - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:21:34 (get_local $1) (i32.const 1) ) @@ -361,10 +263,8 @@ ) ) ) - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:18:30 (set_local $0 (i32.add - ;;@ ../../examples/game-of-life/assembly/game-of-life.ts:18:32 (get_local $0) (i32.const 1) ) diff --git a/tests/compiler/game-of-life.wast b/tests/compiler/game-of-life.wast index 386ca4a5..4f5da4f8 100644 --- a/tests/compiler/game-of-life.wast +++ b/tests/compiler/game-of-life.wast @@ -415,59 +415,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: ../../examples/game-of-life/assembly/game-of-life/w - GLOBAL: ../../examples/game-of-life/assembly/game-of-life/h - GLOBAL: ../../examples/game-of-life/assembly/game-of-life/s - FUNCTION_PROTOTYPE: ../../examples/game-of-life/assembly/game-of-life/init - FUNCTION_PROTOTYPE: ../../examples/game-of-life/assembly/game-of-life/step -[program.exports] - FUNCTION_PROTOTYPE: ../../examples/game-of-life/assembly/game-of-life/init - FUNCTION_PROTOTYPE: ../../examples/game-of-life/assembly/game-of-life/step - FUNCTION_PROTOTYPE: game-of-life/init - FUNCTION_PROTOTYPE: game-of-life/step -;) diff --git a/tests/compiler/getter-setter.optimized.wast b/tests/compiler/getter-setter.optimized.wast index 622292dd..c0a5090b 100644 --- a/tests/compiler/getter-setter.optimized.wast +++ b/tests/compiler/getter-setter.optimized.wast @@ -1,54 +1,72 @@ (module + (type $i (func (result i32))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $iv (func (param i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $getter-setter/Foo._bar (mut i32) (i32.const 0)) (memory $0 1) + (data (i32.const 8) "\10\00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s") (export "memory" (memory $0)) (start $start) - (func $getter-setter/Foo.set:bar (; 0 ;) (type $iv) (param $0 i32) - ;;@ getter-setter.ts:9:4 + (func $getter-setter/Foo.get:bar (; 1 ;) (type $i) (result i32) + (get_global $getter-setter/Foo._bar) + ) + (func $getter-setter/Foo.set:bar (; 2 ;) (type $iv) (param $0 i32) (set_global $getter-setter/Foo._bar - ;;@ getter-setter.ts:9:15 (get_local $0) ) ) - (func $start (; 1 ;) (type $v) - ;;@ getter-setter.ts:13:0 + (func $start (; 3 ;) (type $v) (if - (get_global $getter-setter/Foo._bar) - (unreachable) + (call $getter-setter/Foo.get:bar) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 13) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ getter-setter.ts:14:0 (call $getter-setter/Foo.set:bar - ;;@ getter-setter.ts:14:10 (i32.const 1) ) - ;;@ getter-setter.ts:15:0 (if - ;;@ getter-setter.ts:15:7 (i32.ne - (get_global $getter-setter/Foo._bar) - ;;@ getter-setter.ts:15:18 + (call $getter-setter/Foo.get:bar) (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 15) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ getter-setter.ts:16:0 (if - ;;@ getter-setter.ts:16:7 (block (result i32) (call $getter-setter/Foo.set:bar - ;;@ getter-setter.ts:16:18 (i32.const 2) ) - ;;@ getter-setter.ts:16:7 (i32.ne - (get_global $getter-setter/Foo._bar) - ;;@ getter-setter.ts:16:24 + (call $getter-setter/Foo.get:bar) (i32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 16) + (i32.const 0) + ) + (unreachable) + ) ) ) ) diff --git a/tests/compiler/getter-setter.wast b/tests/compiler/getter-setter.wast index f8157ad0..d1edf575 100644 --- a/tests/compiler/getter-setter.wast +++ b/tests/compiler/getter-setter.wast @@ -1,27 +1,30 @@ (module (type $i (func (result i32))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $iv (func (param i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $getter-setter/Foo._bar (mut i32) (i32.const 0)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 44)) (memory $0 1) + (data (i32.const 8) "\10\00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s\00") (export "memory" (memory $0)) (start $start) - (func $getter-setter/Foo.get:bar (; 0 ;) (type $i) (result i32) + (func $getter-setter/Foo.get:bar (; 1 ;) (type $i) (result i32) ;;@ getter-setter.ts:5:15 (return ;;@ getter-setter.ts:5:11 (get_global $getter-setter/Foo._bar) ) ) - (func $getter-setter/Foo.set:bar (; 1 ;) (type $iv) (param $0 i32) + (func $getter-setter/Foo.set:bar (; 2 ;) (type $iv) (param $0 i32) ;;@ getter-setter.ts:9:4 (set_global $getter-setter/Foo._bar ;;@ getter-setter.ts:9:15 (get_local $0) ) ) - (func $start (; 2 ;) (type $v) + (func $start (; 3 ;) (type $v) ;;@ getter-setter.ts:13:0 (if (i32.eqz @@ -32,7 +35,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 13) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ getter-setter.ts:14:0 (call $getter-setter/Foo.set:bar @@ -49,7 +60,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 15) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ getter-setter.ts:16:0 (if @@ -67,58 +86,15 @@ (i32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 16) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - CLASS_PROTOTYPE: getter-setter/Foo - GLOBAL: getter-setter/Foo._bar - PROPERTY: getter-setter/Foo.bar -[program.exports] - -;) diff --git a/tests/compiler/i64-polyfill.optimized.wast b/tests/compiler/i64-polyfill.optimized.wast index f9e28cb5..02594bb0 100644 --- a/tests/compiler/i64-polyfill.optimized.wast +++ b/tests/compiler/i64-polyfill.optimized.wast @@ -38,167 +38,122 @@ (export "ge_u" (func $../../examples/i64-polyfill/assembly/i64/ge_u)) (export "memory" (memory $0)) (func $../../examples/i64-polyfill/assembly/i64/getHi (; 0 ;) (type $i) (result i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:9:9 (get_global $../../examples/i64-polyfill/assembly/i64/hi) ) (func $../../examples/i64-polyfill/assembly/i64/getLo (; 1 ;) (type $i) (result i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:5:9 (get_global $../../examples/i64-polyfill/assembly/i64/lo) ) (func $../../examples/i64-polyfill/assembly/i64/clz_ (; 2 ;) (type $iiv) (param $0 i32) (param $1 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:14:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:14:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:13:12 (i64.clz - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:13:21 (i64.or (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:13:35 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:13:50 (i64.const 32) ) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:15:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:15:7 (i32.const 0) ) ) (func $../../examples/i64-polyfill/assembly/i64/ctz_ (; 3 ;) (type $iiv) (param $0 i32) (param $1 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:21:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:21:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:20:12 (i64.ctz - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:20:21 (i64.or (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:20:35 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:20:50 (i64.const 32) ) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:22:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:22:7 (i32.const 0) ) ) (func $../../examples/i64-polyfill/assembly/i64/popcnt_ (; 4 ;) (type $iiv) (param $0 i32) (param $1 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:28:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:28:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:27:12 (i64.popcnt - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:27:24 (i64.or (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:27:38 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:27:53 (i64.const 32) ) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:29:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:29:7 (i32.const 0) ) ) (func $../../examples/i64-polyfill/assembly/i64/eqz (; 5 ;) (type $iiv) (param $0 i32) (param $1 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:35:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:34:18 (i64.eqz - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:34:19 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:34:20 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:34:34 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:34:49 (i64.const 32) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:36:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:36:7 (i32.const 0) ) ) (func $../../examples/i64-polyfill/assembly/i64/add (; 6 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:41:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:41:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:40:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:40:12 (i64.add (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:40:13 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:40:27 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:40:42 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:40:48 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:40:49 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:40:64 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:40:80 (i64.const 32) ) ) @@ -206,14 +161,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:42:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:42:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:42:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:42:20 (i64.const 32) ) ) @@ -221,40 +172,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/sub (; 7 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:47:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:47:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:46:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:46:12 (i64.sub (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:46:13 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:46:27 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:46:42 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:46:48 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:46:49 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:46:64 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:46:80 (i64.const 32) ) ) @@ -262,14 +202,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:48:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:48:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:48:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:48:20 (i64.const 32) ) ) @@ -277,40 +213,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/mul (; 8 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:53:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:53:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:52:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:52:12 (i64.mul (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:52:13 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:52:27 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:52:42 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:52:48 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:52:49 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:52:64 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:52:80 (i64.const 32) ) ) @@ -318,14 +243,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:54:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:54:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:54:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:54:20 (i64.const 32) ) ) @@ -333,41 +254,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/div_s (; 9 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:59:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:59:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:58:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:58:12 (i64.div_s - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:58:18 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:58:24 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:58:38 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:58:53 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:58:59 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:58:65 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:58:80 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:58:96 (i64.const 32) ) ) @@ -375,14 +284,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:60:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:60:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:60:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:60:20 (i64.const 32) ) ) @@ -390,40 +295,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/div_u (; 10 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:65:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:65:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:64:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:64:12 (i64.div_u (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:64:13 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:64:27 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:64:42 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:64:48 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:64:49 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:64:64 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:64:80 (i64.const 32) ) ) @@ -431,14 +325,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:66:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:66:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:66:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:66:20 (i64.const 32) ) ) @@ -446,41 +336,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/rem_s (; 11 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:71:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:71:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:70:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:70:12 (i64.rem_s - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:70:18 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:70:24 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:70:38 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:70:53 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:70:59 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:70:65 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:70:80 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:70:96 (i64.const 32) ) ) @@ -488,14 +366,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:72:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:72:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:72:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:72:20 (i64.const 32) ) ) @@ -503,40 +377,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/rem_u (; 12 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:77:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:77:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:76:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:76:12 (i64.rem_u (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:76:13 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:76:27 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:76:42 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:76:48 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:76:49 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:76:64 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:76:80 (i64.const 32) ) ) @@ -544,14 +407,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:78:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:78:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:78:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:78:21 (i64.const 32) ) ) @@ -559,40 +418,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/and (; 13 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:83:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:83:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:82:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:82:12 (i64.and (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:82:13 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:82:27 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:82:42 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:82:48 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:82:49 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:82:64 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:82:80 (i64.const 32) ) ) @@ -600,14 +448,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:84:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:84:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:84:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:84:21 (i64.const 32) ) ) @@ -615,40 +459,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/or (; 14 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:89:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:89:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:88:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:88:12 (i64.or (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:88:13 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:88:27 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:88:42 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:88:48 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:88:49 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:88:64 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:88:80 (i64.const 32) ) ) @@ -656,14 +489,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:90:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:90:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:90:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:90:21 (i64.const 32) ) ) @@ -671,40 +500,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/xor (; 15 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:95:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:95:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:94:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:94:12 (i64.xor (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:94:13 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:94:27 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:94:42 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:94:48 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:94:49 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:94:64 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:94:80 (i64.const 32) ) ) @@ -712,14 +530,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:96:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:96:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:96:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:96:21 (i64.const 32) ) ) @@ -727,40 +541,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/shl (; 16 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:101:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:101:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:100:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:100:12 (i64.shl (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:100:13 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:100:27 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:100:42 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:100:49 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:100:50 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:100:65 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:100:81 (i64.const 32) ) ) @@ -768,14 +571,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:102:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:102:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:102:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:102:21 (i64.const 32) ) ) @@ -783,41 +582,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/shr_s (; 17 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:107:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:107:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:106:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:106:12 (i64.shr_s - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:106:18 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:106:24 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:106:38 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:106:53 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:106:60 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:106:66 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:106:81 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:106:97 (i64.const 32) ) ) @@ -825,14 +612,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:108:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:108:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:108:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:108:21 (i64.const 32) ) ) @@ -840,40 +623,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/shr_u (; 18 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:113:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:113:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:112:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:112:12 (i64.shr_u (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:112:13 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:112:27 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:112:42 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:112:49 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:112:50 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:112:65 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:112:81 (i64.const 32) ) ) @@ -881,14 +653,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:114:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:114:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:114:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:114:21 (i64.const 32) ) ) @@ -896,39 +664,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/rotl_ (; 19 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:119:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:119:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:118:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:118:12 (i64.rotl - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:118:22 (i64.or (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:118:36 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:118:51 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:118:55 (i64.or (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:118:70 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:118:86 (i64.const 32) ) ) @@ -936,14 +694,10 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:120:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:120:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:120:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:120:21 (i64.const 32) ) ) @@ -951,39 +705,29 @@ ) (func $../../examples/i64-polyfill/assembly/i64/rotr_ (; 20 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:126:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:126:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:125:2 (tee_local $4 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:125:12 (i64.rotr - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:125:22 (i64.or (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:125:36 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:125:51 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:125:55 (i64.or (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:125:70 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:125:86 (i64.const 32) ) ) @@ -991,436 +735,322 @@ ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:127:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:127:7 (i32.wrap/i64 - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:127:13 (i64.shr_u (get_local $4) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:127:21 (i64.const 32) ) ) ) ) (func $../../examples/i64-polyfill/assembly/i64/eq (; 21 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:133:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:132:18 (i64.eq (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:132:19 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:132:33 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:132:48 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:132:55 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:132:56 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:132:71 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:132:87 (i64.const 32) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:134:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:134:7 (i32.const 0) ) ) (func $../../examples/i64-polyfill/assembly/i64/ne (; 22 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:139:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:138:18 (i64.ne (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:138:19 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:138:33 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:138:48 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:138:55 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:138:56 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:138:71 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:138:87 (i64.const 32) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:140:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:140:7 (i32.const 0) ) ) (func $../../examples/i64-polyfill/assembly/i64/lt_s (; 23 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:145:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:144:18 (i64.lt_s (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:144:24 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:144:38 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:144:53 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:144:59 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:144:65 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:144:80 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:144:96 (i64.const 32) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:146:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:146:7 (i32.const 0) ) ) (func $../../examples/i64-polyfill/assembly/i64/lt_u (; 24 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:151:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:150:18 (i64.lt_u (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:150:19 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:150:33 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:150:48 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:150:54 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:150:55 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:150:70 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:150:86 (i64.const 32) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:152:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:152:7 (i32.const 0) ) ) (func $../../examples/i64-polyfill/assembly/i64/le_s (; 25 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:157:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:156:18 (i64.le_s (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:156:24 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:156:38 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:156:53 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:156:60 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:156:66 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:156:81 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:156:97 (i64.const 32) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:158:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:158:7 (i32.const 0) ) ) (func $../../examples/i64-polyfill/assembly/i64/le_u (; 26 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:163:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:162:18 (i64.le_u (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:162:19 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:162:33 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:162:48 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:162:55 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:162:56 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:162:71 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:162:87 (i64.const 32) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:164:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:164:7 (i32.const 0) ) ) (func $../../examples/i64-polyfill/assembly/i64/gt_s (; 27 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:169:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:168:18 (i64.gt_s (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:168:24 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:168:38 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:168:53 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:168:59 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:168:65 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:168:80 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:168:96 (i64.const 32) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:170:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:170:7 (i32.const 0) ) ) (func $../../examples/i64-polyfill/assembly/i64/gt_u (; 28 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:175:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:174:18 (i64.gt_u (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:174:19 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:174:33 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:174:48 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:174:54 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:174:55 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:174:70 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:174:86 (i64.const 32) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:176:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:176:7 (i32.const 0) ) ) (func $../../examples/i64-polyfill/assembly/i64/ge_s (; 29 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:181:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:180:18 (i64.ge_s (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:180:24 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:180:38 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:180:53 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:180:60 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:180:66 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:180:81 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:180:97 (i64.const 32) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:182:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:182:7 (i32.const 0) ) ) (func $../../examples/i64-polyfill/assembly/i64/ge_u (; 30 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:187:2 (set_global $../../examples/i64-polyfill/assembly/i64/lo - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:186:18 (i64.ge_u (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:186:19 (i64.extend_u/i32 (get_local $0) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:186:33 (i64.shl (i64.extend_u/i32 (get_local $1) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:186:48 (i64.const 32) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:186:55 (i64.or - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:186:56 (i64.extend_u/i32 (get_local $2) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:186:71 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:186:87 (i64.const 32) ) ) ) ) - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:188:2 (set_global $../../examples/i64-polyfill/assembly/i64/hi - ;;@ ../../examples/i64-polyfill/assembly/i64.ts:188:7 (i32.const 0) ) ) diff --git a/tests/compiler/i64-polyfill.wast b/tests/compiler/i64-polyfill.wast index c787dbd1..92508b23 100644 --- a/tests/compiler/i64-polyfill.wast +++ b/tests/compiler/i64-polyfill.wast @@ -1526,145 +1526,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: ../../examples/i64-polyfill/assembly/i64/lo - GLOBAL: ../../examples/i64-polyfill/assembly/i64/hi - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/getLo - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/getHi - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/clz_ - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/ctz_ - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/popcnt_ - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/eqz - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/add - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/sub - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/mul - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/div_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/div_u - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/rem_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/rem_u - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/and - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/or - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/xor - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/shl - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/shr_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/shr_u - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/rotl_ - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/rotr_ - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/eq - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/ne - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/lt_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/lt_u - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/le_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/le_u - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/gt_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/gt_u - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/ge_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/ge_u -[program.exports] - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/getLo - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/getHi - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/clz - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/ctz - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/popcnt - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/eqz - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/add - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/sub - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/mul - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/div_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/div_u - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/rem_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/rem_u - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/and - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/or - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/xor - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/shl - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/shr_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/shr_u - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/rotl - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/rotr - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/eq - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/ne - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/lt_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/lt_u - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/le_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/le_u - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/gt_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/gt_u - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/ge_s - FUNCTION_PROTOTYPE: ../../examples/i64-polyfill/assembly/i64/ge_u - FUNCTION_PROTOTYPE: i64-polyfill/getHi - FUNCTION_PROTOTYPE: i64-polyfill/getLo - FUNCTION_PROTOTYPE: i64-polyfill/clz - FUNCTION_PROTOTYPE: i64-polyfill/ctz - FUNCTION_PROTOTYPE: i64-polyfill/popcnt - FUNCTION_PROTOTYPE: i64-polyfill/eqz - FUNCTION_PROTOTYPE: i64-polyfill/add - FUNCTION_PROTOTYPE: i64-polyfill/sub - FUNCTION_PROTOTYPE: i64-polyfill/mul - FUNCTION_PROTOTYPE: i64-polyfill/div_s - FUNCTION_PROTOTYPE: i64-polyfill/div_u - FUNCTION_PROTOTYPE: i64-polyfill/rem_s - FUNCTION_PROTOTYPE: i64-polyfill/rem_u - FUNCTION_PROTOTYPE: i64-polyfill/and - FUNCTION_PROTOTYPE: i64-polyfill/or - FUNCTION_PROTOTYPE: i64-polyfill/xor - FUNCTION_PROTOTYPE: i64-polyfill/shl - FUNCTION_PROTOTYPE: i64-polyfill/shr_s - FUNCTION_PROTOTYPE: i64-polyfill/shr_u - FUNCTION_PROTOTYPE: i64-polyfill/rotl - FUNCTION_PROTOTYPE: i64-polyfill/rotr - FUNCTION_PROTOTYPE: i64-polyfill/eq - FUNCTION_PROTOTYPE: i64-polyfill/ne - FUNCTION_PROTOTYPE: i64-polyfill/lt_s - FUNCTION_PROTOTYPE: i64-polyfill/lt_u - FUNCTION_PROTOTYPE: i64-polyfill/le_s - FUNCTION_PROTOTYPE: i64-polyfill/le_u - FUNCTION_PROTOTYPE: i64-polyfill/gt_s - FUNCTION_PROTOTYPE: i64-polyfill/gt_u - FUNCTION_PROTOTYPE: i64-polyfill/ge_s - FUNCTION_PROTOTYPE: i64-polyfill/ge_u -;) diff --git a/tests/compiler/if.optimized.wast b/tests/compiler/if.optimized.wast index 9b0d20df..aed3a858 100644 --- a/tests/compiler/if.optimized.wast +++ b/tests/compiler/if.optimized.wast @@ -1,115 +1,134 @@ (module (type $ii (func (param i32) (result i32))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (memory $0 1) + (data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s") (export "ifThenElse" (func $if/ifThenElse)) (export "ifThen" (func $if/ifThen)) (export "ifThenElseBlock" (func $if/ifThenElse)) (export "ifAlwaysReturns" (func $if/ifAlwaysReturns)) (export "memory" (memory $0)) (start $start) - (func $if/ifThenElse (; 0 ;) (type $ii) (param $0 i32) (result i32) + (func $if/ifThenElse (; 1 ;) (type $ii) (param $0 i32) (result i32) (select - ;;@ if.ts:3:11 (i32.const 1) - ;;@ if.ts:5:11 (i32.const 0) - ;;@ if.ts:2:6 (get_local $0) ) ) - (func $if/ifThen (; 1 ;) (type $ii) (param $0 i32) (result i32) - ;;@ if.ts:12:2 + (func $if/ifThen (; 2 ;) (type $ii) (param $0 i32) (result i32) (if - ;;@ if.ts:12:6 (get_local $0) - ;;@ if.ts:13:11 (return (i32.const 1) ) ) - ;;@ if.ts:14:9 (i32.const 0) ) - (func $if/ifAlwaysReturns (; 2 ;) (type $ii) (param $0 i32) (result i32) - ;;@ if.ts:34:2 + (func $if/ifAlwaysReturns (; 3 ;) (type $ii) (param $0 i32) (result i32) (if - ;;@ if.ts:34:6 (get_local $0) - ;;@ if.ts:35:11 (return (i32.const 1) ) - ;;@ if.ts:37:4 (unreachable) ) ) - (func $start (; 3 ;) (type $v) - ;;@ if.ts:8:0 + (func $start (; 4 ;) (type $v) (if - ;;@ if.ts:8:7 (call $if/ifThenElse - ;;@ if.ts:8:18 (i32.const 0) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 8) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ if.ts:9:0 (if - ;;@ if.ts:9:7 (i32.ne (call $if/ifThenElse - ;;@ if.ts:9:18 (i32.const 1) ) - ;;@ if.ts:9:24 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 9) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ if.ts:17:0 (if - ;;@ if.ts:17:7 (call $if/ifThen - ;;@ if.ts:17:14 (i32.const 0) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 17) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ if.ts:18:0 (if - ;;@ if.ts:18:7 (i32.ne (call $if/ifThen - ;;@ if.ts:18:14 (i32.const 1) ) - ;;@ if.ts:18:20 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 18) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ if.ts:30:0 (if - ;;@ if.ts:30:7 (call $if/ifThenElse - ;;@ if.ts:30:23 (i32.const 0) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 30) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ if.ts:31:0 (if - ;;@ if.ts:31:7 (i32.ne (call $if/ifThenElse - ;;@ if.ts:31:23 (i32.const 1) ) - ;;@ if.ts:31:29 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 31) + (i32.const 0) + ) + (unreachable) + ) ) ) ) diff --git a/tests/compiler/if.wast b/tests/compiler/if.wast index 3ae3f891..0d73a394 100644 --- a/tests/compiler/if.wast +++ b/tests/compiler/if.wast @@ -1,15 +1,18 @@ (module (type $ii (func (param i32) (result i32))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) - (global $HEAP_BASE i32 (i32.const 4)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) + (global $HEAP_BASE i32 (i32.const 24)) (memory $0 1) + (data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s\00") (export "ifThenElse" (func $if/ifThenElse)) (export "ifThen" (func $if/ifThen)) (export "ifThenElseBlock" (func $if/ifThenElseBlock)) (export "ifAlwaysReturns" (func $if/ifAlwaysReturns)) (export "memory" (memory $0)) (start $start) - (func $if/ifThenElse (; 0 ;) (type $ii) (param $0 i32) (result i32) + (func $if/ifThenElse (; 1 ;) (type $ii) (param $0 i32) (result i32) ;;@ if.ts:2:2 (if ;;@ if.ts:2:6 @@ -24,7 +27,7 @@ ) ) ) - (func $if/ifThen (; 1 ;) (type $ii) (param $0 i32) (result i32) + (func $if/ifThen (; 2 ;) (type $ii) (param $0 i32) (result i32) ;;@ if.ts:12:2 (if ;;@ if.ts:12:6 @@ -39,7 +42,7 @@ (i32.const 0) ) ) - (func $if/ifThenElseBlock (; 2 ;) (type $ii) (param $0 i32) (result i32) + (func $if/ifThenElseBlock (; 3 ;) (type $ii) (param $0 i32) (result i32) ;;@ if.ts:21:2 (if ;;@ if.ts:21:6 @@ -64,7 +67,7 @@ ) ) ) - (func $if/ifAlwaysReturns (; 3 ;) (type $ii) (param $0 i32) (result i32) + (func $if/ifAlwaysReturns (; 4 ;) (type $ii) (param $0 i32) (result i32) ;;@ if.ts:34:2 (if ;;@ if.ts:34:6 @@ -77,7 +80,7 @@ (unreachable) ) ) - (func $start (; 4 ;) (type $v) + (func $start (; 5 ;) (type $v) ;;@ if.ts:8:0 (if (i32.eqz @@ -91,7 +94,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 8) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ if.ts:9:0 (if @@ -106,7 +117,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 9) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ if.ts:17:0 (if @@ -121,7 +140,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 17) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ if.ts:18:0 (if @@ -136,7 +163,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 18) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ if.ts:30:0 (if @@ -151,7 +186,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 30) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ if.ts:31:0 (if @@ -166,62 +209,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 31) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: if/ifThenElse - FUNCTION_PROTOTYPE: if/ifThen - FUNCTION_PROTOTYPE: if/ifThenElseBlock - FUNCTION_PROTOTYPE: if/ifAlwaysReturns -[program.exports] - FUNCTION_PROTOTYPE: if/ifThenElse - FUNCTION_PROTOTYPE: if/ifThen - FUNCTION_PROTOTYPE: if/ifThenElseBlock - FUNCTION_PROTOTYPE: if/ifAlwaysReturns -;) diff --git a/tests/compiler/import.optimized.wast b/tests/compiler/import.optimized.wast index bfec40ca..39a84b87 100644 --- a/tests/compiler/import.optimized.wast +++ b/tests/compiler/import.optimized.wast @@ -1,9 +1,49 @@ (module + (type $iii (func (param i32 i32) (result i32))) (type $v (func)) (memory $0 1) (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (i32.add + (get_local $0) + (get_local $1) + ) + ) + (func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (i32.sub + (get_local $0) + (get_local $1) + ) + ) + (func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (i32.mul + (get_local $0) + (get_local $1) + ) + ) + (func $export/ns.two (; 3 ;) (type $v) (nop) ) + (func $start (; 4 ;) (type $v) + (drop + (i32.add + (i32.add + (call $export/add + (i32.const 1) + (i32.const 2) + ) + (call $export/sub + (i32.const 2) + (i32.const 3) + ) + ) + (call $export/mul + (i32.const 3) + (i32.const 1) + ) + ) + ) + (call $export/ns.two) + ) ) diff --git a/tests/compiler/import.wast b/tests/compiler/import.wast index 05044762..acb1b194 100644 --- a/tests/compiler/import.wast +++ b/tests/compiler/import.wast @@ -75,73 +75,3 @@ (call $export/ns.two) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: export/add - FUNCTION_PROTOTYPE: export/sub - FUNCTION_PROTOTYPE: export/mul - GLOBAL: export/a - GLOBAL: export/b - GLOBAL: export/c - NAMESPACE: export/ns - FUNCTION_PROTOTYPE: export/ns.one - FUNCTION_PROTOTYPE: export/ns.two - FUNCTION_PROTOTYPE: import/add - FUNCTION_PROTOTYPE: import/sub - FUNCTION_PROTOTYPE: import/mul - GLOBAL: import/a - GLOBAL: import/b - GLOBAL: import/c - NAMESPACE: import/renamed_ns -[program.exports] - FUNCTION_PROTOTYPE: export/add - FUNCTION_PROTOTYPE: export/sub - FUNCTION_PROTOTYPE: export/renamed_mul - GLOBAL: export/a - GLOBAL: export/b - GLOBAL: export/renamed_c - NAMESPACE: export/ns -;) diff --git a/tests/compiler/infer-type.optimized.wast b/tests/compiler/infer-type.optimized.wast index 0315fd85..ee57fcdc 100644 --- a/tests/compiler/infer-type.optimized.wast +++ b/tests/compiler/infer-type.optimized.wast @@ -1,5 +1,9 @@ (module (type $v (func)) + (type $i (func (result i32))) + (type $I (func (result i64))) + (type $f (func (result f32))) + (type $F (func (result f64))) (global $infer-type/ri (mut i32) (i32.const 0)) (global $infer-type/rI (mut i64) (i64.const 0)) (global $infer-type/rf (mut f32) (f32.const 0)) @@ -7,32 +11,49 @@ (memory $0 1) (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $infer-type/locals (; 0 ;) (type $v) + (nop) + ) + (func $infer-type/reti (; 1 ;) (type $i) (result i32) + (i32.const 0) + ) + (func $infer-type/retI (; 2 ;) (type $I) (result i64) + (i64.const 0) + ) + (func $infer-type/retf (; 3 ;) (type $f) (result f32) + (f32.const 0) + ) + (func $infer-type/refF (; 4 ;) (type $F) (result f64) + (f64.const 0) + ) + (func $start (; 5 ;) (type $v) (local $0 i32) + (local $1 i32) + (call $infer-type/locals) (set_global $infer-type/ri - (i32.const 0) + (call $infer-type/reti) ) (set_global $infer-type/rI - (i64.const 0) + (call $infer-type/retI) ) (set_global $infer-type/rf - (f32.const 0) + (call $infer-type/retf) ) (set_global $infer-type/rF - (f64.const 0) + (call $infer-type/refF) + ) + (set_local $1 + (i32.const 10) ) (loop $continue|0 (if - ;;@ infer-type.ts:44:24 (i32.lt_u (get_local $0) - (i32.const 10) + (get_local $1) ) (block - ;;@ infer-type.ts:44:31 (set_local $0 (i32.add - ;;@ infer-type.ts:44:33 (get_local $0) (i32.const 1) ) diff --git a/tests/compiler/infer-type.wast b/tests/compiler/infer-type.wast index b8dba5f7..bcc21f6f 100644 --- a/tests/compiler/infer-type.wast +++ b/tests/compiler/infer-type.wast @@ -166,63 +166,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: infer-type/i - GLOBAL: infer-type/I - GLOBAL: infer-type/F - FUNCTION_PROTOTYPE: infer-type/locals - FUNCTION_PROTOTYPE: infer-type/reti - GLOBAL: infer-type/ri - FUNCTION_PROTOTYPE: infer-type/retI - GLOBAL: infer-type/rI - FUNCTION_PROTOTYPE: infer-type/retf - GLOBAL: infer-type/rf - FUNCTION_PROTOTYPE: infer-type/refF - GLOBAL: infer-type/rF -[program.exports] - -;) diff --git a/tests/compiler/inlining.optimized.wast b/tests/compiler/inlining.optimized.wast index e943c435..83f030ee 100644 --- a/tests/compiler/inlining.optimized.wast +++ b/tests/compiler/inlining.optimized.wast @@ -1,15 +1,31 @@ (module (type $i (func (result i32))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (memory $0 1) + (data (i32.const 8) "\0b\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s") (export "test" (func $inlining/test)) (export "memory" (memory $0)) (start $start) - (func $inlining/test (; 0 ;) (type $i) (result i32) + (func $inlining/test (; 1 ;) (type $i) (result i32) (i32.const 3) ) - (func $start (; 1 ;) (type $v) - ;;@ inlining.ts:8:0 - (nop) + (func $start (; 2 ;) (type $v) + (if + (i32.ne + (call $inlining/test) + (i32.const 3) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 8) + (i32.const 0) + ) + (unreachable) + ) + ) ) ) diff --git a/tests/compiler/inlining.wast b/tests/compiler/inlining.wast index ece11ca2..994f1e31 100644 --- a/tests/compiler/inlining.wast +++ b/tests/compiler/inlining.wast @@ -1,13 +1,16 @@ (module (type $i (func (result i32))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $inlining/constantGlobal i32 (i32.const 1)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 36)) (memory $0 1) + (data (i32.const 8) "\0b\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s\00") (export "test" (func $inlining/test)) (export "memory" (memory $0)) (start $start) - (func $inlining/test (; 0 ;) (type $i) (result i32) + (func $inlining/test (; 1 ;) (type $i) (result i32) ;;@ inlining.ts:4:2 (nop) ;;@ inlining.ts:5:26 @@ -20,7 +23,7 @@ ) ) ) - (func $start (; 1 ;) (type $v) + (func $start (; 2 ;) (type $v) ;;@ inlining.ts:8:0 (if (i32.eqz @@ -31,57 +34,15 @@ (i32.const 3) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 8) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: inlining/constantGlobal - FUNCTION_PROTOTYPE: inlining/test -[program.exports] - FUNCTION_PROTOTYPE: inlining/test -;) diff --git a/tests/compiler/limits.wast b/tests/compiler/limits.wast index 887dbbdc..bfbc96e8 100644 --- a/tests/compiler/limits.wast +++ b/tests/compiler/limits.wast @@ -133,51 +133,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE -[program.exports] - -;) diff --git a/tests/compiler/literals.wast b/tests/compiler/literals.wast index aadfc5af..223c7013 100644 --- a/tests/compiler/literals.wast +++ b/tests/compiler/literals.wast @@ -183,51 +183,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE -[program.exports] - -;) diff --git a/tests/compiler/logical.optimized.wast b/tests/compiler/logical.optimized.wast index 8e237116..a65a862f 100644 --- a/tests/compiler/logical.optimized.wast +++ b/tests/compiler/logical.optimized.wast @@ -1,13 +1,16 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $logical/i (mut i32) (i32.const 0)) (global $logical/I (mut i64) (i64.const 0)) (global $logical/f (mut f32) (f32.const 0)) (global $logical/F (mut f64) (f64.const 0)) (memory $0 1) + (data (i32.const 8) "\n\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s") (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $start (; 1 ;) (type $v) (local $0 i32) (local $1 f64) (if @@ -16,7 +19,6 @@ (i32.const 2) ) ) - ;;@ logical.ts:6:10 (unreachable) ) (if @@ -26,120 +28,151 @@ ) (f64.const 0) ) - ;;@ logical.ts:7:14 (unreachable) ) - ;;@ logical.ts:11:0 (set_global $logical/i (i32.const 2) ) - ;;@ logical.ts:12:0 (if - ;;@ logical.ts:12:7 (i32.ne (get_global $logical/i) - ;;@ logical.ts:12:12 (i32.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 12) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:14:0 (set_global $logical/i (i32.const 1) ) - ;;@ logical.ts:15:0 (if - ;;@ logical.ts:15:7 (i32.ne (get_global $logical/i) - ;;@ logical.ts:15:12 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 15) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:19:0 (set_global $logical/I (i64.const 2) ) - ;;@ logical.ts:20:0 (if - ;;@ logical.ts:20:7 (i64.ne (get_global $logical/I) - ;;@ logical.ts:20:12 (i64.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 20) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:22:0 (set_global $logical/I (i64.const 1) ) - ;;@ logical.ts:23:0 (if - ;;@ logical.ts:23:7 (i64.ne (get_global $logical/I) - ;;@ logical.ts:23:12 (i64.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 23) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:27:0 (set_global $logical/f (f32.const 2) ) - ;;@ logical.ts:28:0 (if - ;;@ logical.ts:28:7 (f32.ne (get_global $logical/f) - ;;@ logical.ts:28:12 (f32.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 28) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:30:0 (set_global $logical/f (f32.const 1) ) - ;;@ logical.ts:31:0 (if - ;;@ logical.ts:31:7 (f32.ne (get_global $logical/f) - ;;@ logical.ts:31:12 (f32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 31) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:35:0 (set_global $logical/F (f64.const 2) ) - ;;@ logical.ts:36:0 (if - ;;@ logical.ts:36:7 (f64.ne (get_global $logical/F) - ;;@ logical.ts:36:12 (f64.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 36) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:38:0 (set_global $logical/F (f64.const 1) ) - ;;@ logical.ts:39:0 (if - ;;@ logical.ts:39:7 (f64.ne (get_global $logical/F) - ;;@ logical.ts:39:12 (f64.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 39) + (i32.const 0) + ) + (unreachable) + ) ) ) ) diff --git a/tests/compiler/logical.wast b/tests/compiler/logical.wast index 123f5094..36ab0622 100644 --- a/tests/compiler/logical.wast +++ b/tests/compiler/logical.wast @@ -1,14 +1,17 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $logical/i (mut i32) (i32.const 0)) (global $logical/I (mut i64) (i64.const 0)) (global $logical/f (mut f32) (f32.const 0)) (global $logical/F (mut f64) (f64.const 0)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 32)) (memory $0 1) + (data (i32.const 8) "\n\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s\00") (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $start (; 1 ;) (type $v) (local $0 i32) (local $1 f64) ;;@ logical.ts:1:0 @@ -126,7 +129,15 @@ (i32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 12) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:14:0 (set_global $logical/i @@ -151,7 +162,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 15) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:19:0 (set_global $logical/I @@ -176,7 +195,15 @@ (i64.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 20) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:22:0 (set_global $logical/I @@ -201,7 +228,15 @@ (i64.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 23) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:27:0 (set_global $logical/f @@ -226,7 +261,15 @@ (f32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 28) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:30:0 (set_global $logical/f @@ -251,7 +294,15 @@ (f32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 31) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:35:0 (set_global $logical/F @@ -276,7 +327,15 @@ (f64.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 36) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:38:0 (set_global $logical/F @@ -301,59 +360,15 @@ (f64.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 39) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: logical/i - GLOBAL: logical/I - GLOBAL: logical/f - GLOBAL: logical/F -[program.exports] - -;) diff --git a/tests/compiler/memcpy.optimized.wast b/tests/compiler/memcpy.optimized.wast index a8cece4f..7f982721 100644 --- a/tests/compiler/memcpy.optimized.wast +++ b/tests/compiler/memcpy.optimized.wast @@ -1,29 +1,27 @@ (module (type $iiii (func (param i32 i32 i32) (result i32))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $memcpy/dest (mut i32) (i32.const 0)) (memory $0 1) + (data (i32.const 8) "\t\00\00\00m\00e\00m\00c\00p\00y\00.\00t\00s") (export "memcpy" (func $memcpy/memcpy)) (export "memory" (memory $0)) (start $start) - (func $memcpy/memcpy (; 0 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $memcpy/memcpy (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - ;;@ memcpy.ts:2:2 (set_local $5 - ;;@ memcpy.ts:2:12 (get_local $0) ) (loop $continue|0 (if - ;;@ memcpy.ts:6:9 (if (result i32) (get_local $2) - ;;@ memcpy.ts:6:14 (i32.rem_u (get_local $1) - ;;@ memcpy.ts:6:20 (i32.const 4) ) (get_local $2) @@ -32,16 +30,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:7:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:7:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:7:31 (block (result i32) (set_local $1 (i32.add @@ -51,13 +46,11 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:7:22 (i32.load8_u (get_local $3) ) ) ) - ;;@ memcpy.ts:8:4 (set_local $2 (i32.sub (get_local $2) @@ -68,112 +61,78 @@ ) ) ) - ;;@ memcpy.ts:12:2 (if (i32.eqz - ;;@ memcpy.ts:12:6 (i32.rem_u (get_local $0) - ;;@ memcpy.ts:12:13 (i32.const 4) ) ) - ;;@ memcpy.ts:12:21 (block (loop $continue|1 (if - ;;@ memcpy.ts:13:11 (i32.ge_u (get_local $2) - ;;@ memcpy.ts:13:16 (i32.const 16) ) (block - ;;@ memcpy.ts:14:6 (i32.store - ;;@ memcpy.ts:14:17 (get_local $0) - ;;@ memcpy.ts:14:28 (i32.load - ;;@ memcpy.ts:14:38 (get_local $1) ) ) - ;;@ memcpy.ts:15:6 (i32.store - ;;@ memcpy.ts:15:17 (i32.add (get_local $0) - ;;@ memcpy.ts:15:25 (i32.const 4) ) - ;;@ memcpy.ts:15:28 (i32.load - ;;@ memcpy.ts:15:38 (i32.add (get_local $1) - ;;@ memcpy.ts:15:45 (i32.const 4) ) ) ) - ;;@ memcpy.ts:16:6 (i32.store - ;;@ memcpy.ts:16:17 (i32.add (get_local $0) - ;;@ memcpy.ts:16:25 (i32.const 8) ) - ;;@ memcpy.ts:16:28 (i32.load - ;;@ memcpy.ts:16:38 (i32.add (get_local $1) - ;;@ memcpy.ts:16:45 (i32.const 8) ) ) ) - ;;@ memcpy.ts:17:6 (i32.store - ;;@ memcpy.ts:17:17 (i32.add (get_local $0) - ;;@ memcpy.ts:17:24 (i32.const 12) ) - ;;@ memcpy.ts:17:28 (i32.load - ;;@ memcpy.ts:17:38 (i32.add (get_local $1) - ;;@ memcpy.ts:17:44 (i32.const 12) ) ) ) - ;;@ memcpy.ts:18:6 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:18:13 (i32.const 16) ) ) - ;;@ memcpy.ts:18:17 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:18:25 (i32.const 16) ) ) - ;;@ memcpy.ts:18:29 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:18:34 (i32.const 16) ) ) @@ -181,160 +140,111 @@ ) ) ) - ;;@ memcpy.ts:20:4 (if - ;;@ memcpy.ts:20:8 (i32.and (get_local $2) - ;;@ memcpy.ts:20:12 (i32.const 8) ) - ;;@ memcpy.ts:20:15 (block - ;;@ memcpy.ts:21:6 (i32.store - ;;@ memcpy.ts:21:17 (get_local $0) - ;;@ memcpy.ts:21:27 (i32.load - ;;@ memcpy.ts:21:37 (get_local $1) ) ) - ;;@ memcpy.ts:22:6 (i32.store - ;;@ memcpy.ts:22:17 (i32.add (get_local $0) - ;;@ memcpy.ts:22:24 (i32.const 4) ) - ;;@ memcpy.ts:22:27 (i32.load - ;;@ memcpy.ts:22:37 (i32.add (get_local $1) - ;;@ memcpy.ts:22:43 (i32.const 4) ) ) ) - ;;@ memcpy.ts:23:6 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:23:14 (i32.const 8) ) ) - ;;@ memcpy.ts:23:17 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:23:24 (i32.const 8) ) ) ) ) - ;;@ memcpy.ts:25:4 (if - ;;@ memcpy.ts:25:8 (i32.and (get_local $2) - ;;@ memcpy.ts:25:12 (i32.const 4) ) - ;;@ memcpy.ts:25:15 (block - ;;@ memcpy.ts:26:6 (i32.store - ;;@ memcpy.ts:26:17 (get_local $0) - ;;@ memcpy.ts:26:23 (i32.load - ;;@ memcpy.ts:26:33 (get_local $1) ) ) - ;;@ memcpy.ts:27:6 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:27:14 (i32.const 4) ) ) - ;;@ memcpy.ts:27:17 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:27:24 (i32.const 4) ) ) ) ) - ;;@ memcpy.ts:29:4 (if - ;;@ memcpy.ts:29:8 (i32.and (get_local $2) - ;;@ memcpy.ts:29:12 (i32.const 2) ) - ;;@ memcpy.ts:29:15 (block - ;;@ memcpy.ts:30:6 (i32.store16 - ;;@ memcpy.ts:30:17 (get_local $0) - ;;@ memcpy.ts:30:23 (i32.load16_u - ;;@ memcpy.ts:30:33 (get_local $1) ) ) - ;;@ memcpy.ts:31:6 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:31:14 (i32.const 2) ) ) - ;;@ memcpy.ts:31:17 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:31:24 (i32.const 2) ) ) ) ) - ;;@ memcpy.ts:33:4 (if - ;;@ memcpy.ts:33:8 (i32.and (get_local $2) - ;;@ memcpy.ts:33:12 (i32.const 1) ) - ;;@ memcpy.ts:34:16 (block (set_local $3 (get_local $0) ) - ;;@ memcpy.ts:34:6 (i32.store8 (get_local $3) - ;;@ memcpy.ts:34:33 (block (result i32) (set_local $3 (get_local $1) ) - ;;@ memcpy.ts:34:24 (i32.load8_u (get_local $3) ) @@ -342,21 +252,16 @@ ) ) ) - ;;@ memcpy.ts:36:11 (return (get_local $5) ) ) ) - ;;@ memcpy.ts:41:2 (if - ;;@ memcpy.ts:41:6 (i32.ge_u (get_local $2) - ;;@ memcpy.ts:41:11 (i32.const 32) ) - ;;@ memcpy.ts:42:4 (block $break|2 (block $case2|2 (block $case1|2 @@ -364,10 +269,8 @@ (block $tablify|0 (br_table $case0|2 $case1|2 $case2|2 $tablify|0 (i32.sub - ;;@ memcpy.ts:42:12 (i32.rem_u (get_local $0) - ;;@ memcpy.ts:42:19 (i32.const 4) ) (i32.const 1) @@ -376,27 +279,21 @@ ) (br $break|2) ) - ;;@ memcpy.ts:45:8 (set_local $4 - ;;@ memcpy.ts:45:12 (i32.load - ;;@ memcpy.ts:45:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:46:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:46:8 (i32.store8 (get_local $3) - ;;@ memcpy.ts:46:35 (block (result i32) (set_local $1 (i32.add @@ -406,7 +303,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:46:26 (i32.load8_u (get_local $3) ) @@ -415,16 +311,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:47:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:47:8 (i32.store8 (get_local $3) - ;;@ memcpy.ts:47:35 (block (result i32) (set_local $1 (i32.add @@ -434,7 +327,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:47:26 (i32.load8_u (get_local $3) ) @@ -443,16 +335,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:48:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:48:8 (i32.store8 (get_local $3) - ;;@ memcpy.ts:48:35 (block (result i32) (set_local $1 (i32.add @@ -462,182 +351,128 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:48:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ memcpy.ts:49:8 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:49:13 (i32.const 3) ) ) (loop $continue|3 (if - ;;@ memcpy.ts:50:15 (i32.ge_u (get_local $2) - ;;@ memcpy.ts:50:20 (i32.const 17) ) (block - ;;@ memcpy.ts:52:10 (i32.store - ;;@ memcpy.ts:52:21 (get_local $0) - ;;@ memcpy.ts:52:27 (i32.or (i32.shr_u (get_local $4) - ;;@ memcpy.ts:52:32 (i32.const 24) ) - ;;@ memcpy.ts:52:37 (i32.shl - ;;@ memcpy.ts:51:10 (tee_local $3 - ;;@ memcpy.ts:51:14 (i32.load - ;;@ memcpy.ts:51:24 (i32.add (get_local $1) - ;;@ memcpy.ts:51:30 (i32.const 1) ) ) ) - ;;@ memcpy.ts:52:42 (i32.const 8) ) ) ) - ;;@ memcpy.ts:54:10 (i32.store - ;;@ memcpy.ts:54:21 (i32.add (get_local $0) - ;;@ memcpy.ts:54:28 (i32.const 4) ) - ;;@ memcpy.ts:54:31 (i32.or (i32.shr_u (get_local $3) - ;;@ memcpy.ts:54:36 (i32.const 24) ) - ;;@ memcpy.ts:54:41 (i32.shl - ;;@ memcpy.ts:53:10 (tee_local $4 - ;;@ memcpy.ts:53:14 (i32.load - ;;@ memcpy.ts:53:24 (i32.add (get_local $1) - ;;@ memcpy.ts:53:30 (i32.const 5) ) ) ) - ;;@ memcpy.ts:54:46 (i32.const 8) ) ) ) - ;;@ memcpy.ts:56:10 (i32.store - ;;@ memcpy.ts:56:21 (i32.add (get_local $0) - ;;@ memcpy.ts:56:28 (i32.const 8) ) - ;;@ memcpy.ts:56:31 (i32.or (i32.shr_u (get_local $4) - ;;@ memcpy.ts:56:36 (i32.const 24) ) - ;;@ memcpy.ts:56:41 (i32.shl - ;;@ memcpy.ts:55:10 (tee_local $3 - ;;@ memcpy.ts:55:14 (i32.load - ;;@ memcpy.ts:55:24 (i32.add (get_local $1) - ;;@ memcpy.ts:55:30 (i32.const 9) ) ) ) - ;;@ memcpy.ts:56:46 (i32.const 8) ) ) ) - ;;@ memcpy.ts:58:10 (i32.store - ;;@ memcpy.ts:58:21 (i32.add (get_local $0) - ;;@ memcpy.ts:58:28 (i32.const 12) ) - ;;@ memcpy.ts:58:32 (i32.or (i32.shr_u (get_local $3) - ;;@ memcpy.ts:58:37 (i32.const 24) ) - ;;@ memcpy.ts:58:42 (i32.shl - ;;@ memcpy.ts:57:10 (tee_local $4 - ;;@ memcpy.ts:57:14 (i32.load - ;;@ memcpy.ts:57:24 (i32.add (get_local $1) - ;;@ memcpy.ts:57:30 (i32.const 13) ) ) ) - ;;@ memcpy.ts:58:47 (i32.const 8) ) ) ) - ;;@ memcpy.ts:59:10 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:59:17 (i32.const 16) ) ) - ;;@ memcpy.ts:59:21 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:59:29 (i32.const 16) ) ) - ;;@ memcpy.ts:59:33 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:59:38 (i32.const 16) ) ) @@ -645,30 +480,23 @@ ) ) ) - ;;@ memcpy.ts:61:8 (br $break|2) ) - ;;@ memcpy.ts:63:8 (set_local $4 - ;;@ memcpy.ts:63:12 (i32.load - ;;@ memcpy.ts:63:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:64:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:64:8 (i32.store8 (get_local $3) - ;;@ memcpy.ts:64:35 (block (result i32) (set_local $1 (i32.add @@ -678,7 +506,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:64:26 (i32.load8_u (get_local $3) ) @@ -687,16 +514,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:65:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:65:8 (i32.store8 (get_local $3) - ;;@ memcpy.ts:65:35 (block (result i32) (set_local $1 (i32.add @@ -706,182 +530,128 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:65:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ memcpy.ts:66:8 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:66:13 (i32.const 2) ) ) (loop $continue|4 (if - ;;@ memcpy.ts:67:15 (i32.ge_u (get_local $2) - ;;@ memcpy.ts:67:20 (i32.const 18) ) (block - ;;@ memcpy.ts:69:10 (i32.store - ;;@ memcpy.ts:69:21 (get_local $0) - ;;@ memcpy.ts:69:27 (i32.or (i32.shr_u (get_local $4) - ;;@ memcpy.ts:69:32 (i32.const 16) ) - ;;@ memcpy.ts:69:37 (i32.shl - ;;@ memcpy.ts:68:10 (tee_local $3 - ;;@ memcpy.ts:68:14 (i32.load - ;;@ memcpy.ts:68:24 (i32.add (get_local $1) - ;;@ memcpy.ts:68:30 (i32.const 2) ) ) ) - ;;@ memcpy.ts:69:42 (i32.const 16) ) ) ) - ;;@ memcpy.ts:71:10 (i32.store - ;;@ memcpy.ts:71:21 (i32.add (get_local $0) - ;;@ memcpy.ts:71:28 (i32.const 4) ) - ;;@ memcpy.ts:71:31 (i32.or (i32.shr_u (get_local $3) - ;;@ memcpy.ts:71:36 (i32.const 16) ) - ;;@ memcpy.ts:71:41 (i32.shl - ;;@ memcpy.ts:70:10 (tee_local $4 - ;;@ memcpy.ts:70:14 (i32.load - ;;@ memcpy.ts:70:24 (i32.add (get_local $1) - ;;@ memcpy.ts:70:30 (i32.const 6) ) ) ) - ;;@ memcpy.ts:71:46 (i32.const 16) ) ) ) - ;;@ memcpy.ts:73:10 (i32.store - ;;@ memcpy.ts:73:21 (i32.add (get_local $0) - ;;@ memcpy.ts:73:28 (i32.const 8) ) - ;;@ memcpy.ts:73:31 (i32.or (i32.shr_u (get_local $4) - ;;@ memcpy.ts:73:36 (i32.const 16) ) - ;;@ memcpy.ts:73:41 (i32.shl - ;;@ memcpy.ts:72:10 (tee_local $3 - ;;@ memcpy.ts:72:14 (i32.load - ;;@ memcpy.ts:72:24 (i32.add (get_local $1) - ;;@ memcpy.ts:72:30 (i32.const 10) ) ) ) - ;;@ memcpy.ts:73:46 (i32.const 16) ) ) ) - ;;@ memcpy.ts:75:10 (i32.store - ;;@ memcpy.ts:75:21 (i32.add (get_local $0) - ;;@ memcpy.ts:75:28 (i32.const 12) ) - ;;@ memcpy.ts:75:32 (i32.or (i32.shr_u (get_local $3) - ;;@ memcpy.ts:75:37 (i32.const 16) ) - ;;@ memcpy.ts:75:42 (i32.shl - ;;@ memcpy.ts:74:10 (tee_local $4 - ;;@ memcpy.ts:74:14 (i32.load - ;;@ memcpy.ts:74:24 (i32.add (get_local $1) - ;;@ memcpy.ts:74:30 (i32.const 14) ) ) ) - ;;@ memcpy.ts:75:47 (i32.const 16) ) ) ) - ;;@ memcpy.ts:76:10 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:76:17 (i32.const 16) ) ) - ;;@ memcpy.ts:76:21 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:76:29 (i32.const 16) ) ) - ;;@ memcpy.ts:76:33 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:76:38 (i32.const 16) ) ) @@ -889,30 +659,23 @@ ) ) ) - ;;@ memcpy.ts:78:8 (br $break|2) ) - ;;@ memcpy.ts:80:8 (set_local $4 - ;;@ memcpy.ts:80:12 (i32.load - ;;@ memcpy.ts:80:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:81:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:81:8 (i32.store8 (get_local $3) - ;;@ memcpy.ts:81:35 (block (result i32) (set_local $1 (i32.add @@ -922,182 +685,128 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:81:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ memcpy.ts:82:8 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:82:13 (i32.const 1) ) ) (loop $continue|5 (if - ;;@ memcpy.ts:83:15 (i32.ge_u (get_local $2) - ;;@ memcpy.ts:83:20 (i32.const 19) ) (block - ;;@ memcpy.ts:85:10 (i32.store - ;;@ memcpy.ts:85:21 (get_local $0) - ;;@ memcpy.ts:85:27 (i32.or (i32.shr_u (get_local $4) - ;;@ memcpy.ts:85:32 (i32.const 8) ) - ;;@ memcpy.ts:85:36 (i32.shl - ;;@ memcpy.ts:84:10 (tee_local $3 - ;;@ memcpy.ts:84:14 (i32.load - ;;@ memcpy.ts:84:24 (i32.add (get_local $1) - ;;@ memcpy.ts:84:30 (i32.const 3) ) ) ) - ;;@ memcpy.ts:85:41 (i32.const 24) ) ) ) - ;;@ memcpy.ts:87:10 (i32.store - ;;@ memcpy.ts:87:21 (i32.add (get_local $0) - ;;@ memcpy.ts:87:28 (i32.const 4) ) - ;;@ memcpy.ts:87:31 (i32.or (i32.shr_u (get_local $3) - ;;@ memcpy.ts:87:36 (i32.const 8) ) - ;;@ memcpy.ts:87:40 (i32.shl - ;;@ memcpy.ts:86:10 (tee_local $4 - ;;@ memcpy.ts:86:14 (i32.load - ;;@ memcpy.ts:86:24 (i32.add (get_local $1) - ;;@ memcpy.ts:86:30 (i32.const 7) ) ) ) - ;;@ memcpy.ts:87:45 (i32.const 24) ) ) ) - ;;@ memcpy.ts:89:10 (i32.store - ;;@ memcpy.ts:89:21 (i32.add (get_local $0) - ;;@ memcpy.ts:89:28 (i32.const 8) ) - ;;@ memcpy.ts:89:31 (i32.or (i32.shr_u (get_local $4) - ;;@ memcpy.ts:89:36 (i32.const 8) ) - ;;@ memcpy.ts:89:40 (i32.shl - ;;@ memcpy.ts:88:10 (tee_local $3 - ;;@ memcpy.ts:88:14 (i32.load - ;;@ memcpy.ts:88:24 (i32.add (get_local $1) - ;;@ memcpy.ts:88:30 (i32.const 11) ) ) ) - ;;@ memcpy.ts:89:45 (i32.const 24) ) ) ) - ;;@ memcpy.ts:91:10 (i32.store - ;;@ memcpy.ts:91:21 (i32.add (get_local $0) - ;;@ memcpy.ts:91:28 (i32.const 12) ) - ;;@ memcpy.ts:91:32 (i32.or (i32.shr_u (get_local $3) - ;;@ memcpy.ts:91:37 (i32.const 8) ) - ;;@ memcpy.ts:91:41 (i32.shl - ;;@ memcpy.ts:90:10 (tee_local $4 - ;;@ memcpy.ts:90:14 (i32.load - ;;@ memcpy.ts:90:24 (i32.add (get_local $1) - ;;@ memcpy.ts:90:30 (i32.const 15) ) ) ) - ;;@ memcpy.ts:91:46 (i32.const 24) ) ) ) - ;;@ memcpy.ts:92:10 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:92:17 (i32.const 16) ) ) - ;;@ memcpy.ts:92:21 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:92:29 (i32.const 16) ) ) - ;;@ memcpy.ts:92:33 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:92:38 (i32.const 16) ) ) @@ -1107,29 +816,22 @@ ) ) ) - ;;@ memcpy.ts:99:2 (if - ;;@ memcpy.ts:99:6 (i32.and (get_local $2) - ;;@ memcpy.ts:99:10 (i32.const 16) ) - ;;@ memcpy.ts:99:14 (block (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:100:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:100:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:100:31 (block (result i32) (set_local $1 (i32.add @@ -1139,7 +841,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:100:22 (i32.load8_u (get_local $3) ) @@ -1148,16 +849,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:101:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:101:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:101:31 (block (result i32) (set_local $1 (i32.add @@ -1167,7 +865,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:101:22 (i32.load8_u (get_local $3) ) @@ -1176,16 +873,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:102:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:102:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:102:31 (block (result i32) (set_local $1 (i32.add @@ -1195,7 +889,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:102:22 (i32.load8_u (get_local $3) ) @@ -1204,16 +897,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:103:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:103:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:103:31 (block (result i32) (set_local $1 (i32.add @@ -1223,7 +913,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:103:22 (i32.load8_u (get_local $3) ) @@ -1232,16 +921,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:104:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:104:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:104:31 (block (result i32) (set_local $1 (i32.add @@ -1251,7 +937,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:104:22 (i32.load8_u (get_local $3) ) @@ -1260,16 +945,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:105:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:105:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:105:31 (block (result i32) (set_local $1 (i32.add @@ -1279,7 +961,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:105:22 (i32.load8_u (get_local $3) ) @@ -1288,16 +969,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:106:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:106:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:106:31 (block (result i32) (set_local $1 (i32.add @@ -1307,7 +985,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:106:22 (i32.load8_u (get_local $3) ) @@ -1316,16 +993,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:107:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:107:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:107:31 (block (result i32) (set_local $1 (i32.add @@ -1335,7 +1009,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:107:22 (i32.load8_u (get_local $3) ) @@ -1344,16 +1017,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:108:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:108:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:108:31 (block (result i32) (set_local $1 (i32.add @@ -1363,7 +1033,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:108:22 (i32.load8_u (get_local $3) ) @@ -1372,16 +1041,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:109:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:109:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:109:31 (block (result i32) (set_local $1 (i32.add @@ -1391,7 +1057,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:109:22 (i32.load8_u (get_local $3) ) @@ -1400,16 +1065,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:110:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:110:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:110:31 (block (result i32) (set_local $1 (i32.add @@ -1419,7 +1081,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:110:22 (i32.load8_u (get_local $3) ) @@ -1428,16 +1089,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:111:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:111:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:111:31 (block (result i32) (set_local $1 (i32.add @@ -1447,7 +1105,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:111:22 (i32.load8_u (get_local $3) ) @@ -1456,16 +1113,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:112:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:112:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:112:31 (block (result i32) (set_local $1 (i32.add @@ -1475,7 +1129,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:112:22 (i32.load8_u (get_local $3) ) @@ -1484,16 +1137,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:113:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:113:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:113:31 (block (result i32) (set_local $1 (i32.add @@ -1503,7 +1153,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:113:22 (i32.load8_u (get_local $3) ) @@ -1512,16 +1161,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:114:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:114:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:114:31 (block (result i32) (set_local $1 (i32.add @@ -1531,7 +1177,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:114:22 (i32.load8_u (get_local $3) ) @@ -1540,16 +1185,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:115:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:115:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:115:31 (block (result i32) (set_local $1 (i32.add @@ -1559,7 +1201,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:115:22 (i32.load8_u (get_local $3) ) @@ -1567,29 +1208,22 @@ ) ) ) - ;;@ memcpy.ts:117:2 (if - ;;@ memcpy.ts:117:6 (i32.and (get_local $2) - ;;@ memcpy.ts:117:10 (i32.const 8) ) - ;;@ memcpy.ts:117:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:118:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:118:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:118:31 (block (result i32) (set_local $1 (i32.add @@ -1599,7 +1233,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:118:22 (i32.load8_u (get_local $3) ) @@ -1608,16 +1241,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:119:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:119:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:119:31 (block (result i32) (set_local $1 (i32.add @@ -1627,7 +1257,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:119:22 (i32.load8_u (get_local $3) ) @@ -1636,16 +1265,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:120:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:120:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:120:31 (block (result i32) (set_local $1 (i32.add @@ -1655,7 +1281,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:120:22 (i32.load8_u (get_local $3) ) @@ -1664,16 +1289,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:121:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:121:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:121:31 (block (result i32) (set_local $1 (i32.add @@ -1683,7 +1305,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:121:22 (i32.load8_u (get_local $3) ) @@ -1692,16 +1313,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:122:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:122:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:122:31 (block (result i32) (set_local $1 (i32.add @@ -1711,7 +1329,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:122:22 (i32.load8_u (get_local $3) ) @@ -1720,16 +1337,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:123:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:123:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:123:31 (block (result i32) (set_local $1 (i32.add @@ -1739,7 +1353,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:123:22 (i32.load8_u (get_local $3) ) @@ -1748,16 +1361,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:124:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:124:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:124:31 (block (result i32) (set_local $1 (i32.add @@ -1767,7 +1377,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:124:22 (i32.load8_u (get_local $3) ) @@ -1776,16 +1385,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:125:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:125:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:125:31 (block (result i32) (set_local $1 (i32.add @@ -1795,7 +1401,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:125:22 (i32.load8_u (get_local $3) ) @@ -1803,29 +1408,22 @@ ) ) ) - ;;@ memcpy.ts:127:2 (if - ;;@ memcpy.ts:127:6 (i32.and (get_local $2) - ;;@ memcpy.ts:127:10 (i32.const 4) ) - ;;@ memcpy.ts:127:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:128:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:128:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:128:31 (block (result i32) (set_local $1 (i32.add @@ -1835,7 +1433,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:128:22 (i32.load8_u (get_local $3) ) @@ -1844,16 +1441,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:129:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:129:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:129:31 (block (result i32) (set_local $1 (i32.add @@ -1863,7 +1457,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:129:22 (i32.load8_u (get_local $3) ) @@ -1872,16 +1465,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:130:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:130:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:130:31 (block (result i32) (set_local $1 (i32.add @@ -1891,7 +1481,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:130:22 (i32.load8_u (get_local $3) ) @@ -1900,16 +1489,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:131:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:131:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:131:31 (block (result i32) (set_local $1 (i32.add @@ -1919,7 +1505,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:131:22 (i32.load8_u (get_local $3) ) @@ -1927,29 +1512,22 @@ ) ) ) - ;;@ memcpy.ts:133:2 (if - ;;@ memcpy.ts:133:6 (i32.and (get_local $2) - ;;@ memcpy.ts:133:10 (i32.const 2) ) - ;;@ memcpy.ts:133:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:134:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:134:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:134:31 (block (result i32) (set_local $1 (i32.add @@ -1959,7 +1537,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:134:22 (i32.load8_u (get_local $3) ) @@ -1968,16 +1545,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:135:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:135:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:135:31 (block (result i32) (set_local $1 (i32.add @@ -1987,7 +1561,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:135:22 (i32.load8_u (get_local $3) ) @@ -1995,28 +1568,21 @@ ) ) ) - ;;@ memcpy.ts:137:2 (if - ;;@ memcpy.ts:137:6 (i32.and (get_local $2) - ;;@ memcpy.ts:137:10 (i32.const 1) ) - ;;@ memcpy.ts:138:14 (block (set_local $3 (get_local $0) ) - ;;@ memcpy.ts:138:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:138:31 (block (result i32) (set_local $3 (get_local $1) ) - ;;@ memcpy.ts:138:22 (i32.load8_u (get_local $3) ) @@ -2024,235 +1590,252 @@ ) ) ) - ;;@ memcpy.ts:140:9 (get_local $5) ) - (func $start (; 1 ;) (type $v) - ;;@ memcpy.ts:144:0 + (func $start (; 2 ;) (type $v) (i64.store - ;;@ memcpy.ts:144:11 (i32.const 8) - ;;@ memcpy.ts:144:22 (i64.const 1229782938247303441) ) - ;;@ memcpy.ts:145:0 (i64.store - ;;@ memcpy.ts:145:18 (i32.const 16) - ;;@ memcpy.ts:145:22 (i64.const 2459565876494606882) ) - ;;@ memcpy.ts:146:0 (i64.store - ;;@ memcpy.ts:146:18 (i32.const 24) - ;;@ memcpy.ts:146:22 (i64.const 3689348814741910323) ) - ;;@ memcpy.ts:147:0 (i64.store - ;;@ memcpy.ts:147:18 (i32.const 32) - ;;@ memcpy.ts:147:22 (i64.const 4919131752989213764) ) - ;;@ memcpy.ts:150:0 (set_global $memcpy/dest - ;;@ memcpy.ts:150:7 (call $memcpy/memcpy - ;;@ memcpy.ts:150:21 (i32.const 9) - ;;@ memcpy.ts:150:31 (i32.const 24) - ;;@ memcpy.ts:150:35 (i32.const 4) ) ) - ;;@ memcpy.ts:151:0 (if - ;;@ memcpy.ts:151:7 (i32.ne (get_global $memcpy/dest) - ;;@ memcpy.ts:151:22 (i32.const 9) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 151) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:152:0 (if - ;;@ memcpy.ts:152:7 (i64.ne (i64.load - ;;@ memcpy.ts:152:17 (i32.const 8) ) - ;;@ memcpy.ts:152:26 (i64.const 1229783084848853777) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 152) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:154:0 (set_global $memcpy/dest - ;;@ memcpy.ts:154:7 (call $memcpy/memcpy - ;;@ memcpy.ts:154:14 (i32.const 8) - ;;@ memcpy.ts:154:20 (i32.const 8) - ;;@ memcpy.ts:154:26 (i32.const 32) ) ) - ;;@ memcpy.ts:155:0 (if - ;;@ memcpy.ts:155:7 (i32.ne (get_global $memcpy/dest) - ;;@ memcpy.ts:155:15 (i32.const 8) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 155) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:156:0 (if - ;;@ memcpy.ts:156:7 (i64.ne (i64.load - ;;@ memcpy.ts:156:17 (i32.const 8) ) - ;;@ memcpy.ts:156:26 (i64.const 1229783084848853777) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 156) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:157:0 (if - ;;@ memcpy.ts:157:7 (i64.ne (i64.load - ;;@ memcpy.ts:157:24 (i32.const 16) ) - ;;@ memcpy.ts:157:30 (i64.const 2459565876494606882) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 157) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:158:0 (if - ;;@ memcpy.ts:158:7 (i64.ne (i64.load - ;;@ memcpy.ts:158:24 (i32.const 24) ) - ;;@ memcpy.ts:158:31 (i64.const 3689348814741910323) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 158) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:159:0 (if - ;;@ memcpy.ts:159:7 (i64.ne (i64.load - ;;@ memcpy.ts:159:24 (i32.const 32) ) - ;;@ memcpy.ts:159:31 (i64.const 4919131752989213764) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 159) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:161:0 (set_global $memcpy/dest - ;;@ memcpy.ts:161:7 (call $memcpy/memcpy - ;;@ memcpy.ts:161:21 (i32.const 13) - ;;@ memcpy.ts:161:31 (i32.const 36) - ;;@ memcpy.ts:161:35 (i32.const 3) ) ) - ;;@ memcpy.ts:162:0 (if - ;;@ memcpy.ts:162:7 (i64.ne (i64.load - ;;@ memcpy.ts:162:17 (i32.const 8) ) - ;;@ memcpy.ts:162:26 (i64.const 4919131679688438545) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 162) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:164:0 (set_global $memcpy/dest - ;;@ memcpy.ts:164:7 (call $memcpy/memcpy - ;;@ memcpy.ts:164:21 (i32.const 16) - ;;@ memcpy.ts:164:31 (i32.const 24) - ;;@ memcpy.ts:164:35 (i32.const 15) ) ) - ;;@ memcpy.ts:165:0 (if - ;;@ memcpy.ts:165:7 (i64.ne (i64.load - ;;@ memcpy.ts:165:17 (i32.const 8) ) - ;;@ memcpy.ts:165:26 (i64.const 4919131679688438545) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 165) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:166:0 (if - ;;@ memcpy.ts:166:7 (i64.ne (i64.load - ;;@ memcpy.ts:166:24 (i32.const 16) ) - ;;@ memcpy.ts:166:30 (i64.const 3689348814741910323) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 166) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:167:0 (if - ;;@ memcpy.ts:167:7 (i64.ne (i64.load - ;;@ memcpy.ts:167:24 (i32.const 24) ) - ;;@ memcpy.ts:167:31 (i64.const 3694152654344438852) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 167) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:168:0 (if - ;;@ memcpy.ts:168:7 (i64.ne (i64.load - ;;@ memcpy.ts:168:24 (i32.const 32) ) - ;;@ memcpy.ts:168:31 (i64.const 4919131752989213764) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 168) + (i32.const 0) + ) + (unreachable) + ) ) ) ) diff --git a/tests/compiler/memcpy.wast b/tests/compiler/memcpy.wast index e86cf4ee..e3e47bd8 100644 --- a/tests/compiler/memcpy.wast +++ b/tests/compiler/memcpy.wast @@ -1,14 +1,17 @@ (module (type $iiii (func (param i32 i32 i32) (result i32))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $memcpy/base i32 (i32.const 8)) (global $memcpy/dest (mut i32) (i32.const 0)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 32)) (memory $0 1) + (data (i32.const 8) "\t\00\00\00m\00e\00m\00c\00p\00y\00.\00t\00s\00") (export "memcpy" (func $memcpy/memcpy)) (export "memory" (memory $0)) (start $start) - (func $memcpy/memcpy (; 0 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $memcpy/memcpy (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2265,7 +2268,7 @@ (get_local $3) ) ) - (func $start (; 1 ;) (type $v) + (func $start (; 2 ;) (type $v) ;;@ memcpy.ts:144:0 (i64.store ;;@ memcpy.ts:144:11 @@ -2340,7 +2343,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 151) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:152:0 (if @@ -2355,7 +2366,15 @@ (i64.const 1229783084848853777) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 152) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:154:0 (set_global $memcpy/dest @@ -2379,7 +2398,15 @@ (i32.const 8) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 155) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:156:0 (if @@ -2394,7 +2421,15 @@ (i64.const 1229783084848853777) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 156) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:157:0 (if @@ -2413,7 +2448,15 @@ (i64.const 2459565876494606882) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 157) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:158:0 (if @@ -2432,7 +2475,15 @@ (i64.const 3689348814741910323) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 158) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:159:0 (if @@ -2451,7 +2502,15 @@ (i64.const 4919131752989213764) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 159) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:161:0 (set_global $memcpy/dest @@ -2486,7 +2545,15 @@ (i64.const 4919131679688438545) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 162) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:164:0 (set_global $memcpy/dest @@ -2521,7 +2588,15 @@ (i64.const 4919131679688438545) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 165) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:166:0 (if @@ -2540,7 +2615,15 @@ (i64.const 3689348814741910323) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 166) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:167:0 (if @@ -2559,7 +2642,15 @@ (i64.const 3694152654344438852) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 167) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:168:0 (if @@ -2578,58 +2669,15 @@ (i64.const 4919131752989213764) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 168) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: memcpy/memcpy - GLOBAL: memcpy/base - GLOBAL: memcpy/dest -[program.exports] - FUNCTION_PROTOTYPE: memcpy/memcpy -;) diff --git a/tests/compiler/memmove.optimized.wast b/tests/compiler/memmove.optimized.wast index 90cf3651..8d0ac8a0 100644 --- a/tests/compiler/memmove.optimized.wast +++ b/tests/compiler/memmove.optimized.wast @@ -1,84 +1,63 @@ (module (type $iiii (func (param i32 i32 i32) (result i32))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $memmove/dest (mut i32) (i32.const 0)) (memory $0 1) + (data (i32.const 8) "\n\00\00\00m\00e\00m\00m\00o\00v\00e\00.\00t\00s") (export "memory" (memory $0)) (start $start) - (func $memmove/memmove (; 0 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $memmove/memmove (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - ;;@ memmove.ts:2:2 (set_local $4 - ;;@ memmove.ts:2:12 (get_local $0) ) - ;;@ memmove.ts:3:2 (if - ;;@ memmove.ts:3:6 (i32.eq (get_local $0) - ;;@ memmove.ts:3:14 (get_local $1) ) - ;;@ memmove.ts:4:11 (return (get_local $4) ) ) - ;;@ memmove.ts:9:2 (if - ;;@ memmove.ts:9:6 (i32.lt_u (get_local $0) - ;;@ memmove.ts:9:13 (get_local $1) ) - ;;@ memmove.ts:9:18 (block - ;;@ memmove.ts:10:4 (if - ;;@ memmove.ts:10:8 (i32.eq (i32.rem_u (get_local $1) - ;;@ memmove.ts:10:14 (i32.const 8) ) - ;;@ memmove.ts:10:19 (i32.rem_u (get_local $0) - ;;@ memmove.ts:10:26 (i32.const 8) ) ) - ;;@ memmove.ts:10:29 (block (loop $continue|0 (if - ;;@ memmove.ts:11:13 (i32.rem_u (get_local $0) - ;;@ memmove.ts:11:20 (i32.const 8) ) (block - ;;@ memmove.ts:12:8 (if - ;;@ memmove.ts:12:12 (i32.eqz - ;;@ memmove.ts:12:13 (get_local $2) ) - ;;@ memmove.ts:13:17 (return (get_local $4) ) ) - ;;@ memmove.ts:14:8 (set_local $2 (i32.sub - ;;@ memmove.ts:14:10 (get_local $2) (i32.const 1) ) @@ -86,16 +65,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memmove.ts:15:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ memmove.ts:15:8 (i32.store8 (get_local $3) - ;;@ memmove.ts:15:35 (block (result i32) (set_local $1 (i32.add @@ -105,7 +81,6 @@ (i32.const 1) ) ) - ;;@ memmove.ts:15:26 (i32.load8_u (get_local $3) ) @@ -117,44 +92,32 @@ ) (loop $continue|1 (if - ;;@ memmove.ts:17:13 (i32.ge_u (get_local $2) - ;;@ memmove.ts:17:18 (i32.const 8) ) (block - ;;@ memmove.ts:18:8 (i64.store - ;;@ memmove.ts:18:19 (get_local $0) - ;;@ memmove.ts:18:25 (i64.load - ;;@ memmove.ts:18:35 (get_local $1) ) ) - ;;@ memmove.ts:19:8 (set_local $2 (i32.sub (get_local $2) - ;;@ memmove.ts:19:13 (i32.const 8) ) ) - ;;@ memmove.ts:20:8 (set_local $0 (i32.add (get_local $0) - ;;@ memmove.ts:20:16 (i32.const 8) ) ) - ;;@ memmove.ts:21:8 (set_local $1 (i32.add (get_local $1) - ;;@ memmove.ts:21:15 (i32.const 8) ) ) @@ -166,22 +129,18 @@ ) (loop $continue|2 (if - ;;@ memmove.ts:24:11 (get_local $2) (block (set_local $0 (i32.add (tee_local $3 - ;;@ memmove.ts:25:16 (get_local $0) ) (i32.const 1) ) ) - ;;@ memmove.ts:25:6 (i32.store8 (get_local $3) - ;;@ memmove.ts:25:33 (block (result i32) (set_local $1 (i32.add @@ -191,16 +150,13 @@ (i32.const 1) ) ) - ;;@ memmove.ts:25:24 (i32.load8_u (get_local $3) ) ) ) - ;;@ memmove.ts:26:6 (set_local $2 (i32.sub - ;;@ memmove.ts:26:8 (get_local $2) (i32.const 1) ) @@ -210,72 +166,50 @@ ) ) ) - ;;@ memmove.ts:28:9 (block - ;;@ memmove.ts:29:4 (if - ;;@ memmove.ts:29:8 (i32.eq (i32.rem_u (get_local $1) - ;;@ memmove.ts:29:14 (i32.const 8) ) - ;;@ memmove.ts:29:19 (i32.rem_u (get_local $0) - ;;@ memmove.ts:29:26 (i32.const 8) ) ) - ;;@ memmove.ts:29:29 (block (loop $continue|3 (if - ;;@ memmove.ts:30:13 (i32.rem_u (i32.add - ;;@ memmove.ts:30:14 (get_local $0) - ;;@ memmove.ts:30:21 (get_local $2) ) - ;;@ memmove.ts:30:26 (i32.const 8) ) (block - ;;@ memmove.ts:31:8 (if - ;;@ memmove.ts:31:12 (i32.eqz - ;;@ memmove.ts:31:13 (get_local $2) ) - ;;@ memmove.ts:32:17 (return (get_local $4) ) ) - ;;@ memmove.ts:33:8 (i32.store8 - ;;@ memmove.ts:33:18 (i32.add (get_local $0) - ;;@ memmove.ts:33:25 (tee_local $2 (i32.sub - ;;@ memmove.ts:33:27 (get_local $2) (i32.const 1) ) ) ) - ;;@ memmove.ts:33:30 (i32.load8_u - ;;@ memmove.ts:33:39 (i32.add (get_local $1) - ;;@ memmove.ts:33:45 (get_local $2) ) ) @@ -286,33 +220,24 @@ ) (loop $continue|4 (if - ;;@ memmove.ts:35:13 (i32.ge_u (get_local $2) - ;;@ memmove.ts:35:18 (i32.const 8) ) (block - ;;@ memmove.ts:37:8 (i64.store - ;;@ memmove.ts:37:19 (i32.add (get_local $0) - ;;@ memmove.ts:36:8 (tee_local $2 (i32.sub (get_local $2) - ;;@ memmove.ts:36:13 (i32.const 8) ) ) ) - ;;@ memmove.ts:37:29 (i64.load - ;;@ memmove.ts:37:39 (i32.add (get_local $1) - ;;@ memmove.ts:37:45 (get_local $2) ) ) @@ -325,29 +250,21 @@ ) (loop $continue|5 (if - ;;@ memmove.ts:40:11 (get_local $2) (block - ;;@ memmove.ts:41:6 (i32.store8 - ;;@ memmove.ts:41:16 (i32.add (get_local $0) - ;;@ memmove.ts:41:23 (tee_local $2 (i32.sub - ;;@ memmove.ts:41:25 (get_local $2) (i32.const 1) ) ) ) - ;;@ memmove.ts:41:28 (i32.load8_u - ;;@ memmove.ts:41:37 (i32.add (get_local $1) - ;;@ memmove.ts:41:43 (get_local $2) ) ) @@ -358,235 +275,252 @@ ) ) ) - ;;@ memmove.ts:44:9 (get_local $4) ) - (func $start (; 1 ;) (type $v) - ;;@ memmove.ts:48:0 + (func $start (; 2 ;) (type $v) (i64.store - ;;@ memmove.ts:48:11 (i32.const 8) - ;;@ memmove.ts:48:22 (i64.const 1229782938247303441) ) - ;;@ memmove.ts:49:0 (i64.store - ;;@ memmove.ts:49:18 (i32.const 16) - ;;@ memmove.ts:49:22 (i64.const 2459565876494606882) ) - ;;@ memmove.ts:50:0 (i64.store - ;;@ memmove.ts:50:18 (i32.const 24) - ;;@ memmove.ts:50:22 (i64.const 3689348814741910323) ) - ;;@ memmove.ts:51:0 (i64.store - ;;@ memmove.ts:51:18 (i32.const 32) - ;;@ memmove.ts:51:22 (i64.const 4919131752989213764) ) - ;;@ memmove.ts:54:0 (set_global $memmove/dest - ;;@ memmove.ts:54:7 (call $memmove/memmove - ;;@ memmove.ts:54:22 (i32.const 9) - ;;@ memmove.ts:54:32 (i32.const 24) - ;;@ memmove.ts:54:36 (i32.const 4) ) ) - ;;@ memmove.ts:55:0 (if - ;;@ memmove.ts:55:7 (i32.ne (get_global $memmove/dest) - ;;@ memmove.ts:55:22 (i32.const 9) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 55) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memmove.ts:56:0 (if - ;;@ memmove.ts:56:7 (i64.ne (i64.load - ;;@ memmove.ts:56:17 (i32.const 8) ) - ;;@ memmove.ts:56:26 (i64.const 1229783084848853777) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 56) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memmove.ts:58:0 (set_global $memmove/dest - ;;@ memmove.ts:58:7 (call $memmove/memmove - ;;@ memmove.ts:58:15 (i32.const 8) - ;;@ memmove.ts:58:21 (i32.const 8) - ;;@ memmove.ts:58:27 (i32.const 32) ) ) - ;;@ memmove.ts:59:0 (if - ;;@ memmove.ts:59:7 (i32.ne (get_global $memmove/dest) - ;;@ memmove.ts:59:15 (i32.const 8) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 59) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memmove.ts:60:0 (if - ;;@ memmove.ts:60:7 (i64.ne (i64.load - ;;@ memmove.ts:60:17 (i32.const 8) ) - ;;@ memmove.ts:60:26 (i64.const 1229783084848853777) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 60) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memmove.ts:61:0 (if - ;;@ memmove.ts:61:7 (i64.ne (i64.load - ;;@ memmove.ts:61:24 (i32.const 16) ) - ;;@ memmove.ts:61:30 (i64.const 2459565876494606882) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 61) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memmove.ts:62:0 (if - ;;@ memmove.ts:62:7 (i64.ne (i64.load - ;;@ memmove.ts:62:24 (i32.const 24) ) - ;;@ memmove.ts:62:31 (i64.const 3689348814741910323) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 62) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memmove.ts:63:0 (if - ;;@ memmove.ts:63:7 (i64.ne (i64.load - ;;@ memmove.ts:63:24 (i32.const 32) ) - ;;@ memmove.ts:63:31 (i64.const 4919131752989213764) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 63) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memmove.ts:65:0 (set_global $memmove/dest - ;;@ memmove.ts:65:7 (call $memmove/memmove - ;;@ memmove.ts:65:22 (i32.const 13) - ;;@ memmove.ts:65:32 (i32.const 36) - ;;@ memmove.ts:65:36 (i32.const 3) ) ) - ;;@ memmove.ts:66:0 (if - ;;@ memmove.ts:66:7 (i64.ne (i64.load - ;;@ memmove.ts:66:17 (i32.const 8) ) - ;;@ memmove.ts:66:26 (i64.const 4919131679688438545) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 66) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memmove.ts:68:0 (set_global $memmove/dest - ;;@ memmove.ts:68:7 (call $memmove/memmove - ;;@ memmove.ts:68:22 (i32.const 16) - ;;@ memmove.ts:68:32 (i32.const 24) - ;;@ memmove.ts:68:36 (i32.const 15) ) ) - ;;@ memmove.ts:69:0 (if - ;;@ memmove.ts:69:7 (i64.ne (i64.load - ;;@ memmove.ts:69:17 (i32.const 8) ) - ;;@ memmove.ts:69:26 (i64.const 4919131679688438545) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 69) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memmove.ts:70:0 (if - ;;@ memmove.ts:70:7 (i64.ne (i64.load - ;;@ memmove.ts:70:24 (i32.const 16) ) - ;;@ memmove.ts:70:30 (i64.const 3689348814741910323) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 70) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memmove.ts:71:0 (if - ;;@ memmove.ts:71:7 (i64.ne (i64.load - ;;@ memmove.ts:71:24 (i32.const 24) ) - ;;@ memmove.ts:71:31 (i64.const 3694152654344438852) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 71) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memmove.ts:72:0 (if - ;;@ memmove.ts:72:7 (i64.ne (i64.load - ;;@ memmove.ts:72:24 (i32.const 32) ) - ;;@ memmove.ts:72:31 (i64.const 4919131752989213764) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 72) + (i32.const 0) + ) + (unreachable) + ) ) ) ) diff --git a/tests/compiler/memmove.wast b/tests/compiler/memmove.wast index 9b62a919..a6d1d564 100644 --- a/tests/compiler/memmove.wast +++ b/tests/compiler/memmove.wast @@ -1,13 +1,16 @@ (module (type $iiii (func (param i32 i32 i32) (result i32))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $memmove/base i32 (i32.const 8)) (global $memmove/dest (mut i32) (i32.const 0)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 32)) (memory $0 1) + (data (i32.const 8) "\n\00\00\00m\00e\00m\00m\00o\00v\00e\00.\00t\00s\00") (export "memory" (memory $0)) (start $start) - (func $memmove/memmove (; 0 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $memmove/memmove (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) ;;@ memmove.ts:2:2 @@ -403,7 +406,7 @@ (get_local $3) ) ) - (func $start (; 1 ;) (type $v) + (func $start (; 2 ;) (type $v) ;;@ memmove.ts:48:0 (i64.store ;;@ memmove.ts:48:11 @@ -478,7 +481,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 55) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memmove.ts:56:0 (if @@ -493,7 +504,15 @@ (i64.const 1229783084848853777) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 56) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memmove.ts:58:0 (set_global $memmove/dest @@ -517,7 +536,15 @@ (i32.const 8) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 59) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memmove.ts:60:0 (if @@ -532,7 +559,15 @@ (i64.const 1229783084848853777) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 60) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memmove.ts:61:0 (if @@ -551,7 +586,15 @@ (i64.const 2459565876494606882) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 61) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memmove.ts:62:0 (if @@ -570,7 +613,15 @@ (i64.const 3689348814741910323) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 62) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memmove.ts:63:0 (if @@ -589,7 +640,15 @@ (i64.const 4919131752989213764) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 63) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memmove.ts:65:0 (set_global $memmove/dest @@ -624,7 +683,15 @@ (i64.const 4919131679688438545) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 66) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memmove.ts:68:0 (set_global $memmove/dest @@ -659,7 +726,15 @@ (i64.const 4919131679688438545) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 69) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memmove.ts:70:0 (if @@ -678,7 +753,15 @@ (i64.const 3689348814741910323) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 70) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memmove.ts:71:0 (if @@ -697,7 +780,15 @@ (i64.const 3694152654344438852) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 71) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memmove.ts:72:0 (if @@ -716,58 +807,15 @@ (i64.const 4919131752989213764) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 72) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: memmove/memmove - GLOBAL: memmove/base - GLOBAL: memmove/dest -[program.exports] - -;) diff --git a/tests/compiler/memset.optimized.wast b/tests/compiler/memset.optimized.wast index 152007c8..ea8cc229 100644 --- a/tests/compiler/memset.optimized.wast +++ b/tests/compiler/memset.optimized.wast @@ -1,489 +1,338 @@ (module (type $iiii (func (param i32 i32 i32) (result i32))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $memset/dest (mut i32) (i32.const 0)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 32)) (memory $0 1) + (data (i32.const 8) "\t\00\00\00m\00e\00m\00s\00e\00t\00.\00t\00s") (export "memory" (memory $0)) (start $start) - (func $memset/memset (; 0 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $memset/memset (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i64) (local $5 i32) (block $folding-inner0 - ;;@ memset.ts:2:2 (set_local $3 - ;;@ memset.ts:2:12 (get_local $0) ) (br_if $folding-inner0 - ;;@ memset.ts:5:6 (i32.eqz - ;;@ memset.ts:5:7 (get_local $2) ) ) - ;;@ memset.ts:7:2 (i32.store8 - ;;@ memset.ts:7:12 (get_local $0) - ;;@ memset.ts:7:18 (get_local $1) ) - ;;@ memset.ts:8:2 (i32.store8 - ;;@ memset.ts:8:12 (i32.sub (i32.add (get_local $0) - ;;@ memset.ts:8:19 (get_local $2) ) - ;;@ memset.ts:8:23 (i32.const 1) ) - ;;@ memset.ts:8:26 (get_local $1) ) (br_if $folding-inner0 - ;;@ memset.ts:9:6 (i32.le_u (get_local $2) - ;;@ memset.ts:9:11 (i32.const 2) ) ) - ;;@ memset.ts:12:2 (i32.store8 - ;;@ memset.ts:12:12 (i32.add (get_local $0) - ;;@ memset.ts:12:19 (i32.const 1) ) - ;;@ memset.ts:12:22 (get_local $1) ) - ;;@ memset.ts:13:2 (i32.store8 - ;;@ memset.ts:13:12 (i32.add (get_local $0) - ;;@ memset.ts:13:19 (i32.const 2) ) - ;;@ memset.ts:13:22 (get_local $1) ) - ;;@ memset.ts:14:2 (i32.store8 - ;;@ memset.ts:14:12 (i32.sub (i32.add (get_local $0) - ;;@ memset.ts:14:19 (get_local $2) ) - ;;@ memset.ts:14:23 (i32.const 2) ) - ;;@ memset.ts:14:26 (get_local $1) ) - ;;@ memset.ts:15:2 (i32.store8 - ;;@ memset.ts:15:12 (i32.sub (i32.add (get_local $0) - ;;@ memset.ts:15:19 (get_local $2) ) - ;;@ memset.ts:15:23 (i32.const 3) ) - ;;@ memset.ts:15:26 (get_local $1) ) (br_if $folding-inner0 - ;;@ memset.ts:16:6 (i32.le_u (get_local $2) - ;;@ memset.ts:16:11 (i32.const 6) ) ) - ;;@ memset.ts:18:2 (i32.store8 - ;;@ memset.ts:18:12 (i32.add (get_local $0) - ;;@ memset.ts:18:19 (i32.const 3) ) - ;;@ memset.ts:18:22 (get_local $1) ) - ;;@ memset.ts:19:2 (i32.store8 - ;;@ memset.ts:19:12 (i32.sub (i32.add (get_local $0) - ;;@ memset.ts:19:19 (get_local $2) ) - ;;@ memset.ts:19:23 (i32.const 4) ) - ;;@ memset.ts:19:26 (get_local $1) ) (br_if $folding-inner0 - ;;@ memset.ts:20:6 (i32.le_u (get_local $2) - ;;@ memset.ts:20:11 (i32.const 8) ) ) - ;;@ memset.ts:32:2 (i32.store - ;;@ memset.ts:25:2 (tee_local $0 (i32.add (get_local $0) - ;;@ memset.ts:24:2 (tee_local $5 - ;;@ memset.ts:24:17 (i32.and (i32.sub (i32.const 0) - ;;@ memset.ts:24:18 (get_local $0) ) - ;;@ memset.ts:24:25 (i32.const 3) ) ) ) ) - ;;@ memset.ts:29:2 (tee_local $1 - ;;@ memset.ts:29:17 (i32.mul - ;;@ memset.ts:29:28 (get_local $1) (i32.const 16843009) ) ) ) - ;;@ memset.ts:33:2 (i32.store - ;;@ memset.ts:33:13 (i32.sub (i32.add (get_local $0) - ;;@ memset.ts:27:2 (tee_local $2 (i32.and (i32.sub - ;;@ memset.ts:26:2 (get_local $2) - ;;@ memset.ts:26:7 (get_local $5) ) (i32.const -4) ) ) ) - ;;@ memset.ts:33:24 (i32.const 4) ) - ;;@ memset.ts:33:27 (get_local $1) ) (br_if $folding-inner0 - ;;@ memset.ts:34:6 (i32.le_u (get_local $2) - ;;@ memset.ts:34:11 (i32.const 8) ) ) - ;;@ memset.ts:36:2 (i32.store - ;;@ memset.ts:36:13 (i32.add (get_local $0) - ;;@ memset.ts:36:20 (i32.const 4) ) - ;;@ memset.ts:36:23 (get_local $1) ) - ;;@ memset.ts:37:2 (i32.store - ;;@ memset.ts:37:13 (i32.add (get_local $0) - ;;@ memset.ts:37:20 (i32.const 8) ) - ;;@ memset.ts:37:23 (get_local $1) ) - ;;@ memset.ts:38:2 (i32.store - ;;@ memset.ts:38:13 (i32.sub (i32.add (get_local $0) - ;;@ memset.ts:38:20 (get_local $2) ) - ;;@ memset.ts:38:24 (i32.const 12) ) - ;;@ memset.ts:38:28 (get_local $1) ) - ;;@ memset.ts:39:2 (i32.store - ;;@ memset.ts:39:13 (i32.sub (i32.add (get_local $0) - ;;@ memset.ts:39:20 (get_local $2) ) - ;;@ memset.ts:39:24 (i32.const 8) ) - ;;@ memset.ts:39:27 (get_local $1) ) (br_if $folding-inner0 - ;;@ memset.ts:40:6 (i32.le_u (get_local $2) - ;;@ memset.ts:40:11 (i32.const 24) ) ) - ;;@ memset.ts:42:2 (i32.store - ;;@ memset.ts:42:13 (i32.add (get_local $0) - ;;@ memset.ts:42:20 (i32.const 12) ) - ;;@ memset.ts:42:24 (get_local $1) ) - ;;@ memset.ts:43:2 (i32.store - ;;@ memset.ts:43:13 (i32.add (get_local $0) - ;;@ memset.ts:43:20 (i32.const 16) ) - ;;@ memset.ts:43:24 (get_local $1) ) - ;;@ memset.ts:44:2 (i32.store - ;;@ memset.ts:44:13 (i32.add (get_local $0) - ;;@ memset.ts:44:20 (i32.const 20) ) - ;;@ memset.ts:44:24 (get_local $1) ) - ;;@ memset.ts:45:2 (i32.store - ;;@ memset.ts:45:13 (i32.add (get_local $0) - ;;@ memset.ts:45:20 (i32.const 24) ) - ;;@ memset.ts:45:24 (get_local $1) ) - ;;@ memset.ts:46:2 (i32.store - ;;@ memset.ts:46:13 (i32.sub (i32.add (get_local $0) - ;;@ memset.ts:46:20 (get_local $2) ) - ;;@ memset.ts:46:24 (i32.const 28) ) - ;;@ memset.ts:46:28 (get_local $1) ) - ;;@ memset.ts:47:2 (i32.store - ;;@ memset.ts:47:13 (i32.sub (i32.add (get_local $0) - ;;@ memset.ts:47:20 (get_local $2) ) - ;;@ memset.ts:47:24 (i32.const 24) ) - ;;@ memset.ts:47:28 (get_local $1) ) - ;;@ memset.ts:48:2 (i32.store - ;;@ memset.ts:48:13 (i32.sub (i32.add (get_local $0) - ;;@ memset.ts:48:20 (get_local $2) ) - ;;@ memset.ts:48:24 (i32.const 20) ) - ;;@ memset.ts:48:28 (get_local $1) ) - ;;@ memset.ts:49:2 (i32.store - ;;@ memset.ts:49:13 (i32.sub (i32.add (get_local $0) - ;;@ memset.ts:49:20 (get_local $2) ) - ;;@ memset.ts:49:24 (i32.const 16) ) - ;;@ memset.ts:49:28 (get_local $1) ) - ;;@ memset.ts:53:2 (set_local $0 (i32.add (get_local $0) - ;;@ memset.ts:52:2 (tee_local $5 - ;;@ memset.ts:52:6 (i32.add - ;;@ memset.ts:52:11 (i32.and - ;;@ memset.ts:52:12 (get_local $0) - ;;@ memset.ts:52:19 (i32.const 4) ) - ;;@ memset.ts:52:6 (i32.const 24) ) ) ) ) - ;;@ memset.ts:54:2 (set_local $2 (i32.sub (get_local $2) - ;;@ memset.ts:54:7 (get_local $5) ) ) - ;;@ memset.ts:57:2 (set_local $4 - ;;@ memset.ts:57:17 (i64.or (i64.extend_u/i32 (get_local $1) ) - ;;@ memset.ts:57:28 (i64.shl - ;;@ memset.ts:57:29 (i64.extend_u/i32 (get_local $1) ) - ;;@ memset.ts:57:41 (i64.const 32) ) ) ) (loop $continue|0 (if - ;;@ memset.ts:58:9 (i32.ge_u (get_local $2) - ;;@ memset.ts:58:14 (i32.const 32) ) (block - ;;@ memset.ts:59:4 (i64.store - ;;@ memset.ts:59:15 (get_local $0) - ;;@ memset.ts:59:21 (get_local $4) ) - ;;@ memset.ts:60:4 (i64.store - ;;@ memset.ts:60:15 (i32.add (get_local $0) - ;;@ memset.ts:60:22 (i32.const 8) ) - ;;@ memset.ts:60:25 (get_local $4) ) - ;;@ memset.ts:61:4 (i64.store - ;;@ memset.ts:61:15 (i32.add (get_local $0) - ;;@ memset.ts:61:22 (i32.const 16) ) - ;;@ memset.ts:61:26 (get_local $4) ) - ;;@ memset.ts:62:4 (i64.store - ;;@ memset.ts:62:15 (i32.add (get_local $0) - ;;@ memset.ts:62:22 (i32.const 24) ) - ;;@ memset.ts:62:26 (get_local $4) ) - ;;@ memset.ts:63:4 (set_local $2 (i32.sub (get_local $2) - ;;@ memset.ts:63:9 (i32.const 32) ) ) - ;;@ memset.ts:64:4 (set_local $0 (i32.add (get_local $0) - ;;@ memset.ts:64:12 (i32.const 32) ) ) @@ -492,137 +341,145 @@ ) ) (return - ;;@ memset.ts:66:9 (get_local $3) ) ) - ;;@ memset.ts:6:11 (get_local $3) ) - (func $start (; 1 ;) (type $v) + (func $start (; 2 ;) (type $v) (set_global $memset/dest - ;;@ memset.ts:69:11 (get_global $HEAP_BASE) ) - ;;@ memset.ts:70:0 (drop (call $memset/memset - ;;@ memset.ts:70:7 (get_global $memset/dest) - ;;@ memset.ts:70:13 (i32.const 1) - ;;@ memset.ts:70:16 (i32.const 16) ) ) - ;;@ memset.ts:72:0 (if - ;;@ memset.ts:72:7 (i32.ne (i32.load8_u - ;;@ memset.ts:72:16 (get_global $memset/dest) ) - ;;@ memset.ts:72:25 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 72) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memset.ts:73:0 (if - ;;@ memset.ts:73:7 (i32.ne (i32.load8_u - ;;@ memset.ts:73:16 (i32.add (get_global $memset/dest) - ;;@ memset.ts:73:23 (i32.const 15) ) ) - ;;@ memset.ts:73:30 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 73) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memset.ts:75:0 (drop (call $memset/memset - ;;@ memset.ts:75:7 (i32.add (get_global $memset/dest) - ;;@ memset.ts:75:14 (i32.const 1) ) - ;;@ memset.ts:75:17 (i32.const 2) - ;;@ memset.ts:75:20 (i32.const 14) ) ) - ;;@ memset.ts:77:0 (if - ;;@ memset.ts:77:7 (i32.ne (i32.load8_u - ;;@ memset.ts:77:16 (get_global $memset/dest) ) - ;;@ memset.ts:77:25 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 77) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memset.ts:78:0 (if - ;;@ memset.ts:78:7 (i32.ne (i32.load8_u - ;;@ memset.ts:78:16 (i32.add (get_global $memset/dest) - ;;@ memset.ts:78:23 (i32.const 1) ) ) - ;;@ memset.ts:78:29 (i32.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 78) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memset.ts:79:0 (if - ;;@ memset.ts:79:7 (i32.ne (i32.load8_u - ;;@ memset.ts:79:16 (i32.add (get_global $memset/dest) - ;;@ memset.ts:79:23 (i32.const 14) ) ) - ;;@ memset.ts:79:30 (i32.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 79) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memset.ts:80:0 (if - ;;@ memset.ts:80:7 (i32.ne (i32.load8_u - ;;@ memset.ts:80:16 (i32.add (get_global $memset/dest) - ;;@ memset.ts:80:23 (i32.const 15) ) ) - ;;@ memset.ts:80:30 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 80) + (i32.const 0) + ) + (unreachable) + ) ) ) ) diff --git a/tests/compiler/memset.wast b/tests/compiler/memset.wast index 08a82b30..5d7256be 100644 --- a/tests/compiler/memset.wast +++ b/tests/compiler/memset.wast @@ -1,12 +1,15 @@ (module (type $iiii (func (param i32 i32 i32) (result i32))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $memset/dest (mut i32) (i32.const 0)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 32)) (memory $0 1) + (data (i32.const 8) "\t\00\00\00m\00e\00m\00s\00e\00t\00.\00t\00s\00") (export "memory" (memory $0)) (start $start) - (func $memset/memset (; 0 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $memset/memset (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -556,7 +559,7 @@ (get_local $3) ) ) - (func $start (; 1 ;) (type $v) + (func $start (; 2 ;) (type $v) (set_global $memset/dest ;;@ memset.ts:69:11 (get_global $HEAP_BASE) @@ -585,7 +588,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 72) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memset.ts:73:0 (if @@ -604,7 +615,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 73) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memset.ts:75:0 (drop @@ -634,7 +653,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 77) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memset.ts:78:0 (if @@ -653,7 +680,15 @@ (i32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 78) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memset.ts:79:0 (if @@ -672,7 +707,15 @@ (i32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 79) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memset.ts:80:0 (if @@ -691,57 +734,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 80) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: memset/memset - GLOBAL: memset/dest -[program.exports] - -;) diff --git a/tests/compiler/namespace.optimized.wast b/tests/compiler/namespace.optimized.wast index bfec40ca..5ee35234 100644 --- a/tests/compiler/namespace.optimized.wast +++ b/tests/compiler/namespace.optimized.wast @@ -1,9 +1,22 @@ (module + (type $i (func (result i32))) (type $v (func)) + (global $namespace/Outer.Inner.aVar (mut i32) (i32.const 0)) (memory $0 1) (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) - (nop) + (func $namespace/Outer.Inner.aFunc (; 0 ;) (type $i) (result i32) + (get_global $namespace/Outer.Inner.aVar) + ) + (func $namespace/Joined.anotherFunc (; 1 ;) (type $i) (result i32) + (i32.const 3) + ) + (func $start (; 2 ;) (type $v) + (drop + (call $namespace/Outer.Inner.aFunc) + ) + (drop + (call $namespace/Joined.anotherFunc) + ) ) ) diff --git a/tests/compiler/namespace.wast b/tests/compiler/namespace.wast index 0f0a3363..26a35e0a 100644 --- a/tests/compiler/namespace.wast +++ b/tests/compiler/namespace.wast @@ -41,58 +41,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - NAMESPACE: namespace/Outer - NAMESPACE: namespace/Outer.Inner - GLOBAL: namespace/Outer.Inner.aVar - FUNCTION_PROTOTYPE: namespace/Outer.Inner.aFunc - ENUM: namespace/Outer.Inner.anEnum - ENUM: namespace/Joined - FUNCTION_PROTOTYPE: namespace/Joined.anotherFunc -[program.exports] - -;) diff --git a/tests/compiler/portable-conversions.optimized.wast b/tests/compiler/portable-conversions.optimized.wast index 571e630f..ac63dd2c 100644 --- a/tests/compiler/portable-conversions.optimized.wast +++ b/tests/compiler/portable-conversions.optimized.wast @@ -6,145 +6,111 @@ (export "memory" (memory $0)) (start $start) (func $start (; 0 ;) (type $v) - ;;@ portable-conversions.ts:8:0 (drop (i32.trunc_s/f32 (get_global $portable-conversions/f) ) ) - ;;@ portable-conversions.ts:9:0 (drop (i32.trunc_s/f64 (get_global $portable-conversions/F) ) ) - ;;@ portable-conversions.ts:13:0 (drop (i32.trunc_s/f32 (get_global $portable-conversions/f) ) ) - ;;@ portable-conversions.ts:14:0 (drop (i32.trunc_s/f64 (get_global $portable-conversions/F) ) ) - ;;@ portable-conversions.ts:18:0 (drop - ;;@ portable-conversions.ts:18:4 (i32.trunc_s/f32 (get_global $portable-conversions/f) ) ) - ;;@ portable-conversions.ts:19:0 (drop - ;;@ portable-conversions.ts:19:4 (i32.trunc_s/f64 (get_global $portable-conversions/F) ) ) - ;;@ portable-conversions.ts:23:0 (drop - ;;@ portable-conversions.ts:23:4 (i64.trunc_s/f32 (get_global $portable-conversions/f) ) ) - ;;@ portable-conversions.ts:24:0 (drop - ;;@ portable-conversions.ts:24:4 (i64.trunc_s/f64 (get_global $portable-conversions/F) ) ) - ;;@ portable-conversions.ts:28:0 (drop - ;;@ portable-conversions.ts:28:6 (i32.trunc_s/f32 (get_global $portable-conversions/f) ) ) - ;;@ portable-conversions.ts:29:0 (drop - ;;@ portable-conversions.ts:29:6 (i32.trunc_s/f64 (get_global $portable-conversions/F) ) ) - ;;@ portable-conversions.ts:33:0 (drop (i32.trunc_u/f32 (get_global $portable-conversions/f) ) ) - ;;@ portable-conversions.ts:34:0 (drop (i32.trunc_u/f64 (get_global $portable-conversions/F) ) ) - ;;@ portable-conversions.ts:38:0 (drop (i32.trunc_u/f32 (get_global $portable-conversions/f) ) ) - ;;@ portable-conversions.ts:39:0 (drop (i32.trunc_u/f64 (get_global $portable-conversions/F) ) ) - ;;@ portable-conversions.ts:43:0 (drop - ;;@ portable-conversions.ts:43:4 (i32.trunc_u/f32 (get_global $portable-conversions/f) ) ) - ;;@ portable-conversions.ts:44:0 (drop - ;;@ portable-conversions.ts:44:4 (i32.trunc_u/f64 (get_global $portable-conversions/F) ) ) - ;;@ portable-conversions.ts:48:0 (drop - ;;@ portable-conversions.ts:48:4 (i64.trunc_u/f32 (get_global $portable-conversions/f) ) ) - ;;@ portable-conversions.ts:49:0 (drop - ;;@ portable-conversions.ts:49:4 (i64.trunc_u/f64 (get_global $portable-conversions/F) ) ) - ;;@ portable-conversions.ts:53:0 (drop - ;;@ portable-conversions.ts:53:6 (i32.trunc_u/f32 (get_global $portable-conversions/f) ) ) - ;;@ portable-conversions.ts:54:0 (drop - ;;@ portable-conversions.ts:54:6 (i32.trunc_u/f64 (get_global $portable-conversions/F) ) ) - ;;@ portable-conversions.ts:58:0 (drop (i32.trunc_u/f32 (get_global $portable-conversions/f) ) ) - ;;@ portable-conversions.ts:59:0 (drop (i32.trunc_u/f64 (get_global $portable-conversions/F) diff --git a/tests/compiler/portable-conversions.wast b/tests/compiler/portable-conversions.wast index 5599c6f2..064675c3 100644 --- a/tests/compiler/portable-conversions.wast +++ b/tests/compiler/portable-conversions.wast @@ -433,55 +433,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: portable-conversions/i - GLOBAL: portable-conversions/I - GLOBAL: portable-conversions/f - GLOBAL: portable-conversions/F -[program.exports] - -;) diff --git a/tests/compiler/recursive.optimized.wast b/tests/compiler/recursive.optimized.wast index 00bb2927..9606cf22 100644 --- a/tests/compiler/recursive.optimized.wast +++ b/tests/compiler/recursive.optimized.wast @@ -4,35 +4,25 @@ (export "fib" (func $recursive/fib)) (export "memory" (memory $0)) (func $recursive/fib (; 0 ;) (type $ii) (param $0 i32) (result i32) - ;;@ recursive.ts:2:2 (if - ;;@ recursive.ts:2:6 (i32.le_s (get_local $0) - ;;@ recursive.ts:2:11 (i32.const 1) ) - ;;@ recursive.ts:2:21 (return (i32.const 1) ) ) - ;;@ recursive.ts:3:9 (i32.add (call $recursive/fib - ;;@ recursive.ts:3:13 (i32.sub (get_local $0) - ;;@ recursive.ts:3:17 (i32.const 1) ) ) - ;;@ recursive.ts:3:22 (call $recursive/fib - ;;@ recursive.ts:3:26 (i32.sub (get_local $0) - ;;@ recursive.ts:3:30 (i32.const 2) ) ) diff --git a/tests/compiler/recursive.wast b/tests/compiler/recursive.wast index 5ed36f69..f2fede86 100644 --- a/tests/compiler/recursive.wast +++ b/tests/compiler/recursive.wast @@ -43,52 +43,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: recursive/fib -[program.exports] - FUNCTION_PROTOTYPE: recursive/fib -;) diff --git a/tests/compiler/reexport.optimized.wast b/tests/compiler/reexport.optimized.wast index 51c02993..5ef0b907 100644 --- a/tests/compiler/reexport.optimized.wast +++ b/tests/compiler/reexport.optimized.wast @@ -18,44 +18,32 @@ (export "memory" (memory $0)) (start $start) (func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - ;;@ export.ts:2:9 (i32.add (get_local $0) - ;;@ export.ts:2:13 (get_local $1) ) ) (func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - ;;@ export.ts:6:9 (i32.sub (get_local $0) - ;;@ export.ts:6:13 (get_local $1) ) ) (func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - ;;@ export.ts:12:9 (i32.mul (get_local $0) - ;;@ export.ts:12:13 (get_local $1) ) ) (func $start (; 3 ;) (type $v) - ;;@ reexport.ts:24:0 (drop (i32.add (call $export/add - ;;@ reexport.ts:24:13 (i32.const 1) - ;;@ reexport.ts:24:16 (i32.const 2) ) - ;;@ reexport.ts:24:21 (call $export/mul - ;;@ reexport.ts:24:34 (i32.const 3) - ;;@ reexport.ts:24:37 (i32.const 4) ) ) diff --git a/tests/compiler/reexport.wast b/tests/compiler/reexport.wast index eb341028..b73ebddf 100644 --- a/tests/compiler/reexport.wast +++ b/tests/compiler/reexport.wast @@ -74,80 +74,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: export/add - FUNCTION_PROTOTYPE: export/sub - FUNCTION_PROTOTYPE: export/mul - GLOBAL: export/a - GLOBAL: export/b - GLOBAL: export/c - NAMESPACE: export/ns - FUNCTION_PROTOTYPE: export/ns.one - FUNCTION_PROTOTYPE: export/ns.two - FUNCTION_PROTOTYPE: reexport/imported_add - FUNCTION_PROTOTYPE: reexport/imported_sub - NAMESPACE: reexport/imported_ns -[program.exports] - FUNCTION_PROTOTYPE: export/add - FUNCTION_PROTOTYPE: export/sub - FUNCTION_PROTOTYPE: export/renamed_mul - GLOBAL: export/a - GLOBAL: export/b - GLOBAL: export/renamed_c - NAMESPACE: export/ns - FUNCTION_PROTOTYPE: reexport/add - FUNCTION_PROTOTYPE: reexport/renamed_sub - FUNCTION_PROTOTYPE: reexport/renamed_mul - FUNCTION_PROTOTYPE: reexport/rerenamed_mul - GLOBAL: reexport/a - GLOBAL: reexport/renamed_b - GLOBAL: reexport/renamed_c - GLOBAL: reexport/rerenamed_c - FUNCTION_PROTOTYPE: reexport/renamed_add - FUNCTION_PROTOTYPE: reexport/rerenamed_sub - NAMESPACE: reexport/renamed_ns -;) diff --git a/tests/compiler/retain-i32.optimized.wast b/tests/compiler/retain-i32.optimized.wast index 9ca1af42..cce44dd4 100644 --- a/tests/compiler/retain-i32.optimized.wast +++ b/tests/compiler/retain-i32.optimized.wast @@ -1,28 +1,26 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $iiv (func (param i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $retain-i32/si (mut i32) (i32.const 0)) (global $retain-i32/ui (mut i32) (i32.const 0)) (memory $0 1) + (data (i32.const 8) "\0d\00\00\00r\00e\00t\00a\00i\00n\00-\00i\003\002\00.\00t\00s") (export "memory" (memory $0)) (start $start) - (func $retain-i32/test (; 0 ;) (type $iiv) (param $0 i32) (param $1 i32) - ;;@ retain-i32.ts:4:2 + (func $retain-i32/test (; 1 ;) (type $iiv) (param $0 i32) (param $1 i32) (if - ;;@ retain-i32.ts:4:9 (i32.ne (i32.and - ;;@ retain-i32.ts:4:14 (i32.add (get_local $0) - ;;@ retain-i32.ts:4:18 (get_local $1) ) (i32.const 255) ) (i32.and (i32.add - ;;@ retain-i32.ts:4:29 (i32.shr_s (i32.shl (get_local $0) @@ -30,7 +28,6 @@ ) (i32.const 24) ) - ;;@ retain-i32.ts:4:37 (i32.shr_s (i32.shl (get_local $1) @@ -42,24 +39,27 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 4) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:5:2 (if - ;;@ retain-i32.ts:5:9 (i32.ne (i32.and - ;;@ retain-i32.ts:5:14 (i32.sub (get_local $0) - ;;@ retain-i32.ts:5:18 (get_local $1) ) (i32.const 255) ) (i32.and (i32.sub - ;;@ retain-i32.ts:5:29 (i32.shr_s (i32.shl (get_local $0) @@ -67,7 +67,6 @@ ) (i32.const 24) ) - ;;@ retain-i32.ts:5:37 (i32.shr_s (i32.shl (get_local $1) @@ -79,24 +78,27 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 5) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:6:2 (if - ;;@ retain-i32.ts:6:9 (i32.ne (i32.and - ;;@ retain-i32.ts:6:14 (i32.mul (get_local $0) - ;;@ retain-i32.ts:6:18 (get_local $1) ) (i32.const 255) ) (i32.and (i32.mul - ;;@ retain-i32.ts:6:29 (i32.shr_s (i32.shl (get_local $0) @@ -104,7 +106,6 @@ ) (i32.const 24) ) - ;;@ retain-i32.ts:6:37 (i32.shr_s (i32.shl (get_local $1) @@ -116,24 +117,27 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 6) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:7:2 (if - ;;@ retain-i32.ts:7:9 (i32.ne (i32.and - ;;@ retain-i32.ts:7:14 (i32.and (get_local $0) - ;;@ retain-i32.ts:7:18 (get_local $1) ) (i32.const 255) ) (i32.and (i32.and - ;;@ retain-i32.ts:7:29 (i32.shr_s (i32.shl (get_local $0) @@ -141,7 +145,6 @@ ) (i32.const 24) ) - ;;@ retain-i32.ts:7:37 (i32.shr_s (i32.shl (get_local $1) @@ -153,24 +156,27 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 7) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:8:2 (if - ;;@ retain-i32.ts:8:9 (i32.ne (i32.and - ;;@ retain-i32.ts:8:14 (i32.or (get_local $0) - ;;@ retain-i32.ts:8:18 (get_local $1) ) (i32.const 255) ) (i32.and (i32.or - ;;@ retain-i32.ts:8:29 (i32.shr_s (i32.shl (get_local $0) @@ -178,7 +184,6 @@ ) (i32.const 24) ) - ;;@ retain-i32.ts:8:37 (i32.shr_s (i32.shl (get_local $1) @@ -190,24 +195,27 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 8) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:9:2 (if - ;;@ retain-i32.ts:9:9 (i32.ne (i32.and - ;;@ retain-i32.ts:9:14 (i32.xor (get_local $0) - ;;@ retain-i32.ts:9:18 (get_local $1) ) (i32.const 255) ) (i32.and (i32.xor - ;;@ retain-i32.ts:9:29 (i32.shr_s (i32.shl (get_local $0) @@ -215,7 +223,6 @@ ) (i32.const 24) ) - ;;@ retain-i32.ts:9:37 (i32.shr_s (i32.shl (get_local $1) @@ -227,24 +234,27 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 9) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:10:2 (if - ;;@ retain-i32.ts:10:9 (i32.ne (i32.and - ;;@ retain-i32.ts:10:14 (i32.shl (get_local $0) - ;;@ retain-i32.ts:10:19 (get_local $1) ) (i32.const 255) ) (i32.and (i32.shl - ;;@ retain-i32.ts:10:30 (i32.shr_s (i32.shl (get_local $0) @@ -252,7 +262,6 @@ ) (i32.const 24) ) - ;;@ retain-i32.ts:10:39 (i32.shr_s (i32.shl (get_local $1) @@ -264,30 +273,31 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 10) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:13:2 (if - ;;@ retain-i32.ts:13:9 (i32.ne (i32.and - ;;@ retain-i32.ts:13:14 (i32.add (get_local $0) - ;;@ retain-i32.ts:13:18 (get_local $1) ) (i32.const 255) ) - ;;@ retain-i32.ts:13:24 (i32.and (i32.add - ;;@ retain-i32.ts:13:29 (i32.and (get_local $0) (i32.const 255) ) - ;;@ retain-i32.ts:13:37 (i32.and (get_local $1) (i32.const 255) @@ -296,30 +306,31 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 13) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:14:2 (if - ;;@ retain-i32.ts:14:9 (i32.ne (i32.and - ;;@ retain-i32.ts:14:14 (i32.sub (get_local $0) - ;;@ retain-i32.ts:14:18 (get_local $1) ) (i32.const 255) ) - ;;@ retain-i32.ts:14:24 (i32.and (i32.sub - ;;@ retain-i32.ts:14:29 (i32.and (get_local $0) (i32.const 255) ) - ;;@ retain-i32.ts:14:37 (i32.and (get_local $1) (i32.const 255) @@ -328,30 +339,31 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 14) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:15:2 (if - ;;@ retain-i32.ts:15:9 (i32.ne (i32.and - ;;@ retain-i32.ts:15:14 (i32.mul (get_local $0) - ;;@ retain-i32.ts:15:18 (get_local $1) ) (i32.const 255) ) - ;;@ retain-i32.ts:15:24 (i32.and (i32.mul - ;;@ retain-i32.ts:15:29 (i32.and (get_local $0) (i32.const 255) ) - ;;@ retain-i32.ts:15:37 (i32.and (get_local $1) (i32.const 255) @@ -360,114 +372,121 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 15) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:16:2 (if - ;;@ retain-i32.ts:16:9 (i32.ne (i32.and - ;;@ retain-i32.ts:16:14 (i32.and (get_local $0) - ;;@ retain-i32.ts:16:18 (get_local $1) ) (i32.const 255) ) (i32.and - ;;@ retain-i32.ts:16:29 (i32.and (get_local $0) (i32.const 255) ) - ;;@ retain-i32.ts:16:37 (i32.and (get_local $1) (i32.const 255) ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 16) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:17:2 (if - ;;@ retain-i32.ts:17:9 (i32.ne (i32.and - ;;@ retain-i32.ts:17:14 (i32.or (get_local $0) - ;;@ retain-i32.ts:17:18 (get_local $1) ) (i32.const 255) ) (i32.or - ;;@ retain-i32.ts:17:29 (i32.and (get_local $0) (i32.const 255) ) - ;;@ retain-i32.ts:17:37 (i32.and (get_local $1) (i32.const 255) ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 17) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:18:2 (if - ;;@ retain-i32.ts:18:9 (i32.ne (i32.and - ;;@ retain-i32.ts:18:14 (i32.xor (get_local $0) - ;;@ retain-i32.ts:18:18 (get_local $1) ) (i32.const 255) ) (i32.xor - ;;@ retain-i32.ts:18:29 (i32.and (get_local $0) (i32.const 255) ) - ;;@ retain-i32.ts:18:37 (i32.and (get_local $1) (i32.const 255) ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 18) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:19:2 (if - ;;@ retain-i32.ts:19:9 (i32.ne (i32.and - ;;@ retain-i32.ts:19:14 (i32.shl (get_local $0) - ;;@ retain-i32.ts:19:19 (get_local $1) ) (i32.const 255) ) - ;;@ retain-i32.ts:19:25 (i32.and (i32.shl - ;;@ retain-i32.ts:19:30 (i32.and (get_local $0) (i32.const 255) ) - ;;@ retain-i32.ts:19:39 (i32.and (get_local $1) (i32.const 255) @@ -476,267 +495,171 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 19) + (i32.const 2) + ) + (unreachable) + ) ) ) - (func $start (; 1 ;) (type $v) + (func $start (; 2 ;) (type $v) (local $0 i32) - ;;@ retain-i32.ts:23:0 (call $retain-i32/test - ;;@ retain-i32.ts:23:5 (i32.const 0) - ;;@ retain-i32.ts:23:8 (i32.const 127) ) - ;;@ retain-i32.ts:24:0 (call $retain-i32/test - ;;@ retain-i32.ts:24:5 (i32.const 127) - ;;@ retain-i32.ts:24:19 (i32.const 0) ) - ;;@ retain-i32.ts:26:0 (call $retain-i32/test - ;;@ retain-i32.ts:26:5 (i32.const 1) - ;;@ retain-i32.ts:26:8 (i32.const 127) ) - ;;@ retain-i32.ts:27:0 (call $retain-i32/test - ;;@ retain-i32.ts:27:5 (i32.const 127) - ;;@ retain-i32.ts:27:19 (i32.const 1) ) - ;;@ retain-i32.ts:29:0 (call $retain-i32/test (i32.const -1) - ;;@ retain-i32.ts:29:9 (i32.const 127) ) - ;;@ retain-i32.ts:30:0 (call $retain-i32/test - ;;@ retain-i32.ts:30:5 (i32.const 127) (i32.const -1) ) - ;;@ retain-i32.ts:32:0 (call $retain-i32/test - ;;@ retain-i32.ts:32:5 (i32.const 0) - ;;@ retain-i32.ts:32:8 (i32.const -128) ) - ;;@ retain-i32.ts:33:0 (call $retain-i32/test - ;;@ retain-i32.ts:33:5 (i32.const -128) - ;;@ retain-i32.ts:33:19 (i32.const 0) ) - ;;@ retain-i32.ts:35:0 (call $retain-i32/test - ;;@ retain-i32.ts:35:5 (i32.const 1) - ;;@ retain-i32.ts:35:8 (i32.const -128) ) - ;;@ retain-i32.ts:36:0 (call $retain-i32/test - ;;@ retain-i32.ts:36:5 (i32.const -128) - ;;@ retain-i32.ts:36:19 (i32.const 1) ) - ;;@ retain-i32.ts:38:0 (call $retain-i32/test (i32.const -1) - ;;@ retain-i32.ts:38:9 (i32.const -128) ) - ;;@ retain-i32.ts:39:0 (call $retain-i32/test - ;;@ retain-i32.ts:39:5 (i32.const -128) (i32.const -1) ) - ;;@ retain-i32.ts:41:0 (call $retain-i32/test - ;;@ retain-i32.ts:41:5 (i32.const 127) - ;;@ retain-i32.ts:41:19 (i32.const 127) ) - ;;@ retain-i32.ts:42:0 (call $retain-i32/test - ;;@ retain-i32.ts:42:5 (i32.const -128) - ;;@ retain-i32.ts:42:19 (i32.const -128) ) - ;;@ retain-i32.ts:43:0 (call $retain-i32/test - ;;@ retain-i32.ts:43:5 (i32.const 127) - ;;@ retain-i32.ts:43:19 (i32.const -128) ) - ;;@ retain-i32.ts:44:0 (call $retain-i32/test - ;;@ retain-i32.ts:44:5 (i32.const -128) - ;;@ retain-i32.ts:44:19 (i32.const 127) ) - ;;@ retain-i32.ts:47:0 (call $retain-i32/test - ;;@ retain-i32.ts:47:5 (i32.const 0) - ;;@ retain-i32.ts:47:8 (i32.const 255) ) - ;;@ retain-i32.ts:48:0 (call $retain-i32/test - ;;@ retain-i32.ts:48:5 (i32.const 255) - ;;@ retain-i32.ts:48:19 (i32.const 0) ) - ;;@ retain-i32.ts:50:0 (call $retain-i32/test - ;;@ retain-i32.ts:50:5 (i32.const 1) - ;;@ retain-i32.ts:50:8 (i32.const 255) ) - ;;@ retain-i32.ts:51:0 (call $retain-i32/test - ;;@ retain-i32.ts:51:5 (i32.const 255) - ;;@ retain-i32.ts:51:19 (i32.const 1) ) - ;;@ retain-i32.ts:53:0 (call $retain-i32/test (i32.const -1) - ;;@ retain-i32.ts:53:9 (i32.const 255) ) - ;;@ retain-i32.ts:54:0 (call $retain-i32/test - ;;@ retain-i32.ts:54:5 (i32.const 255) (i32.const -1) ) - ;;@ retain-i32.ts:56:0 (call $retain-i32/test - ;;@ retain-i32.ts:56:5 (i32.const 255) - ;;@ retain-i32.ts:56:19 (i32.const 255) ) - ;;@ retain-i32.ts:59:5 (set_local $0 - ;;@ retain-i32.ts:59:18 (i32.const -128) ) (loop $continue|0 (if - ;;@ retain-i32.ts:59:32 (i32.le_s (get_local $0) - ;;@ retain-i32.ts:59:37 (i32.const 255) ) (block - ;;@ retain-i32.ts:60:2 (call $retain-i32/test - ;;@ retain-i32.ts:60:7 (i32.const 0) - ;;@ retain-i32.ts:60:10 (get_local $0) ) - ;;@ retain-i32.ts:61:2 (call $retain-i32/test - ;;@ retain-i32.ts:61:7 (i32.const 1) - ;;@ retain-i32.ts:61:10 (get_local $0) ) - ;;@ retain-i32.ts:62:2 (call $retain-i32/test (i32.const -1) - ;;@ retain-i32.ts:62:11 (get_local $0) ) - ;;@ retain-i32.ts:63:2 (call $retain-i32/test - ;;@ retain-i32.ts:63:7 (i32.const -128) - ;;@ retain-i32.ts:63:21 (get_local $0) ) - ;;@ retain-i32.ts:64:2 (call $retain-i32/test - ;;@ retain-i32.ts:64:7 (i32.const 127) - ;;@ retain-i32.ts:64:21 (get_local $0) ) - ;;@ retain-i32.ts:65:2 (call $retain-i32/test - ;;@ retain-i32.ts:65:7 (i32.const 255) - ;;@ retain-i32.ts:65:21 (get_local $0) ) - ;;@ retain-i32.ts:66:2 (call $retain-i32/test - ;;@ retain-i32.ts:66:7 (i32.const -32768) - ;;@ retain-i32.ts:66:22 (get_local $0) ) - ;;@ retain-i32.ts:67:2 (call $retain-i32/test - ;;@ retain-i32.ts:67:7 (i32.const 32767) - ;;@ retain-i32.ts:67:22 (get_local $0) ) - ;;@ retain-i32.ts:68:2 (call $retain-i32/test - ;;@ retain-i32.ts:68:7 (i32.const 65535) - ;;@ retain-i32.ts:68:22 (get_local $0) ) - ;;@ retain-i32.ts:69:2 (call $retain-i32/test - ;;@ retain-i32.ts:69:7 (i32.const 2147483647) - ;;@ retain-i32.ts:69:22 (get_local $0) ) - ;;@ retain-i32.ts:70:2 (call $retain-i32/test - ;;@ retain-i32.ts:70:7 (i32.const -2147483648) - ;;@ retain-i32.ts:70:22 (get_local $0) ) - ;;@ retain-i32.ts:71:2 (call $retain-i32/test - ;;@ retain-i32.ts:71:7 (i32.const -1) - ;;@ retain-i32.ts:71:22 (get_local $0) ) - ;;@ retain-i32.ts:59:51 (set_local $0 (i32.add - ;;@ retain-i32.ts:59:53 (get_local $0) (i32.const 1) ) @@ -745,242 +668,323 @@ ) ) ) - ;;@ retain-i32.ts:77:0 (set_global $retain-i32/si (i32.const -1) ) - ;;@ retain-i32.ts:78:0 (if - ;;@ retain-i32.ts:78:7 (i32.ne (get_global $retain-i32/si) (i32.const -1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 78) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:80:0 (set_global $retain-i32/si (i32.const -1) ) - ;;@ retain-i32.ts:81:0 (if - ;;@ retain-i32.ts:81:7 (i32.ne (get_global $retain-i32/si) (i32.const -1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 81) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:83:0 (set_global $retain-i32/si (i32.const -2) ) - ;;@ retain-i32.ts:84:0 (if - ;;@ retain-i32.ts:84:7 (i32.ne (get_global $retain-i32/si) (i32.const -2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 84) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:86:0 (set_global $retain-i32/si (i32.const -128) ) - ;;@ retain-i32.ts:87:0 (if - ;;@ retain-i32.ts:87:7 (i32.ne (get_global $retain-i32/si) (i32.const -128) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 87) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:89:0 (set_global $retain-i32/si (i32.const -128) ) - ;;@ retain-i32.ts:90:0 (if - ;;@ retain-i32.ts:90:7 (i32.ne (get_global $retain-i32/si) (i32.const -128) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 90) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:92:0 (set_global $retain-i32/si (i32.const -127) ) - ;;@ retain-i32.ts:93:0 (if - ;;@ retain-i32.ts:93:7 (i32.ne (get_global $retain-i32/si) (i32.const -127) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 93) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:95:0 (set_global $retain-i32/si (i32.const -128) ) - ;;@ retain-i32.ts:96:0 (if - ;;@ retain-i32.ts:96:7 (i32.ne (get_global $retain-i32/si) (i32.const -128) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 96) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:98:0 (set_global $retain-i32/si (i32.const 1) ) - ;;@ retain-i32.ts:99:0 (if - ;;@ retain-i32.ts:99:7 (i32.ne (get_global $retain-i32/si) - ;;@ retain-i32.ts:99:13 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 99) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:101:0 (set_global $retain-i32/si (i32.const 1) ) - ;;@ retain-i32.ts:102:0 (if - ;;@ retain-i32.ts:102:7 (i32.ne (get_global $retain-i32/si) - ;;@ retain-i32.ts:102:13 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 102) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:104:0 (set_global $retain-i32/si (i32.const 0) ) - ;;@ retain-i32.ts:105:0 (if - ;;@ retain-i32.ts:105:7 (get_global $retain-i32/si) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 105) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:107:0 (set_global $retain-i32/si (i32.const 1) ) - ;;@ retain-i32.ts:108:0 (if - ;;@ retain-i32.ts:108:7 (i32.ne (get_global $retain-i32/si) - ;;@ retain-i32.ts:108:13 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 108) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:112:0 (set_global $retain-i32/ui (i32.const 255) ) - ;;@ retain-i32.ts:113:0 (if - ;;@ retain-i32.ts:113:7 (i32.ne (get_global $retain-i32/ui) - ;;@ retain-i32.ts:113:13 (i32.const 255) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 113) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:115:0 (set_global $retain-i32/ui (i32.const 255) ) - ;;@ retain-i32.ts:116:0 (if - ;;@ retain-i32.ts:116:7 (i32.ne (get_global $retain-i32/ui) - ;;@ retain-i32.ts:116:13 (i32.const 255) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 116) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:118:0 (set_global $retain-i32/ui (i32.const 254) ) - ;;@ retain-i32.ts:119:0 (if - ;;@ retain-i32.ts:119:7 (i32.ne (get_global $retain-i32/ui) - ;;@ retain-i32.ts:119:13 (i32.const 254) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 119) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:121:0 (set_global $retain-i32/ui (i32.const 1) ) - ;;@ retain-i32.ts:122:0 (if - ;;@ retain-i32.ts:122:7 (i32.ne (get_global $retain-i32/ui) - ;;@ retain-i32.ts:122:13 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 122) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:124:0 (set_global $retain-i32/ui (i32.const 1) ) - ;;@ retain-i32.ts:125:0 (if - ;;@ retain-i32.ts:125:7 (i32.ne (get_global $retain-i32/ui) - ;;@ retain-i32.ts:125:13 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 125) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:127:0 (set_global $retain-i32/ui (i32.const 1) ) - ;;@ retain-i32.ts:128:0 (if - ;;@ retain-i32.ts:128:7 (i32.ne (get_global $retain-i32/ui) - ;;@ retain-i32.ts:128:13 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 128) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ retain-i32.ts:130:0 (set_global $retain-i32/ui (i32.const 0) ) - ;;@ retain-i32.ts:131:0 (if - ;;@ retain-i32.ts:131:7 (get_global $retain-i32/ui) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 131) + (i32.const 0) + ) + (unreachable) + ) ) ) ) diff --git a/tests/compiler/retain-i32.wast b/tests/compiler/retain-i32.wast index 8c324ad8..47f64a1e 100644 --- a/tests/compiler/retain-i32.wast +++ b/tests/compiler/retain-i32.wast @@ -1,6 +1,8 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $iiv (func (param i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $i8.MAX_VALUE i32 (i32.const 127)) (global $i8.MIN_VALUE i32 (i32.const -128)) (global $u8.MAX_VALUE i32 (i32.const 255)) @@ -12,11 +14,12 @@ (global $u32.MAX_VALUE i32 (i32.const -1)) (global $retain-i32/si (mut i32) (i32.const 0)) (global $retain-i32/ui (mut i32) (i32.const 0)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 40)) (memory $0 1) + (data (i32.const 8) "\0d\00\00\00r\00e\00t\00a\00i\00n\00-\00i\003\002\00.\00t\00s\00") (export "memory" (memory $0)) (start $start) - (func $retain-i32/test (; 0 ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $retain-i32/test (; 1 ;) (type $iiv) (param $0 i32) (param $1 i32) ;;@ retain-i32.ts:4:2 (if (i32.eqz @@ -61,7 +64,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 4) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:5:2 (if @@ -107,7 +118,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 5) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:6:2 (if @@ -153,7 +172,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 6) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:7:2 (if @@ -199,7 +226,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 7) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:8:2 (if @@ -245,7 +280,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 8) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:9:2 (if @@ -291,7 +334,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 9) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:10:2 (if @@ -337,7 +388,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 10) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:13:2 (if @@ -371,7 +430,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 13) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:14:2 (if @@ -405,7 +472,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 14) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:15:2 (if @@ -439,7 +514,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 15) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:16:2 (if @@ -473,7 +556,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 16) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:17:2 (if @@ -507,7 +598,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 17) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:18:2 (if @@ -541,7 +640,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 18) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:19:2 (if @@ -575,10 +682,18 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 19) + (i32.const 2) + ) + (unreachable) + ) ) ) - (func $start (; 1 ;) (type $v) + (func $start (; 2 ;) (type $v) (local $0 i32) ;;@ retain-i32.ts:23:0 (call $retain-i32/test @@ -923,7 +1038,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 78) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:80:0 (set_global $retain-i32/si @@ -964,7 +1087,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 81) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:83:0 (set_global $retain-i32/si @@ -1001,7 +1132,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 84) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:86:0 (set_global $retain-i32/si @@ -1048,7 +1187,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 87) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:89:0 (set_global $retain-i32/si @@ -1093,7 +1240,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 90) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:92:0 (set_global $retain-i32/si @@ -1140,7 +1295,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 93) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:95:0 (set_global $retain-i32/si @@ -1197,7 +1360,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 96) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:98:0 (set_global $retain-i32/si @@ -1218,7 +1389,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 99) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:101:0 (set_global $retain-i32/si @@ -1239,7 +1418,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 102) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:104:0 (set_global $retain-i32/si @@ -1270,7 +1457,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 105) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:107:0 (set_global $retain-i32/si @@ -1301,7 +1496,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 108) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:112:0 (set_global $retain-i32/ui @@ -1329,7 +1532,15 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 113) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:115:0 (set_global $retain-i32/ui @@ -1357,7 +1568,15 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 116) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:118:0 (set_global $retain-i32/ui @@ -1381,7 +1600,15 @@ (i32.const 254) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 119) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:121:0 (set_global $retain-i32/ui @@ -1405,7 +1632,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 122) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:124:0 (set_global $retain-i32/ui @@ -1429,7 +1664,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 125) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:127:0 (set_global $retain-i32/ui @@ -1450,7 +1693,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 128) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ retain-i32.ts:130:0 (set_global $retain-i32/ui @@ -1471,58 +1722,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 131) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: retain-i32/test - GLOBAL: retain-i32/si - GLOBAL: retain-i32/ui -[program.exports] - -;) diff --git a/tests/compiler/scoped.optimized.wast b/tests/compiler/scoped.optimized.wast index e13313bb..62796499 100644 --- a/tests/compiler/scoped.optimized.wast +++ b/tests/compiler/scoped.optimized.wast @@ -7,17 +7,13 @@ (local $0 i32) (loop $continue|0 (if - ;;@ scoped.ts:5:45 (i32.lt_s (get_local $0) - ;;@ scoped.ts:5:73 (i32.const 1) ) (block - ;;@ scoped.ts:5:76 (set_local $0 (i32.add - ;;@ scoped.ts:5:78 (get_local $0) (i32.const 1) ) @@ -26,24 +22,18 @@ ) ) ) - ;;@ scoped.ts:6:5 (set_local $0 - ;;@ scoped.ts:6:43 (i32.const 0) ) (loop $continue|1 (if - ;;@ scoped.ts:6:46 (i32.lt_s (get_local $0) - ;;@ scoped.ts:6:56 (i32.const 1) ) (block - ;;@ scoped.ts:6:59 (set_local $0 (i32.add - ;;@ scoped.ts:6:61 (get_local $0) (i32.const 1) ) diff --git a/tests/compiler/scoped.wast b/tests/compiler/scoped.wast index f29194e4..267e05cc 100644 --- a/tests/compiler/scoped.wast +++ b/tests/compiler/scoped.wast @@ -94,54 +94,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: scoped/aGlobal - GLOBAL: scoped/aConstant - GLOBAL: scoped/aStartFunctionLocal -[program.exports] - -;) diff --git a/tests/compiler/showcase.optimized.wast b/tests/compiler/showcase.optimized.wast index 7b4a83fd..607156c1 100644 --- a/tests/compiler/showcase.optimized.wast +++ b/tests/compiler/showcase.optimized.wast @@ -1,8 +1,14 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) + (type $ii (func (param i32) (result i32))) + (type $iii (func (param i32 i32) (result i32))) (type $fff (func (param f32 f32) (result f32))) (type $FFF (func (param f64 f64) (result f64))) (type $v (func)) (type $iiii (func (param i32 i32 i32) (result i32))) + (type $ifv (func (param i32 f32))) + (type $if (func (param i32) (result f32))) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $showcase/aConstantGlobal i32 (i32.const 42)) (global $showcase/anExportedConstantGlobal f32 (f32.const 42)) (global $showcase/aMutableGlobal (mut i32) (i32.const 42)) @@ -38,6 +44,11 @@ (global $showcase/aClassInstance (mut i32) (i32.const 8)) (global $showcase/AClass.aStaticField (mut i32) (i32.const 0)) (memory $0 1) + (data (i32.const 8) "\n\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s") + (data (i32.const 32) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s") + (data (i32.const 64) "\0b\00\00\00s\00h\00o\00w\00c\00a\00s\00e\00.\00t\00s") + (data (i32.const 96) "\t\00\00\00m\00e\00m\00c\00p\00y\00.\00t\00s") + (data (i32.const 120) "\07\00\00\00f\00m\00o\00d\00.\00t\00s") (export "anExportedConstantGlobal" (global $showcase/anExportedConstantGlobal)) (export "aConstantGlobal" (global $showcase/aConstantGlobal)) (export "anAliasedConstantGlobal" (global $showcase/anExportedConstantGlobal)) @@ -48,27 +59,43 @@ (export "anExportedFunction" (func $showcase/anExportedFunction)) (export "memory" (memory $0)) (start $start) - (func $showcase/anExportedFunction (; 0 ;) (type $v) + (func $showcase/ANamespace.aNamespacedFunction (; 1 ;) (type $ii) (param $0 i32) (result i32) + (get_local $0) + ) + (func $showcase/addGeneric (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (i32.add + (get_local $0) + (get_local $1) + ) + ) + (func $showcase/addGeneric (; 3 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) + (f32.add + (get_local $0) + (get_local $1) + ) + ) + (func $showcase/addGeneric (; 4 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) + (f64.add + (get_local $0) + (get_local $1) + ) + ) + (func $showcase/anExportedFunction (; 5 ;) (type $v) (nop) ) - (func $memcpy/memcpy (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $memcpy/memcpy (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - ;;@ memcpy.ts:2:2 (set_local $5 - ;;@ memcpy.ts:2:12 (get_local $0) ) (loop $continue|0 (if - ;;@ memcpy.ts:6:9 (if (result i32) (get_local $2) - ;;@ memcpy.ts:6:14 (i32.rem_u (get_local $1) - ;;@ memcpy.ts:6:20 (i32.const 4) ) (get_local $2) @@ -77,16 +104,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:7:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:7:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:7:31 (block (result i32) (set_local $1 (i32.add @@ -96,13 +120,11 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:7:22 (i32.load8_u (get_local $3) ) ) ) - ;;@ memcpy.ts:8:4 (set_local $2 (i32.sub (get_local $2) @@ -113,112 +135,78 @@ ) ) ) - ;;@ memcpy.ts:12:2 (if (i32.eqz - ;;@ memcpy.ts:12:6 (i32.rem_u (get_local $0) - ;;@ memcpy.ts:12:13 (i32.const 4) ) ) - ;;@ memcpy.ts:12:21 (block (loop $continue|1 (if - ;;@ memcpy.ts:13:11 (i32.ge_u (get_local $2) - ;;@ memcpy.ts:13:16 (i32.const 16) ) (block - ;;@ memcpy.ts:14:6 (i32.store - ;;@ memcpy.ts:14:17 (get_local $0) - ;;@ memcpy.ts:14:28 (i32.load - ;;@ memcpy.ts:14:38 (get_local $1) ) ) - ;;@ memcpy.ts:15:6 (i32.store - ;;@ memcpy.ts:15:17 (i32.add (get_local $0) - ;;@ memcpy.ts:15:25 (i32.const 4) ) - ;;@ memcpy.ts:15:28 (i32.load - ;;@ memcpy.ts:15:38 (i32.add (get_local $1) - ;;@ memcpy.ts:15:45 (i32.const 4) ) ) ) - ;;@ memcpy.ts:16:6 (i32.store - ;;@ memcpy.ts:16:17 (i32.add (get_local $0) - ;;@ memcpy.ts:16:25 (i32.const 8) ) - ;;@ memcpy.ts:16:28 (i32.load - ;;@ memcpy.ts:16:38 (i32.add (get_local $1) - ;;@ memcpy.ts:16:45 (i32.const 8) ) ) ) - ;;@ memcpy.ts:17:6 (i32.store - ;;@ memcpy.ts:17:17 (i32.add (get_local $0) - ;;@ memcpy.ts:17:24 (i32.const 12) ) - ;;@ memcpy.ts:17:28 (i32.load - ;;@ memcpy.ts:17:38 (i32.add (get_local $1) - ;;@ memcpy.ts:17:44 (i32.const 12) ) ) ) - ;;@ memcpy.ts:18:6 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:18:13 (i32.const 16) ) ) - ;;@ memcpy.ts:18:17 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:18:25 (i32.const 16) ) ) - ;;@ memcpy.ts:18:29 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:18:34 (i32.const 16) ) ) @@ -226,160 +214,111 @@ ) ) ) - ;;@ memcpy.ts:20:4 (if - ;;@ memcpy.ts:20:8 (i32.and (get_local $2) - ;;@ memcpy.ts:20:12 (i32.const 8) ) - ;;@ memcpy.ts:20:15 (block - ;;@ memcpy.ts:21:6 (i32.store - ;;@ memcpy.ts:21:17 (get_local $0) - ;;@ memcpy.ts:21:27 (i32.load - ;;@ memcpy.ts:21:37 (get_local $1) ) ) - ;;@ memcpy.ts:22:6 (i32.store - ;;@ memcpy.ts:22:17 (i32.add (get_local $0) - ;;@ memcpy.ts:22:24 (i32.const 4) ) - ;;@ memcpy.ts:22:27 (i32.load - ;;@ memcpy.ts:22:37 (i32.add (get_local $1) - ;;@ memcpy.ts:22:43 (i32.const 4) ) ) ) - ;;@ memcpy.ts:23:6 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:23:14 (i32.const 8) ) ) - ;;@ memcpy.ts:23:17 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:23:24 (i32.const 8) ) ) ) ) - ;;@ memcpy.ts:25:4 (if - ;;@ memcpy.ts:25:8 (i32.and (get_local $2) - ;;@ memcpy.ts:25:12 (i32.const 4) ) - ;;@ memcpy.ts:25:15 (block - ;;@ memcpy.ts:26:6 (i32.store - ;;@ memcpy.ts:26:17 (get_local $0) - ;;@ memcpy.ts:26:23 (i32.load - ;;@ memcpy.ts:26:33 (get_local $1) ) ) - ;;@ memcpy.ts:27:6 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:27:14 (i32.const 4) ) ) - ;;@ memcpy.ts:27:17 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:27:24 (i32.const 4) ) ) ) ) - ;;@ memcpy.ts:29:4 (if - ;;@ memcpy.ts:29:8 (i32.and (get_local $2) - ;;@ memcpy.ts:29:12 (i32.const 2) ) - ;;@ memcpy.ts:29:15 (block - ;;@ memcpy.ts:30:6 (i32.store16 - ;;@ memcpy.ts:30:17 (get_local $0) - ;;@ memcpy.ts:30:23 (i32.load16_u - ;;@ memcpy.ts:30:33 (get_local $1) ) ) - ;;@ memcpy.ts:31:6 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:31:14 (i32.const 2) ) ) - ;;@ memcpy.ts:31:17 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:31:24 (i32.const 2) ) ) ) ) - ;;@ memcpy.ts:33:4 (if - ;;@ memcpy.ts:33:8 (i32.and (get_local $2) - ;;@ memcpy.ts:33:12 (i32.const 1) ) - ;;@ memcpy.ts:34:16 (block (set_local $3 (get_local $0) ) - ;;@ memcpy.ts:34:6 (i32.store8 (get_local $3) - ;;@ memcpy.ts:34:33 (block (result i32) (set_local $3 (get_local $1) ) - ;;@ memcpy.ts:34:24 (i32.load8_u (get_local $3) ) @@ -387,21 +326,16 @@ ) ) ) - ;;@ memcpy.ts:36:11 (return (get_local $5) ) ) ) - ;;@ memcpy.ts:41:2 (if - ;;@ memcpy.ts:41:6 (i32.ge_u (get_local $2) - ;;@ memcpy.ts:41:11 (i32.const 32) ) - ;;@ memcpy.ts:42:4 (block $break|2 (block $case2|2 (block $case1|2 @@ -409,10 +343,8 @@ (block $tablify|0 (br_table $case0|2 $case1|2 $case2|2 $tablify|0 (i32.sub - ;;@ memcpy.ts:42:12 (i32.rem_u (get_local $0) - ;;@ memcpy.ts:42:19 (i32.const 4) ) (i32.const 1) @@ -421,27 +353,21 @@ ) (br $break|2) ) - ;;@ memcpy.ts:45:8 (set_local $4 - ;;@ memcpy.ts:45:12 (i32.load - ;;@ memcpy.ts:45:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:46:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:46:8 (i32.store8 (get_local $3) - ;;@ memcpy.ts:46:35 (block (result i32) (set_local $1 (i32.add @@ -451,7 +377,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:46:26 (i32.load8_u (get_local $3) ) @@ -460,16 +385,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:47:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:47:8 (i32.store8 (get_local $3) - ;;@ memcpy.ts:47:35 (block (result i32) (set_local $1 (i32.add @@ -479,7 +401,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:47:26 (i32.load8_u (get_local $3) ) @@ -488,16 +409,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:48:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:48:8 (i32.store8 (get_local $3) - ;;@ memcpy.ts:48:35 (block (result i32) (set_local $1 (i32.add @@ -507,182 +425,128 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:48:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ memcpy.ts:49:8 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:49:13 (i32.const 3) ) ) (loop $continue|3 (if - ;;@ memcpy.ts:50:15 (i32.ge_u (get_local $2) - ;;@ memcpy.ts:50:20 (i32.const 17) ) (block - ;;@ memcpy.ts:52:10 (i32.store - ;;@ memcpy.ts:52:21 (get_local $0) - ;;@ memcpy.ts:52:27 (i32.or (i32.shr_u (get_local $4) - ;;@ memcpy.ts:52:32 (i32.const 24) ) - ;;@ memcpy.ts:52:37 (i32.shl - ;;@ memcpy.ts:51:10 (tee_local $3 - ;;@ memcpy.ts:51:14 (i32.load - ;;@ memcpy.ts:51:24 (i32.add (get_local $1) - ;;@ memcpy.ts:51:30 (i32.const 1) ) ) ) - ;;@ memcpy.ts:52:42 (i32.const 8) ) ) ) - ;;@ memcpy.ts:54:10 (i32.store - ;;@ memcpy.ts:54:21 (i32.add (get_local $0) - ;;@ memcpy.ts:54:28 (i32.const 4) ) - ;;@ memcpy.ts:54:31 (i32.or (i32.shr_u (get_local $3) - ;;@ memcpy.ts:54:36 (i32.const 24) ) - ;;@ memcpy.ts:54:41 (i32.shl - ;;@ memcpy.ts:53:10 (tee_local $4 - ;;@ memcpy.ts:53:14 (i32.load - ;;@ memcpy.ts:53:24 (i32.add (get_local $1) - ;;@ memcpy.ts:53:30 (i32.const 5) ) ) ) - ;;@ memcpy.ts:54:46 (i32.const 8) ) ) ) - ;;@ memcpy.ts:56:10 (i32.store - ;;@ memcpy.ts:56:21 (i32.add (get_local $0) - ;;@ memcpy.ts:56:28 (i32.const 8) ) - ;;@ memcpy.ts:56:31 (i32.or (i32.shr_u (get_local $4) - ;;@ memcpy.ts:56:36 (i32.const 24) ) - ;;@ memcpy.ts:56:41 (i32.shl - ;;@ memcpy.ts:55:10 (tee_local $3 - ;;@ memcpy.ts:55:14 (i32.load - ;;@ memcpy.ts:55:24 (i32.add (get_local $1) - ;;@ memcpy.ts:55:30 (i32.const 9) ) ) ) - ;;@ memcpy.ts:56:46 (i32.const 8) ) ) ) - ;;@ memcpy.ts:58:10 (i32.store - ;;@ memcpy.ts:58:21 (i32.add (get_local $0) - ;;@ memcpy.ts:58:28 (i32.const 12) ) - ;;@ memcpy.ts:58:32 (i32.or (i32.shr_u (get_local $3) - ;;@ memcpy.ts:58:37 (i32.const 24) ) - ;;@ memcpy.ts:58:42 (i32.shl - ;;@ memcpy.ts:57:10 (tee_local $4 - ;;@ memcpy.ts:57:14 (i32.load - ;;@ memcpy.ts:57:24 (i32.add (get_local $1) - ;;@ memcpy.ts:57:30 (i32.const 13) ) ) ) - ;;@ memcpy.ts:58:47 (i32.const 8) ) ) ) - ;;@ memcpy.ts:59:10 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:59:17 (i32.const 16) ) ) - ;;@ memcpy.ts:59:21 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:59:29 (i32.const 16) ) ) - ;;@ memcpy.ts:59:33 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:59:38 (i32.const 16) ) ) @@ -690,30 +554,23 @@ ) ) ) - ;;@ memcpy.ts:61:8 (br $break|2) ) - ;;@ memcpy.ts:63:8 (set_local $4 - ;;@ memcpy.ts:63:12 (i32.load - ;;@ memcpy.ts:63:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:64:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:64:8 (i32.store8 (get_local $3) - ;;@ memcpy.ts:64:35 (block (result i32) (set_local $1 (i32.add @@ -723,7 +580,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:64:26 (i32.load8_u (get_local $3) ) @@ -732,16 +588,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:65:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:65:8 (i32.store8 (get_local $3) - ;;@ memcpy.ts:65:35 (block (result i32) (set_local $1 (i32.add @@ -751,182 +604,128 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:65:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ memcpy.ts:66:8 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:66:13 (i32.const 2) ) ) (loop $continue|4 (if - ;;@ memcpy.ts:67:15 (i32.ge_u (get_local $2) - ;;@ memcpy.ts:67:20 (i32.const 18) ) (block - ;;@ memcpy.ts:69:10 (i32.store - ;;@ memcpy.ts:69:21 (get_local $0) - ;;@ memcpy.ts:69:27 (i32.or (i32.shr_u (get_local $4) - ;;@ memcpy.ts:69:32 (i32.const 16) ) - ;;@ memcpy.ts:69:37 (i32.shl - ;;@ memcpy.ts:68:10 (tee_local $3 - ;;@ memcpy.ts:68:14 (i32.load - ;;@ memcpy.ts:68:24 (i32.add (get_local $1) - ;;@ memcpy.ts:68:30 (i32.const 2) ) ) ) - ;;@ memcpy.ts:69:42 (i32.const 16) ) ) ) - ;;@ memcpy.ts:71:10 (i32.store - ;;@ memcpy.ts:71:21 (i32.add (get_local $0) - ;;@ memcpy.ts:71:28 (i32.const 4) ) - ;;@ memcpy.ts:71:31 (i32.or (i32.shr_u (get_local $3) - ;;@ memcpy.ts:71:36 (i32.const 16) ) - ;;@ memcpy.ts:71:41 (i32.shl - ;;@ memcpy.ts:70:10 (tee_local $4 - ;;@ memcpy.ts:70:14 (i32.load - ;;@ memcpy.ts:70:24 (i32.add (get_local $1) - ;;@ memcpy.ts:70:30 (i32.const 6) ) ) ) - ;;@ memcpy.ts:71:46 (i32.const 16) ) ) ) - ;;@ memcpy.ts:73:10 (i32.store - ;;@ memcpy.ts:73:21 (i32.add (get_local $0) - ;;@ memcpy.ts:73:28 (i32.const 8) ) - ;;@ memcpy.ts:73:31 (i32.or (i32.shr_u (get_local $4) - ;;@ memcpy.ts:73:36 (i32.const 16) ) - ;;@ memcpy.ts:73:41 (i32.shl - ;;@ memcpy.ts:72:10 (tee_local $3 - ;;@ memcpy.ts:72:14 (i32.load - ;;@ memcpy.ts:72:24 (i32.add (get_local $1) - ;;@ memcpy.ts:72:30 (i32.const 10) ) ) ) - ;;@ memcpy.ts:73:46 (i32.const 16) ) ) ) - ;;@ memcpy.ts:75:10 (i32.store - ;;@ memcpy.ts:75:21 (i32.add (get_local $0) - ;;@ memcpy.ts:75:28 (i32.const 12) ) - ;;@ memcpy.ts:75:32 (i32.or (i32.shr_u (get_local $3) - ;;@ memcpy.ts:75:37 (i32.const 16) ) - ;;@ memcpy.ts:75:42 (i32.shl - ;;@ memcpy.ts:74:10 (tee_local $4 - ;;@ memcpy.ts:74:14 (i32.load - ;;@ memcpy.ts:74:24 (i32.add (get_local $1) - ;;@ memcpy.ts:74:30 (i32.const 14) ) ) ) - ;;@ memcpy.ts:75:47 (i32.const 16) ) ) ) - ;;@ memcpy.ts:76:10 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:76:17 (i32.const 16) ) ) - ;;@ memcpy.ts:76:21 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:76:29 (i32.const 16) ) ) - ;;@ memcpy.ts:76:33 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:76:38 (i32.const 16) ) ) @@ -934,30 +733,23 @@ ) ) ) - ;;@ memcpy.ts:78:8 (br $break|2) ) - ;;@ memcpy.ts:80:8 (set_local $4 - ;;@ memcpy.ts:80:12 (i32.load - ;;@ memcpy.ts:80:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:81:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:81:8 (i32.store8 (get_local $3) - ;;@ memcpy.ts:81:35 (block (result i32) (set_local $1 (i32.add @@ -967,182 +759,128 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:81:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ memcpy.ts:82:8 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:82:13 (i32.const 1) ) ) (loop $continue|5 (if - ;;@ memcpy.ts:83:15 (i32.ge_u (get_local $2) - ;;@ memcpy.ts:83:20 (i32.const 19) ) (block - ;;@ memcpy.ts:85:10 (i32.store - ;;@ memcpy.ts:85:21 (get_local $0) - ;;@ memcpy.ts:85:27 (i32.or (i32.shr_u (get_local $4) - ;;@ memcpy.ts:85:32 (i32.const 8) ) - ;;@ memcpy.ts:85:36 (i32.shl - ;;@ memcpy.ts:84:10 (tee_local $3 - ;;@ memcpy.ts:84:14 (i32.load - ;;@ memcpy.ts:84:24 (i32.add (get_local $1) - ;;@ memcpy.ts:84:30 (i32.const 3) ) ) ) - ;;@ memcpy.ts:85:41 (i32.const 24) ) ) ) - ;;@ memcpy.ts:87:10 (i32.store - ;;@ memcpy.ts:87:21 (i32.add (get_local $0) - ;;@ memcpy.ts:87:28 (i32.const 4) ) - ;;@ memcpy.ts:87:31 (i32.or (i32.shr_u (get_local $3) - ;;@ memcpy.ts:87:36 (i32.const 8) ) - ;;@ memcpy.ts:87:40 (i32.shl - ;;@ memcpy.ts:86:10 (tee_local $4 - ;;@ memcpy.ts:86:14 (i32.load - ;;@ memcpy.ts:86:24 (i32.add (get_local $1) - ;;@ memcpy.ts:86:30 (i32.const 7) ) ) ) - ;;@ memcpy.ts:87:45 (i32.const 24) ) ) ) - ;;@ memcpy.ts:89:10 (i32.store - ;;@ memcpy.ts:89:21 (i32.add (get_local $0) - ;;@ memcpy.ts:89:28 (i32.const 8) ) - ;;@ memcpy.ts:89:31 (i32.or (i32.shr_u (get_local $4) - ;;@ memcpy.ts:89:36 (i32.const 8) ) - ;;@ memcpy.ts:89:40 (i32.shl - ;;@ memcpy.ts:88:10 (tee_local $3 - ;;@ memcpy.ts:88:14 (i32.load - ;;@ memcpy.ts:88:24 (i32.add (get_local $1) - ;;@ memcpy.ts:88:30 (i32.const 11) ) ) ) - ;;@ memcpy.ts:89:45 (i32.const 24) ) ) ) - ;;@ memcpy.ts:91:10 (i32.store - ;;@ memcpy.ts:91:21 (i32.add (get_local $0) - ;;@ memcpy.ts:91:28 (i32.const 12) ) - ;;@ memcpy.ts:91:32 (i32.or (i32.shr_u (get_local $3) - ;;@ memcpy.ts:91:37 (i32.const 8) ) - ;;@ memcpy.ts:91:41 (i32.shl - ;;@ memcpy.ts:90:10 (tee_local $4 - ;;@ memcpy.ts:90:14 (i32.load - ;;@ memcpy.ts:90:24 (i32.add (get_local $1) - ;;@ memcpy.ts:90:30 (i32.const 15) ) ) ) - ;;@ memcpy.ts:91:46 (i32.const 24) ) ) ) - ;;@ memcpy.ts:92:10 (set_local $1 (i32.add (get_local $1) - ;;@ memcpy.ts:92:17 (i32.const 16) ) ) - ;;@ memcpy.ts:92:21 (set_local $0 (i32.add (get_local $0) - ;;@ memcpy.ts:92:29 (i32.const 16) ) ) - ;;@ memcpy.ts:92:33 (set_local $2 (i32.sub (get_local $2) - ;;@ memcpy.ts:92:38 (i32.const 16) ) ) @@ -1152,29 +890,22 @@ ) ) ) - ;;@ memcpy.ts:99:2 (if - ;;@ memcpy.ts:99:6 (i32.and (get_local $2) - ;;@ memcpy.ts:99:10 (i32.const 16) ) - ;;@ memcpy.ts:99:14 (block (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:100:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:100:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:100:31 (block (result i32) (set_local $1 (i32.add @@ -1184,7 +915,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:100:22 (i32.load8_u (get_local $3) ) @@ -1193,16 +923,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:101:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:101:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:101:31 (block (result i32) (set_local $1 (i32.add @@ -1212,7 +939,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:101:22 (i32.load8_u (get_local $3) ) @@ -1221,16 +947,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:102:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:102:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:102:31 (block (result i32) (set_local $1 (i32.add @@ -1240,7 +963,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:102:22 (i32.load8_u (get_local $3) ) @@ -1249,16 +971,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:103:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:103:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:103:31 (block (result i32) (set_local $1 (i32.add @@ -1268,7 +987,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:103:22 (i32.load8_u (get_local $3) ) @@ -1277,16 +995,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:104:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:104:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:104:31 (block (result i32) (set_local $1 (i32.add @@ -1296,7 +1011,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:104:22 (i32.load8_u (get_local $3) ) @@ -1305,16 +1019,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:105:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:105:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:105:31 (block (result i32) (set_local $1 (i32.add @@ -1324,7 +1035,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:105:22 (i32.load8_u (get_local $3) ) @@ -1333,16 +1043,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:106:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:106:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:106:31 (block (result i32) (set_local $1 (i32.add @@ -1352,7 +1059,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:106:22 (i32.load8_u (get_local $3) ) @@ -1361,16 +1067,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:107:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:107:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:107:31 (block (result i32) (set_local $1 (i32.add @@ -1380,7 +1083,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:107:22 (i32.load8_u (get_local $3) ) @@ -1389,16 +1091,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:108:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:108:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:108:31 (block (result i32) (set_local $1 (i32.add @@ -1408,7 +1107,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:108:22 (i32.load8_u (get_local $3) ) @@ -1417,16 +1115,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:109:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:109:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:109:31 (block (result i32) (set_local $1 (i32.add @@ -1436,7 +1131,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:109:22 (i32.load8_u (get_local $3) ) @@ -1445,16 +1139,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:110:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:110:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:110:31 (block (result i32) (set_local $1 (i32.add @@ -1464,7 +1155,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:110:22 (i32.load8_u (get_local $3) ) @@ -1473,16 +1163,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:111:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:111:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:111:31 (block (result i32) (set_local $1 (i32.add @@ -1492,7 +1179,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:111:22 (i32.load8_u (get_local $3) ) @@ -1501,16 +1187,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:112:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:112:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:112:31 (block (result i32) (set_local $1 (i32.add @@ -1520,7 +1203,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:112:22 (i32.load8_u (get_local $3) ) @@ -1529,16 +1211,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:113:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:113:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:113:31 (block (result i32) (set_local $1 (i32.add @@ -1548,7 +1227,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:113:22 (i32.load8_u (get_local $3) ) @@ -1557,16 +1235,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:114:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:114:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:114:31 (block (result i32) (set_local $1 (i32.add @@ -1576,7 +1251,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:114:22 (i32.load8_u (get_local $3) ) @@ -1585,16 +1259,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:115:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:115:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:115:31 (block (result i32) (set_local $1 (i32.add @@ -1604,7 +1275,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:115:22 (i32.load8_u (get_local $3) ) @@ -1612,29 +1282,22 @@ ) ) ) - ;;@ memcpy.ts:117:2 (if - ;;@ memcpy.ts:117:6 (i32.and (get_local $2) - ;;@ memcpy.ts:117:10 (i32.const 8) ) - ;;@ memcpy.ts:117:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:118:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:118:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:118:31 (block (result i32) (set_local $1 (i32.add @@ -1644,7 +1307,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:118:22 (i32.load8_u (get_local $3) ) @@ -1653,16 +1315,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:119:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:119:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:119:31 (block (result i32) (set_local $1 (i32.add @@ -1672,7 +1331,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:119:22 (i32.load8_u (get_local $3) ) @@ -1681,16 +1339,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:120:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:120:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:120:31 (block (result i32) (set_local $1 (i32.add @@ -1700,7 +1355,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:120:22 (i32.load8_u (get_local $3) ) @@ -1709,16 +1363,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:121:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:121:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:121:31 (block (result i32) (set_local $1 (i32.add @@ -1728,7 +1379,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:121:22 (i32.load8_u (get_local $3) ) @@ -1737,16 +1387,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:122:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:122:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:122:31 (block (result i32) (set_local $1 (i32.add @@ -1756,7 +1403,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:122:22 (i32.load8_u (get_local $3) ) @@ -1765,16 +1411,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:123:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:123:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:123:31 (block (result i32) (set_local $1 (i32.add @@ -1784,7 +1427,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:123:22 (i32.load8_u (get_local $3) ) @@ -1793,16 +1435,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:124:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:124:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:124:31 (block (result i32) (set_local $1 (i32.add @@ -1812,7 +1451,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:124:22 (i32.load8_u (get_local $3) ) @@ -1821,16 +1459,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:125:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:125:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:125:31 (block (result i32) (set_local $1 (i32.add @@ -1840,7 +1475,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:125:22 (i32.load8_u (get_local $3) ) @@ -1848,29 +1482,22 @@ ) ) ) - ;;@ memcpy.ts:127:2 (if - ;;@ memcpy.ts:127:6 (i32.and (get_local $2) - ;;@ memcpy.ts:127:10 (i32.const 4) ) - ;;@ memcpy.ts:127:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:128:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:128:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:128:31 (block (result i32) (set_local $1 (i32.add @@ -1880,7 +1507,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:128:22 (i32.load8_u (get_local $3) ) @@ -1889,16 +1515,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:129:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:129:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:129:31 (block (result i32) (set_local $1 (i32.add @@ -1908,7 +1531,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:129:22 (i32.load8_u (get_local $3) ) @@ -1917,16 +1539,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:130:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:130:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:130:31 (block (result i32) (set_local $1 (i32.add @@ -1936,7 +1555,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:130:22 (i32.load8_u (get_local $3) ) @@ -1945,16 +1563,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:131:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:131:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:131:31 (block (result i32) (set_local $1 (i32.add @@ -1964,7 +1579,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:131:22 (i32.load8_u (get_local $3) ) @@ -1972,29 +1586,22 @@ ) ) ) - ;;@ memcpy.ts:133:2 (if - ;;@ memcpy.ts:133:6 (i32.and (get_local $2) - ;;@ memcpy.ts:133:10 (i32.const 2) ) - ;;@ memcpy.ts:133:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:134:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:134:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:134:31 (block (result i32) (set_local $1 (i32.add @@ -2004,7 +1611,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:134:22 (i32.load8_u (get_local $3) ) @@ -2013,16 +1619,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ memcpy.ts:135:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ memcpy.ts:135:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:135:31 (block (result i32) (set_local $1 (i32.add @@ -2032,7 +1635,6 @@ (i32.const 1) ) ) - ;;@ memcpy.ts:135:22 (i32.load8_u (get_local $3) ) @@ -2040,28 +1642,21 @@ ) ) ) - ;;@ memcpy.ts:137:2 (if - ;;@ memcpy.ts:137:6 (i32.and (get_local $2) - ;;@ memcpy.ts:137:10 (i32.const 1) ) - ;;@ memcpy.ts:138:14 (block (set_local $3 (get_local $0) ) - ;;@ memcpy.ts:138:4 (i32.store8 (get_local $3) - ;;@ memcpy.ts:138:31 (block (result i32) (set_local $3 (get_local $1) ) - ;;@ memcpy.ts:138:22 (i32.load8_u (get_local $3) ) @@ -2069,10 +1664,9 @@ ) ) ) - ;;@ memcpy.ts:140:9 (get_local $5) ) - (func $fmod/fmod (; 2 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) + (func $fmod/fmod (; 7 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i32) (local $4 i64) @@ -2081,55 +1675,37 @@ (local $7 i32) (local $8 f64) (block $folding-inner0 - ;;@ fmod.ts:5:2 (set_local $3 - ;;@ fmod.ts:5:11 (i32.wrap/i64 - ;;@ fmod.ts:5:17 (i64.and (i64.shr_u - ;;@ fmod.ts:3:2 (tee_local $2 - ;;@ fmod.ts:3:11 (i64.reinterpret/f64 - ;;@ fmod.ts:3:28 (get_local $0) ) ) - ;;@ fmod.ts:5:23 (i64.const 52) ) - ;;@ fmod.ts:5:28 (i64.const 2047) ) ) ) - ;;@ fmod.ts:6:2 (set_local $6 - ;;@ fmod.ts:6:11 (i32.wrap/i64 - ;;@ fmod.ts:6:17 (i64.and (i64.shr_u - ;;@ fmod.ts:4:2 (tee_local $5 - ;;@ fmod.ts:4:11 (i64.reinterpret/f64 - ;;@ fmod.ts:4:28 (get_local $1) ) ) - ;;@ fmod.ts:6:23 (i64.const 52) ) - ;;@ fmod.ts:6:28 (i64.const 2047) ) ) ) - ;;@ fmod.ts:9:2 (if - ;;@ fmod.ts:9:6 (i32.and (if (result i32) (tee_local $7 @@ -2139,18 +1715,14 @@ (i64.eq (i64.shl (get_local $5) - ;;@ fmod.ts:9:12 (i64.const 1) ) - ;;@ fmod.ts:9:17 (i64.const 0) ) ) (get_local $7) - ;;@ fmod.ts:9:22 (f64.ne (tee_local $8 - ;;@ fmod.ts:9:33 (get_local $1) ) (get_local $8) @@ -2160,137 +1732,98 @@ ) ) (get_local $7) - ;;@ fmod.ts:9:39 (i32.eq (get_local $3) - ;;@ fmod.ts:9:45 (i32.const 2047) ) ) (i32.const 1) ) - ;;@ fmod.ts:10:27 (return - ;;@ fmod.ts:10:11 (f64.div (f64.mul - ;;@ fmod.ts:10:12 (get_local $0) - ;;@ fmod.ts:10:16 (get_local $1) ) - ;;@ fmod.ts:10:21 (f64.mul - ;;@ fmod.ts:10:22 (get_local $0) - ;;@ fmod.ts:10:26 (get_local $1) ) ) ) ) - ;;@ fmod.ts:11:2 (if - ;;@ fmod.ts:11:6 (i64.le_u (i64.shl (get_local $2) - ;;@ fmod.ts:11:12 (i64.const 1) ) - ;;@ fmod.ts:11:17 (i64.shl (get_local $5) - ;;@ fmod.ts:11:23 (i64.const 1) ) ) - ;;@ fmod.ts:11:26 (block (br_if $folding-inner0 - ;;@ fmod.ts:12:8 (i64.eq (i64.shl (get_local $2) - ;;@ fmod.ts:12:14 (i64.const 1) ) - ;;@ fmod.ts:12:19 (i64.shl (get_local $5) - ;;@ fmod.ts:12:25 (i64.const 1) ) ) ) - ;;@ fmod.ts:14:11 (return (get_local $0) ) ) ) - ;;@ fmod.ts:7:2 (set_local $7 - ;;@ fmod.ts:7:11 (i32.wrap/i64 - ;;@ fmod.ts:7:17 (i64.shr_u (get_local $2) - ;;@ fmod.ts:7:23 (i64.const 63) ) ) ) (set_local $2 - ;;@ fmod.ts:18:2 (if (result i64) - ;;@ fmod.ts:18:7 (get_local $3) (i64.or (i64.and - ;;@ fmod.ts:23:4 (get_local $2) (i64.const 4503599627370495) ) (i64.const 4503599627370496) ) - ;;@ fmod.ts:18:11 (block (result i64) - ;;@ fmod.ts:19:9 (set_local $4 - ;;@ fmod.ts:19:17 (i64.shl (get_local $2) - ;;@ fmod.ts:19:23 (i64.const 12) ) ) (loop $continue|0 (if - ;;@ fmod.ts:19:27 (i64.eqz - ;;@ fmod.ts:19:28 (i64.shr_u - ;;@ fmod.ts:19:29 (get_local $4) - ;;@ fmod.ts:19:34 (i64.const 63) ) ) (block - ;;@ fmod.ts:20:6 (set_local $3 (i32.sub - ;;@ fmod.ts:20:8 (get_local $3) (i32.const 1) ) ) - ;;@ fmod.ts:19:39 (set_local $4 (i64.shl (get_local $4) - ;;@ fmod.ts:19:45 (i64.const 1) ) ) @@ -2299,14 +1832,10 @@ ) ) (i64.shl - ;;@ fmod.ts:21:4 (get_local $2) - ;;@ fmod.ts:21:11 (i64.extend_u/i32 (i32.sub - ;;@ fmod.ts:21:17 (i32.const 1) - ;;@ fmod.ts:21:12 (get_local $3) ) ) @@ -2315,55 +1844,40 @@ ) ) (set_local $5 - ;;@ fmod.ts:26:2 (if (result i64) - ;;@ fmod.ts:26:7 (get_local $6) (i64.or (i64.and - ;;@ fmod.ts:31:4 (get_local $5) (i64.const 4503599627370495) ) (i64.const 4503599627370496) ) - ;;@ fmod.ts:26:11 (block (result i64) - ;;@ fmod.ts:27:9 (set_local $4 - ;;@ fmod.ts:27:13 (i64.shl (get_local $5) - ;;@ fmod.ts:27:19 (i64.const 12) ) ) (loop $continue|1 (if - ;;@ fmod.ts:27:23 (i64.eqz - ;;@ fmod.ts:27:24 (i64.shr_u - ;;@ fmod.ts:27:25 (get_local $4) - ;;@ fmod.ts:27:30 (i64.const 63) ) ) (block - ;;@ fmod.ts:28:6 (set_local $6 (i32.sub - ;;@ fmod.ts:28:8 (get_local $6) (i32.const 1) ) ) - ;;@ fmod.ts:27:35 (set_local $4 (i64.shl (get_local $4) - ;;@ fmod.ts:27:41 (i64.const 1) ) ) @@ -2372,14 +1886,10 @@ ) ) (i64.shl - ;;@ fmod.ts:29:4 (get_local $5) - ;;@ fmod.ts:29:11 (i64.extend_u/i32 (i32.sub - ;;@ fmod.ts:29:17 (i32.const 1) - ;;@ fmod.ts:29:12 (get_local $6) ) ) @@ -2389,57 +1899,40 @@ ) (loop $continue|2 (if - ;;@ fmod.ts:36:9 (i32.gt_s (get_local $3) - ;;@ fmod.ts:36:14 (get_local $6) ) (block - ;;@ fmod.ts:38:4 (if - ;;@ fmod.ts:38:8 (i64.eqz - ;;@ fmod.ts:38:9 (i64.shr_u - ;;@ fmod.ts:37:4 (tee_local $4 - ;;@ fmod.ts:37:8 (i64.sub (get_local $2) - ;;@ fmod.ts:37:13 (get_local $5) ) ) - ;;@ fmod.ts:38:15 (i64.const 63) ) ) - ;;@ fmod.ts:38:20 (block (br_if $folding-inner0 - ;;@ fmod.ts:39:10 (i64.eqz - ;;@ fmod.ts:39:11 (get_local $4) ) ) - ;;@ fmod.ts:41:6 (set_local $2 - ;;@ fmod.ts:41:11 (get_local $4) ) ) ) - ;;@ fmod.ts:43:4 (set_local $2 (i64.shl (get_local $2) - ;;@ fmod.ts:43:11 (i64.const 1) ) ) - ;;@ fmod.ts:36:18 (set_local $3 (i32.sub (get_local $3) @@ -2450,67 +1943,47 @@ ) ) ) - ;;@ fmod.ts:46:2 (if - ;;@ fmod.ts:46:6 (i64.eqz - ;;@ fmod.ts:46:7 (i64.shr_u - ;;@ fmod.ts:45:2 (tee_local $4 - ;;@ fmod.ts:45:6 (i64.sub (get_local $2) - ;;@ fmod.ts:45:11 (get_local $5) ) ) - ;;@ fmod.ts:46:13 (i64.const 63) ) ) - ;;@ fmod.ts:46:18 (block (br_if $folding-inner0 - ;;@ fmod.ts:47:8 (i64.eqz - ;;@ fmod.ts:47:9 (get_local $4) ) ) - ;;@ fmod.ts:49:4 (set_local $2 - ;;@ fmod.ts:49:9 (get_local $4) ) ) ) (loop $continue|3 (if - ;;@ fmod.ts:51:9 (i64.eqz - ;;@ fmod.ts:51:10 (i64.shr_u - ;;@ fmod.ts:51:11 (get_local $2) - ;;@ fmod.ts:51:17 (i64.const 52) ) ) (block - ;;@ fmod.ts:52:4 (set_local $3 (i32.sub - ;;@ fmod.ts:52:6 (get_local $3) (i32.const 1) ) ) - ;;@ fmod.ts:51:22 (set_local $2 (i64.shl (get_local $2) - ;;@ fmod.ts:51:29 (i64.const 1) ) ) @@ -2519,67 +1992,53 @@ ) ) (return - ;;@ fmod.ts:62:9 (f64.reinterpret/i64 (i64.or (tee_local $2 (select (i64.or (i64.sub - ;;@ fmod.ts:56:4 (get_local $2) (i64.const 4503599627370496) ) - ;;@ fmod.ts:57:10 (i64.shl (i64.extend_u/i32 (get_local $3) ) - ;;@ fmod.ts:57:21 (i64.const 52) ) ) (i64.shr_u - ;;@ fmod.ts:59:4 (get_local $2) - ;;@ fmod.ts:59:11 (i64.extend_u/i32 (i32.sub - ;;@ fmod.ts:59:17 (i32.const 1) - ;;@ fmod.ts:59:12 (get_local $3) ) ) ) - ;;@ fmod.ts:55:6 (i32.gt_s (get_local $3) - ;;@ fmod.ts:55:11 (i32.const 0) ) ) ) - ;;@ fmod.ts:61:8 (i64.shl (i64.extend_u/i32 (get_local $7) ) - ;;@ fmod.ts:61:19 (i64.const 63) ) ) ) ) ) - ;;@ fmod.ts:13:13 (f64.mul (f64.const 0) - ;;@ fmod.ts:13:17 (get_local $0) ) ) - (func $fmod/fmodf (; 3 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) + (func $fmod/fmodf (; 8 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2588,51 +2047,33 @@ (local $7 f32) (local $8 i32) (block $folding-inner0 - ;;@ fmod.ts:74:2 (set_local $4 - ;;@ fmod.ts:74:11 (i32.and - ;;@ fmod.ts:74:17 (i32.shr_u - ;;@ fmod.ts:72:2 (tee_local $2 - ;;@ fmod.ts:72:11 (i32.reinterpret/f32 - ;;@ fmod.ts:72:28 (get_local $0) ) ) - ;;@ fmod.ts:74:23 (i32.const 23) ) - ;;@ fmod.ts:74:28 (i32.const 255) ) ) - ;;@ fmod.ts:75:2 (set_local $6 - ;;@ fmod.ts:75:11 (i32.and - ;;@ fmod.ts:75:17 (i32.shr_u - ;;@ fmod.ts:73:2 (tee_local $5 - ;;@ fmod.ts:73:11 (i32.reinterpret/f32 - ;;@ fmod.ts:73:28 (get_local $1) ) ) - ;;@ fmod.ts:75:23 (i32.const 23) ) - ;;@ fmod.ts:75:28 (i32.const 255) ) ) - ;;@ fmod.ts:78:2 (if - ;;@ fmod.ts:78:6 (i32.and (if (result i32) (tee_local $3 @@ -2642,16 +2083,13 @@ (i32.eqz (i32.shl (get_local $5) - ;;@ fmod.ts:78:12 (i32.const 1) ) ) ) (get_local $3) - ;;@ fmod.ts:78:22 (f32.ne (tee_local $7 - ;;@ fmod.ts:78:33 (get_local $1) ) (get_local $7) @@ -2661,134 +2099,96 @@ ) ) (get_local $3) - ;;@ fmod.ts:78:39 (i32.eq (get_local $4) - ;;@ fmod.ts:78:45 (i32.const 255) ) ) (i32.const 1) ) - ;;@ fmod.ts:79:27 (return - ;;@ fmod.ts:79:11 (f32.div (f32.mul - ;;@ fmod.ts:79:12 (get_local $0) - ;;@ fmod.ts:79:16 (get_local $1) ) - ;;@ fmod.ts:79:21 (f32.mul - ;;@ fmod.ts:79:22 (get_local $0) - ;;@ fmod.ts:79:26 (get_local $1) ) ) ) ) - ;;@ fmod.ts:80:2 (if - ;;@ fmod.ts:80:6 (i32.le_u (i32.shl (get_local $2) - ;;@ fmod.ts:80:12 (i32.const 1) ) - ;;@ fmod.ts:80:17 (i32.shl (get_local $5) - ;;@ fmod.ts:80:23 (i32.const 1) ) ) - ;;@ fmod.ts:80:26 (block (br_if $folding-inner0 - ;;@ fmod.ts:81:8 (i32.eq (i32.shl (get_local $2) - ;;@ fmod.ts:81:14 (i32.const 1) ) - ;;@ fmod.ts:81:19 (i32.shl (get_local $5) - ;;@ fmod.ts:81:25 (i32.const 1) ) ) ) - ;;@ fmod.ts:83:11 (return (get_local $0) ) ) ) - ;;@ fmod.ts:76:2 (set_local $8 - ;;@ fmod.ts:76:11 (i32.and (get_local $2) - ;;@ fmod.ts:76:16 (i32.const -2147483648) ) ) (set_local $2 - ;;@ fmod.ts:87:2 (if (result i32) - ;;@ fmod.ts:87:7 (get_local $4) (i32.or (i32.and - ;;@ fmod.ts:92:4 (get_local $2) (i32.const 8388607) ) (i32.const 8388608) ) - ;;@ fmod.ts:87:11 (block (result i32) - ;;@ fmod.ts:88:9 (set_local $3 - ;;@ fmod.ts:88:17 (i32.shl (get_local $2) - ;;@ fmod.ts:88:23 (i32.const 9) ) ) (loop $continue|0 (if - ;;@ fmod.ts:88:26 (i32.eqz - ;;@ fmod.ts:88:27 (i32.shr_u - ;;@ fmod.ts:88:28 (get_local $3) - ;;@ fmod.ts:88:33 (i32.const 31) ) ) (block - ;;@ fmod.ts:89:6 (set_local $4 (i32.sub - ;;@ fmod.ts:89:8 (get_local $4) (i32.const 1) ) ) - ;;@ fmod.ts:88:38 (set_local $3 (i32.shl (get_local $3) - ;;@ fmod.ts:88:44 (i32.const 1) ) ) @@ -2797,13 +2197,9 @@ ) ) (i32.shl - ;;@ fmod.ts:90:4 (get_local $2) - ;;@ fmod.ts:90:11 (i32.sub - ;;@ fmod.ts:90:17 (i32.const 1) - ;;@ fmod.ts:90:12 (get_local $4) ) ) @@ -2811,55 +2207,40 @@ ) ) (set_local $5 - ;;@ fmod.ts:95:2 (if (result i32) - ;;@ fmod.ts:95:7 (get_local $6) (i32.or (i32.and - ;;@ fmod.ts:100:4 (get_local $5) (i32.const 8388607) ) (i32.const 8388608) ) - ;;@ fmod.ts:95:11 (block (result i32) - ;;@ fmod.ts:96:9 (set_local $3 - ;;@ fmod.ts:96:13 (i32.shl (get_local $5) - ;;@ fmod.ts:96:19 (i32.const 9) ) ) (loop $continue|1 (if - ;;@ fmod.ts:96:22 (i32.eqz - ;;@ fmod.ts:96:23 (i32.shr_u - ;;@ fmod.ts:96:24 (get_local $3) - ;;@ fmod.ts:96:29 (i32.const 31) ) ) (block - ;;@ fmod.ts:97:6 (set_local $6 (i32.sub - ;;@ fmod.ts:97:8 (get_local $6) (i32.const 1) ) ) - ;;@ fmod.ts:96:34 (set_local $3 (i32.shl (get_local $3) - ;;@ fmod.ts:96:40 (i32.const 1) ) ) @@ -2868,13 +2249,9 @@ ) ) (i32.shl - ;;@ fmod.ts:98:4 (get_local $5) - ;;@ fmod.ts:98:11 (i32.sub - ;;@ fmod.ts:98:17 (i32.const 1) - ;;@ fmod.ts:98:12 (get_local $6) ) ) @@ -2883,60 +2260,42 @@ ) (loop $continue|2 (if - ;;@ fmod.ts:105:9 (i32.gt_s (get_local $4) - ;;@ fmod.ts:105:14 (get_local $6) ) (block - ;;@ fmod.ts:107:4 (if - ;;@ fmod.ts:107:8 (i32.eqz - ;;@ fmod.ts:107:9 (i32.shr_u - ;;@ fmod.ts:106:4 (tee_local $3 - ;;@ fmod.ts:106:8 (i32.sub (get_local $2) - ;;@ fmod.ts:106:13 (get_local $5) ) ) - ;;@ fmod.ts:107:15 (i32.const 31) ) ) - ;;@ fmod.ts:107:20 (block (br_if $folding-inner0 - ;;@ fmod.ts:108:10 (i32.eqz - ;;@ fmod.ts:108:11 (get_local $3) ) ) - ;;@ fmod.ts:110:6 (set_local $2 - ;;@ fmod.ts:110:11 (get_local $3) ) ) ) - ;;@ fmod.ts:112:4 (set_local $2 (i32.shl (get_local $2) - ;;@ fmod.ts:112:11 (i32.const 1) ) ) - ;;@ fmod.ts:105:18 (set_local $4 (i32.sub - ;;@ fmod.ts:105:20 (get_local $4) (i32.const 1) ) @@ -2945,67 +2304,47 @@ ) ) ) - ;;@ fmod.ts:115:2 (if - ;;@ fmod.ts:115:6 (i32.eqz - ;;@ fmod.ts:115:7 (i32.shr_u - ;;@ fmod.ts:114:2 (tee_local $3 - ;;@ fmod.ts:114:6 (i32.sub (get_local $2) - ;;@ fmod.ts:114:11 (get_local $5) ) ) - ;;@ fmod.ts:115:13 (i32.const 31) ) ) - ;;@ fmod.ts:115:18 (block (br_if $folding-inner0 - ;;@ fmod.ts:116:8 (i32.eqz - ;;@ fmod.ts:116:9 (get_local $3) ) ) - ;;@ fmod.ts:118:4 (set_local $2 - ;;@ fmod.ts:118:9 (get_local $3) ) ) ) (loop $continue|3 (if - ;;@ fmod.ts:120:9 (i32.eqz - ;;@ fmod.ts:120:10 (i32.shr_u - ;;@ fmod.ts:120:11 (get_local $2) - ;;@ fmod.ts:120:17 (i32.const 23) ) ) (block - ;;@ fmod.ts:121:4 (set_local $4 (i32.sub - ;;@ fmod.ts:121:6 (get_local $4) (i32.const 1) ) ) - ;;@ fmod.ts:120:22 (set_local $2 (i32.shl (get_local $2) - ;;@ fmod.ts:120:29 (i32.const 1) ) ) @@ -3014,141 +2353,118 @@ ) ) (return - ;;@ fmod.ts:131:9 (f32.reinterpret/i32 (i32.or (tee_local $2 (select (i32.or (i32.sub - ;;@ fmod.ts:125:4 (get_local $2) (i32.const 8388608) ) - ;;@ fmod.ts:126:10 (i32.shl (get_local $4) - ;;@ fmod.ts:126:21 (i32.const 23) ) ) (i32.shr_u - ;;@ fmod.ts:128:4 (get_local $2) - ;;@ fmod.ts:128:11 (i32.sub - ;;@ fmod.ts:128:17 (i32.const 1) - ;;@ fmod.ts:128:12 (get_local $4) ) ) - ;;@ fmod.ts:124:6 (i32.gt_s (get_local $4) - ;;@ fmod.ts:124:11 (i32.const 0) ) ) ) - ;;@ fmod.ts:130:8 (get_local $8) ) ) ) ) - ;;@ fmod.ts:82:13 (f32.mul (f32.const 0) - ;;@ fmod.ts:82:17 (get_local $0) ) ) - (func $start (; 4 ;) (type $v) - (local $0 i32) + (func $showcase/ADerivedClass#set:aWildAccessorAppears (; 9 ;) (type $ifv) (param $0 i32) (param $1 f32) + (f32.store offset=4 + (get_local $0) + (get_local $1) + ) + ) + (func $showcase/ADerivedClass#get:aWildAccessorAppears (; 10 ;) (type $if) (param $0 i32) (result f32) + (f32.load offset=4 + (get_local $0) + ) + ) + (func $start (; 11 ;) (type $v) + (local $0 f64) (local $1 f32) - (local $2 f64) + (local $2 i32) (local $3 i64) - ;;@ unary.ts:15:0 - (set_global $unary/i - (i32.add - ;;@ unary.ts:15:2 - (get_global $unary/i) - (i32.const 1) - ) - ) - ;;@ unary.ts:16:0 - (set_global $unary/i - (i32.sub - ;;@ unary.ts:16:2 - (get_global $unary/i) - (i32.const 1) - ) - ) - ;;@ unary.ts:17:0 + (local $4 i32) + (local $5 i64) + (set_global $unary/i + (i32.add + (get_global $unary/i) + (i32.const 1) + ) + ) + (set_global $unary/i + (i32.sub + (get_global $unary/i) + (i32.const 1) + ) + ) (set_global $unary/i (i32.add (get_global $unary/i) (i32.const 1) ) ) - ;;@ unary.ts:18:0 (set_global $unary/i (i32.sub (get_global $unary/i) (i32.const 1) ) ) - ;;@ unary.ts:20:0 (set_global $unary/i - ;;@ unary.ts:20:4 (i32.const 1) ) - ;;@ unary.ts:21:0 (set_global $unary/i (i32.const -1) ) - ;;@ unary.ts:22:0 (set_global $unary/i (i32.const 0) ) - ;;@ unary.ts:23:0 (set_global $unary/i (i32.const -2) ) - ;;@ unary.ts:25:0 (set_global $unary/i - ;;@ unary.ts:25:4 (i32.sub (i32.const 0) - ;;@ unary.ts:25:5 (get_global $unary/i) ) ) - ;;@ unary.ts:26:0 (set_global $unary/i - ;;@ unary.ts:26:4 (i32.eqz - ;;@ unary.ts:26:5 (get_global $unary/i) ) ) - ;;@ unary.ts:27:0 (set_global $unary/i - ;;@ unary.ts:27:4 (i32.xor - ;;@ unary.ts:27:5 (get_global $unary/i) (i32.const -1) ) ) - ;;@ unary.ts:28:0 (set_global $unary/i - ;;@ unary.ts:28:4 (block (result i32) (set_global $unary/i (i32.add - ;;@ unary.ts:28:6 (get_global $unary/i) (i32.const 1) ) @@ -3156,13 +2472,10 @@ (get_global $unary/i) ) ) - ;;@ unary.ts:29:0 (set_global $unary/i - ;;@ unary.ts:29:4 (block (result i32) (set_global $unary/i (i32.sub - ;;@ unary.ts:29:6 (get_global $unary/i) (i32.const 1) ) @@ -3170,118 +2483,91 @@ (get_global $unary/i) ) ) - ;;@ unary.ts:30:0 (set_global $unary/i - ;;@ unary.ts:30:4 (block (result i32) (set_global $unary/i (i32.add - (tee_local $0 + (tee_local $2 (get_global $unary/i) ) (i32.const 1) ) ) - (get_local $0) + (get_local $2) ) ) - ;;@ unary.ts:31:0 (set_global $unary/i - ;;@ unary.ts:31:4 (block (result i32) (set_global $unary/i (i32.sub - (tee_local $0 + (tee_local $2 (get_global $unary/i) ) (i32.const 1) ) ) - (get_local $0) + (get_local $2) + ) + ) + (set_global $unary/I + (i64.add + (get_global $unary/I) + (i64.const 1) + ) + ) + (set_global $unary/I + (i64.sub + (get_global $unary/I) + (i64.const 1) ) ) - ;;@ unary.ts:39:0 - (set_global $unary/I - (i64.add - ;;@ unary.ts:39:2 - (get_global $unary/I) - (i64.const 1) - ) - ) - ;;@ unary.ts:40:0 - (set_global $unary/I - (i64.sub - ;;@ unary.ts:40:2 - (get_global $unary/I) - (i64.const 1) - ) - ) - ;;@ unary.ts:41:0 (set_global $unary/I (i64.add (get_global $unary/I) (i64.const 1) ) ) - ;;@ unary.ts:42:0 (set_global $unary/I (i64.sub (get_global $unary/I) (i64.const 1) ) ) - ;;@ unary.ts:44:0 (set_global $unary/I - ;;@ unary.ts:44:4 (i64.const 1) ) - ;;@ unary.ts:45:0 (set_global $unary/I (i64.const -1) ) - ;;@ unary.ts:46:0 (set_global $unary/I (i64.const 0) ) - ;;@ unary.ts:47:0 (set_global $unary/I (i64.const -2) ) - ;;@ unary.ts:49:0 (set_global $unary/I - ;;@ unary.ts:49:4 (i64.sub (i64.const 0) - ;;@ unary.ts:49:5 (get_global $unary/I) ) ) - ;;@ unary.ts:50:0 (set_global $unary/I - ;;@ unary.ts:50:4 (i64.extend_s/i32 (i64.eqz - ;;@ unary.ts:50:5 (get_global $unary/I) ) ) ) - ;;@ unary.ts:51:0 (set_global $unary/I - ;;@ unary.ts:51:4 (i64.xor - ;;@ unary.ts:51:5 (get_global $unary/I) (i64.const -1) ) ) - ;;@ unary.ts:52:0 (set_global $unary/I - ;;@ unary.ts:52:4 (block (result i64) (set_global $unary/I (i64.add - ;;@ unary.ts:52:6 (get_global $unary/I) (i64.const 1) ) @@ -3289,13 +2575,10 @@ (get_global $unary/I) ) ) - ;;@ unary.ts:53:0 (set_global $unary/I - ;;@ unary.ts:53:4 (block (result i64) (set_global $unary/I (i64.sub - ;;@ unary.ts:53:6 (get_global $unary/I) (i64.const 1) ) @@ -3303,9 +2586,7 @@ (get_global $unary/I) ) ) - ;;@ unary.ts:54:0 (set_global $unary/I - ;;@ unary.ts:54:4 (block (result i64) (set_global $unary/I (i64.add @@ -3318,9 +2599,7 @@ (get_local $3) ) ) - ;;@ unary.ts:55:0 (set_global $unary/I - ;;@ unary.ts:55:4 (block (result i64) (set_global $unary/I (i64.sub @@ -3333,73 +2612,54 @@ (get_local $3) ) ) - ;;@ unary.ts:62:0 - (set_global $unary/f - (f32.add - ;;@ unary.ts:62:2 - (get_global $unary/f) - (f32.const 1) - ) - ) - ;;@ unary.ts:63:0 - (set_global $unary/f - (f32.sub - ;;@ unary.ts:63:2 - (get_global $unary/f) - (f32.const 1) - ) - ) - ;;@ unary.ts:64:0 (set_global $unary/f (f32.add (get_global $unary/f) (f32.const 1) ) ) - ;;@ unary.ts:65:0 (set_global $unary/f (f32.sub (get_global $unary/f) (f32.const 1) ) ) - ;;@ unary.ts:67:0 (set_global $unary/f - ;;@ unary.ts:67:4 + (f32.add + (get_global $unary/f) + (f32.const 1) + ) + ) + (set_global $unary/f + (f32.sub + (get_global $unary/f) + (f32.const 1) + ) + ) + (set_global $unary/f (f32.const 1.25) ) - ;;@ unary.ts:68:0 (set_global $unary/f (f32.const -1.25) ) - ;;@ unary.ts:69:0 (set_global $unary/i (i32.const 0) ) - ;;@ unary.ts:71:0 (set_global $unary/f - ;;@ unary.ts:71:4 (f32.neg - ;;@ unary.ts:71:5 (get_global $unary/f) ) ) - ;;@ unary.ts:72:0 (set_global $unary/i - ;;@ unary.ts:72:4 (f32.eq - ;;@ unary.ts:72:5 (get_global $unary/f) (f32.const 0) ) ) - ;;@ unary.ts:73:0 (set_global $unary/f - ;;@ unary.ts:73:4 (block (result f32) (set_global $unary/f (f32.add - ;;@ unary.ts:73:6 (get_global $unary/f) (f32.const 1) ) @@ -3407,13 +2667,10 @@ (get_global $unary/f) ) ) - ;;@ unary.ts:74:0 (set_global $unary/f - ;;@ unary.ts:74:4 (block (result f32) (set_global $unary/f (f32.sub - ;;@ unary.ts:74:6 (get_global $unary/f) (f32.const 1) ) @@ -3421,9 +2678,7 @@ (get_global $unary/f) ) ) - ;;@ unary.ts:75:0 (set_global $unary/f - ;;@ unary.ts:75:4 (block (result f32) (set_global $unary/f (f32.add @@ -3436,9 +2691,7 @@ (get_local $1) ) ) - ;;@ unary.ts:76:0 (set_global $unary/f - ;;@ unary.ts:76:4 (block (result f32) (set_global $unary/f (f32.sub @@ -3451,75 +2704,56 @@ (get_local $1) ) ) - ;;@ unary.ts:83:0 - (set_global $unary/F - (f64.add - ;;@ unary.ts:83:2 - (get_global $unary/F) - (f64.const 1) - ) - ) - ;;@ unary.ts:84:0 - (set_global $unary/F - (f64.sub - ;;@ unary.ts:84:2 - (get_global $unary/F) - (f64.const 1) - ) - ) - ;;@ unary.ts:85:0 (set_global $unary/F (f64.add (get_global $unary/F) (f64.const 1) ) ) - ;;@ unary.ts:86:0 (set_global $unary/F (f64.sub (get_global $unary/F) (f64.const 1) ) ) - ;;@ unary.ts:88:0 (set_global $unary/F - ;;@ unary.ts:88:4 + (f64.add + (get_global $unary/F) + (f64.const 1) + ) + ) + (set_global $unary/F + (f64.sub + (get_global $unary/F) + (f64.const 1) + ) + ) + (set_global $unary/F (f64.const 1.25) ) - ;;@ unary.ts:89:0 (set_global $unary/F (f64.const -1.25) ) - ;;@ unary.ts:90:0 (set_global $unary/I (i64.const 0) ) - ;;@ unary.ts:92:0 (set_global $unary/F - ;;@ unary.ts:92:4 (f64.neg - ;;@ unary.ts:92:5 (get_global $unary/F) ) ) - ;;@ unary.ts:93:0 (set_global $unary/I - ;;@ unary.ts:93:4 (i64.extend_s/i32 (f64.eq - ;;@ unary.ts:93:5 (get_global $unary/F) (f64.const 0) ) ) ) - ;;@ unary.ts:94:0 (set_global $unary/F - ;;@ unary.ts:94:4 (block (result f64) (set_global $unary/F (f64.add - ;;@ unary.ts:94:6 (get_global $unary/F) (f64.const 1) ) @@ -3527,13 +2761,10 @@ (get_global $unary/F) ) ) - ;;@ unary.ts:95:0 (set_global $unary/F - ;;@ unary.ts:95:4 (block (result f64) (set_global $unary/F (f64.sub - ;;@ unary.ts:95:6 (get_global $unary/F) (f64.const 1) ) @@ -3541,1761 +2772,1523 @@ (get_global $unary/F) ) ) - ;;@ unary.ts:96:0 (set_global $unary/F - ;;@ unary.ts:96:4 (block (result f64) (set_global $unary/F (f64.add - (tee_local $2 + (tee_local $0 (get_global $unary/F) ) (f64.const 1) ) ) - (get_local $2) + (get_local $0) ) ) - ;;@ unary.ts:97:0 (set_global $unary/F - ;;@ unary.ts:97:4 (block (result f64) (set_global $unary/F (f64.sub - (tee_local $2 + (tee_local $0 (get_global $unary/F) ) (f64.const 1) ) ) - (get_local $2) + (get_local $0) ) ) - ;;@ binary.ts:14:0 (drop (i32.div_s (get_global $binary/i) - ;;@ binary.ts:14:4 (i32.const 1) ) ) - ;;@ binary.ts:15:0 (drop (i32.rem_s (get_global $binary/i) - ;;@ binary.ts:15:4 (i32.const 1) ) ) - ;;@ binary.ts:23:0 (set_global $binary/b - ;;@ binary.ts:23:4 (i32.lt_s (get_global $binary/i) - ;;@ binary.ts:23:8 (i32.const 1) ) ) - ;;@ binary.ts:24:0 (set_global $binary/b - ;;@ binary.ts:24:4 (i32.gt_s (get_global $binary/i) - ;;@ binary.ts:24:8 (i32.const 1) ) ) - ;;@ binary.ts:25:0 (set_global $binary/b - ;;@ binary.ts:25:4 (i32.le_s (get_global $binary/i) - ;;@ binary.ts:25:9 (i32.const 1) ) ) - ;;@ binary.ts:26:0 (set_global $binary/b - ;;@ binary.ts:26:4 (i32.ge_s (get_global $binary/i) - ;;@ binary.ts:26:9 (i32.const 1) ) ) - ;;@ binary.ts:27:0 (set_global $binary/b - ;;@ binary.ts:27:4 (i32.eq (get_global $binary/i) - ;;@ binary.ts:27:9 (i32.const 1) ) ) - ;;@ binary.ts:28:0 (set_global $binary/b - ;;@ binary.ts:28:4 (i32.eq (get_global $binary/i) - ;;@ binary.ts:28:10 (i32.const 1) ) ) - ;;@ binary.ts:29:0 (set_global $binary/i - ;;@ binary.ts:29:4 (i32.add (get_global $binary/i) - ;;@ binary.ts:29:8 (i32.const 1) ) ) - ;;@ binary.ts:30:0 (set_global $binary/i - ;;@ binary.ts:30:4 (i32.sub (get_global $binary/i) - ;;@ binary.ts:30:8 (i32.const 1) ) ) - ;;@ binary.ts:31:0 (set_global $binary/i - ;;@ binary.ts:31:4 (i32.mul (get_global $binary/i) - ;;@ binary.ts:31:8 (i32.const 1) ) ) - ;;@ binary.ts:32:0 (set_global $binary/i - ;;@ binary.ts:32:4 (i32.div_s (get_global $binary/i) - ;;@ binary.ts:32:8 (i32.const 1) ) ) - ;;@ binary.ts:33:0 (set_global $binary/i - ;;@ binary.ts:33:4 (i32.rem_s (get_global $binary/i) - ;;@ binary.ts:33:8 (i32.const 1) ) ) - ;;@ binary.ts:34:0 (set_global $binary/i - ;;@ binary.ts:34:4 (i32.shl (get_global $binary/i) - ;;@ binary.ts:34:9 (i32.const 1) ) ) - ;;@ binary.ts:35:0 (set_global $binary/i - ;;@ binary.ts:35:4 (i32.shr_s (get_global $binary/i) - ;;@ binary.ts:35:9 (i32.const 1) ) ) - ;;@ binary.ts:36:0 (set_global $binary/i - ;;@ binary.ts:36:4 (i32.shr_u (get_global $binary/i) - ;;@ binary.ts:36:10 (i32.const 1) ) ) - ;;@ binary.ts:37:0 (set_global $binary/i - ;;@ binary.ts:37:4 (i32.and (get_global $binary/i) - ;;@ binary.ts:37:8 (i32.const 1) ) ) - ;;@ binary.ts:38:0 (set_global $binary/i - ;;@ binary.ts:38:4 (i32.or (get_global $binary/i) - ;;@ binary.ts:38:8 (i32.const 1) ) ) - ;;@ binary.ts:39:0 (set_global $binary/i - ;;@ binary.ts:39:4 (i32.xor (get_global $binary/i) - ;;@ binary.ts:39:8 (i32.const 1) ) ) - ;;@ binary.ts:41:0 (set_global $binary/i (i32.add (get_global $binary/i) - ;;@ binary.ts:41:5 (i32.const 1) ) ) - ;;@ binary.ts:42:0 (set_global $binary/i (i32.sub (get_global $binary/i) - ;;@ binary.ts:42:5 (i32.const 1) ) ) - ;;@ binary.ts:43:0 (set_global $binary/i (i32.mul (get_global $binary/i) - ;;@ binary.ts:43:5 (i32.const 1) ) ) - ;;@ binary.ts:44:0 (set_global $binary/i (i32.rem_s (get_global $binary/i) - ;;@ binary.ts:44:5 (i32.const 1) ) ) - ;;@ binary.ts:45:0 (set_global $binary/i (i32.shl (get_global $binary/i) - ;;@ binary.ts:45:6 (i32.const 1) ) ) - ;;@ binary.ts:46:0 (set_global $binary/i (i32.shr_s (get_global $binary/i) - ;;@ binary.ts:46:6 (i32.const 1) ) ) - ;;@ binary.ts:47:0 (set_global $binary/i (i32.shr_u (get_global $binary/i) - ;;@ binary.ts:47:7 (i32.const 1) ) ) - ;;@ binary.ts:48:0 (set_global $binary/i (i32.and (get_global $binary/i) - ;;@ binary.ts:48:5 (i32.const 1) ) ) - ;;@ binary.ts:49:0 (set_global $binary/i (i32.or (get_global $binary/i) - ;;@ binary.ts:49:5 (i32.const 1) ) ) - ;;@ binary.ts:50:0 (set_global $binary/i (i32.xor (get_global $binary/i) - ;;@ binary.ts:50:5 (i32.const 1) ) ) - ;;@ binary.ts:63:0 (drop (i64.div_s (get_global $binary/I) - ;;@ binary.ts:63:4 (i64.const 1) ) ) - ;;@ binary.ts:64:0 (drop (i64.rem_s (get_global $binary/I) - ;;@ binary.ts:64:4 (i64.const 1) ) ) - ;;@ binary.ts:72:0 (set_global $binary/b - ;;@ binary.ts:72:4 (i64.lt_s (get_global $binary/I) - ;;@ binary.ts:72:8 (i64.const 1) ) ) - ;;@ binary.ts:73:0 (set_global $binary/b - ;;@ binary.ts:73:4 (i64.gt_s (get_global $binary/I) - ;;@ binary.ts:73:8 (i64.const 1) ) ) - ;;@ binary.ts:74:0 (set_global $binary/b - ;;@ binary.ts:74:4 (i64.le_s (get_global $binary/I) - ;;@ binary.ts:74:9 (i64.const 1) ) ) - ;;@ binary.ts:75:0 (set_global $binary/b - ;;@ binary.ts:75:4 (i64.ge_s (get_global $binary/I) - ;;@ binary.ts:75:9 (i64.const 1) ) ) - ;;@ binary.ts:76:0 (set_global $binary/b - ;;@ binary.ts:76:4 (i64.eq (get_global $binary/I) - ;;@ binary.ts:76:9 (i64.const 1) ) ) - ;;@ binary.ts:77:0 (set_global $binary/b - ;;@ binary.ts:77:4 (i64.eq (get_global $binary/I) - ;;@ binary.ts:77:10 (i64.const 1) ) ) - ;;@ binary.ts:78:0 (set_global $binary/I - ;;@ binary.ts:78:4 (i64.add (get_global $binary/I) - ;;@ binary.ts:78:8 (i64.const 1) ) ) - ;;@ binary.ts:79:0 (set_global $binary/I - ;;@ binary.ts:79:4 (i64.sub (get_global $binary/I) - ;;@ binary.ts:79:8 (i64.const 1) ) ) - ;;@ binary.ts:80:0 (set_global $binary/I - ;;@ binary.ts:80:4 (i64.mul (get_global $binary/I) - ;;@ binary.ts:80:8 (i64.const 1) ) ) - ;;@ binary.ts:81:0 (set_global $binary/I - ;;@ binary.ts:81:4 (i64.div_s (get_global $binary/I) - ;;@ binary.ts:81:8 (i64.const 1) ) ) - ;;@ binary.ts:82:0 (set_global $binary/I - ;;@ binary.ts:82:4 (i64.rem_s (get_global $binary/I) - ;;@ binary.ts:82:8 (i64.const 1) ) ) - ;;@ binary.ts:83:0 (set_global $binary/I - ;;@ binary.ts:83:4 (i64.shl (get_global $binary/I) - ;;@ binary.ts:83:9 (i64.const 1) ) ) - ;;@ binary.ts:84:0 (set_global $binary/I - ;;@ binary.ts:84:4 (i64.shr_s (get_global $binary/I) - ;;@ binary.ts:84:9 (i64.const 1) ) ) - ;;@ binary.ts:85:0 (set_global $binary/I - ;;@ binary.ts:85:4 (i64.shr_u (get_global $binary/I) - ;;@ binary.ts:85:10 (i64.const 1) ) ) - ;;@ binary.ts:86:0 (set_global $binary/I - ;;@ binary.ts:86:4 (i64.and (get_global $binary/I) - ;;@ binary.ts:86:8 (i64.const 1) ) ) - ;;@ binary.ts:87:0 (set_global $binary/I - ;;@ binary.ts:87:4 (i64.or (get_global $binary/I) - ;;@ binary.ts:87:8 (i64.const 1) ) ) - ;;@ binary.ts:88:0 (set_global $binary/I - ;;@ binary.ts:88:4 (i64.xor (get_global $binary/I) - ;;@ binary.ts:88:8 (i64.const 1) ) ) - ;;@ binary.ts:90:0 (set_global $binary/I (i64.add (get_global $binary/I) - ;;@ binary.ts:90:5 (i64.const 1) ) ) - ;;@ binary.ts:91:0 (set_global $binary/I (i64.sub (get_global $binary/I) - ;;@ binary.ts:91:5 (i64.const 1) ) ) - ;;@ binary.ts:92:0 (set_global $binary/I (i64.mul (get_global $binary/I) - ;;@ binary.ts:92:5 (i64.const 1) ) ) - ;;@ binary.ts:93:0 (set_global $binary/I (i64.rem_s (get_global $binary/I) - ;;@ binary.ts:93:5 (i64.const 1) ) ) - ;;@ binary.ts:94:0 (set_global $binary/I (i64.shl (get_global $binary/I) - ;;@ binary.ts:94:6 (i64.const 1) ) ) - ;;@ binary.ts:95:0 (set_global $binary/I (i64.shr_s (get_global $binary/I) - ;;@ binary.ts:95:6 (i64.const 1) ) ) - ;;@ binary.ts:96:0 (set_global $binary/I (i64.shr_u (get_global $binary/I) - ;;@ binary.ts:96:7 (i64.const 1) ) ) - ;;@ binary.ts:97:0 (set_global $binary/I (i64.and (get_global $binary/I) - ;;@ binary.ts:97:5 (i64.const 1) ) ) - ;;@ binary.ts:98:0 (set_global $binary/I (i64.or (get_global $binary/I) - ;;@ binary.ts:98:5 (i64.const 1) ) ) - ;;@ binary.ts:99:0 (set_global $binary/I (i64.xor (get_global $binary/I) - ;;@ binary.ts:99:5 (i64.const 1) ) ) - ;;@ binary.ts:115:0 (set_global $binary/b - ;;@ binary.ts:115:4 (f32.lt (get_global $binary/f) - ;;@ binary.ts:115:8 (f32.const 1) ) ) - ;;@ binary.ts:116:0 (set_global $binary/b - ;;@ binary.ts:116:4 (f32.gt (get_global $binary/f) - ;;@ binary.ts:116:8 (f32.const 1) ) ) - ;;@ binary.ts:117:0 (set_global $binary/b - ;;@ binary.ts:117:4 (f32.le (get_global $binary/f) - ;;@ binary.ts:117:9 (f32.const 1) ) ) - ;;@ binary.ts:118:0 (set_global $binary/b - ;;@ binary.ts:118:4 (f32.ge (get_global $binary/f) - ;;@ binary.ts:118:9 (f32.const 1) ) ) - ;;@ binary.ts:119:0 (set_global $binary/b - ;;@ binary.ts:119:4 (f32.eq (get_global $binary/f) - ;;@ binary.ts:119:9 (f32.const 1) ) ) - ;;@ binary.ts:120:0 (set_global $binary/b - ;;@ binary.ts:120:4 (f32.eq (get_global $binary/f) - ;;@ binary.ts:120:10 (f32.const 1) ) ) - ;;@ binary.ts:121:0 (set_global $binary/f - ;;@ binary.ts:121:4 (f32.add (get_global $binary/f) - ;;@ binary.ts:121:8 (f32.const 1) ) ) - ;;@ binary.ts:122:0 (set_global $binary/f - ;;@ binary.ts:122:4 (f32.sub (get_global $binary/f) - ;;@ binary.ts:122:8 (f32.const 1) ) ) - ;;@ binary.ts:123:0 (set_global $binary/f - ;;@ binary.ts:123:4 (f32.mul (get_global $binary/f) - ;;@ binary.ts:123:8 (f32.const 1) ) ) - ;;@ binary.ts:124:0 (set_global $binary/f - ;;@ binary.ts:124:4 (f32.div (get_global $binary/f) - ;;@ binary.ts:124:8 (f32.const 1) ) ) - ;;@ binary.ts:127:0 (set_global $binary/f (f32.add (get_global $binary/f) - ;;@ binary.ts:127:5 (f32.const 1) ) ) - ;;@ binary.ts:128:0 (set_global $binary/f (f32.sub (get_global $binary/f) - ;;@ binary.ts:128:5 (f32.const 1) ) ) - ;;@ binary.ts:129:0 (set_global $binary/f (f32.mul (get_global $binary/f) - ;;@ binary.ts:129:5 (f32.const 1) ) ) - ;;@ binary.ts:146:0 (set_global $binary/b - ;;@ binary.ts:146:4 (f64.lt (get_global $binary/F) - ;;@ binary.ts:146:8 (f64.const 1) ) ) - ;;@ binary.ts:147:0 (set_global $binary/b - ;;@ binary.ts:147:4 (f64.gt (get_global $binary/F) - ;;@ binary.ts:147:8 (f64.const 1) ) ) - ;;@ binary.ts:148:0 (set_global $binary/b - ;;@ binary.ts:148:4 (f64.le (get_global $binary/F) - ;;@ binary.ts:148:9 (f64.const 1) ) ) - ;;@ binary.ts:149:0 (set_global $binary/b - ;;@ binary.ts:149:4 (f64.ge (get_global $binary/F) - ;;@ binary.ts:149:9 (f64.const 1) ) ) - ;;@ binary.ts:150:0 (set_global $binary/b - ;;@ binary.ts:150:4 (f64.eq (get_global $binary/F) - ;;@ binary.ts:150:9 (f64.const 1) ) ) - ;;@ binary.ts:151:0 (set_global $binary/b - ;;@ binary.ts:151:4 (f64.eq (get_global $binary/F) - ;;@ binary.ts:151:10 (f64.const 1) ) ) - ;;@ binary.ts:152:0 (set_global $binary/F - ;;@ binary.ts:152:4 (f64.add (get_global $binary/F) - ;;@ binary.ts:152:8 (f64.const 1) ) ) - ;;@ binary.ts:153:0 (set_global $binary/F - ;;@ binary.ts:153:4 (f64.sub (get_global $binary/F) - ;;@ binary.ts:153:8 (f64.const 1) ) ) - ;;@ binary.ts:154:0 (set_global $binary/F - ;;@ binary.ts:154:4 (f64.mul (get_global $binary/F) - ;;@ binary.ts:154:8 (f64.const 1) ) ) - ;;@ binary.ts:155:0 (set_global $binary/F - ;;@ binary.ts:155:4 (f64.div (get_global $binary/F) - ;;@ binary.ts:155:8 (f64.const 1) ) ) - ;;@ binary.ts:158:0 (set_global $binary/F (f64.add (get_global $binary/F) - ;;@ binary.ts:158:5 (f64.const 1) ) ) - ;;@ binary.ts:159:0 (set_global $binary/F (f64.sub (get_global $binary/F) - ;;@ binary.ts:159:5 (f64.const 1) ) ) - ;;@ binary.ts:160:0 (set_global $binary/F (f64.mul (get_global $binary/F) - ;;@ binary.ts:160:5 (f64.const 1) ) ) (if (i32.eqz - (i32.const 2) + (tee_local $2 + (i32.const 2) + ) ) - ;;@ logical.ts:6:10 (unreachable) ) (if (f64.eq - (f64.const 2) + (tee_local $0 + (f64.const 2) + ) (f64.const 0) ) - ;;@ logical.ts:7:14 (unreachable) ) - ;;@ logical.ts:11:0 (set_global $logical/i (i32.const 2) ) - ;;@ logical.ts:12:0 (if - ;;@ logical.ts:12:7 (i32.ne (get_global $logical/i) - ;;@ logical.ts:12:12 (i32.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 12) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:14:0 (set_global $logical/i (i32.const 1) ) - ;;@ logical.ts:15:0 (if - ;;@ logical.ts:15:7 (i32.ne (get_global $logical/i) - ;;@ logical.ts:15:12 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 15) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:19:0 (set_global $logical/I (i64.const 2) ) - ;;@ logical.ts:20:0 (if - ;;@ logical.ts:20:7 (i64.ne (get_global $logical/I) - ;;@ logical.ts:20:12 (i64.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 20) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:22:0 (set_global $logical/I (i64.const 1) ) - ;;@ logical.ts:23:0 (if - ;;@ logical.ts:23:7 (i64.ne (get_global $logical/I) - ;;@ logical.ts:23:12 (i64.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 23) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:27:0 (set_global $logical/f (f32.const 2) ) - ;;@ logical.ts:28:0 (if - ;;@ logical.ts:28:7 (f32.ne (get_global $logical/f) - ;;@ logical.ts:28:12 (f32.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 28) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:30:0 (set_global $logical/f (f32.const 1) ) - ;;@ logical.ts:31:0 (if - ;;@ logical.ts:31:7 (f32.ne (get_global $logical/f) - ;;@ logical.ts:31:12 (f32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 31) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:35:0 (set_global $logical/F (f64.const 2) ) - ;;@ logical.ts:36:0 (if - ;;@ logical.ts:36:7 (f64.ne (get_global $logical/F) - ;;@ logical.ts:36:12 (f64.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 36) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ logical.ts:38:0 (set_global $logical/F (f64.const 1) ) - ;;@ logical.ts:39:0 (if - ;;@ logical.ts:39:7 (f64.ne (get_global $logical/F) - ;;@ logical.ts:39:12 (f64.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 39) + (i32.const 0) + ) + (unreachable) + ) + ) + (drop + (select + (tee_local $2 + (i32.const 1) + ) + (tee_local $4 + (i32.const 2) + ) + (i32.gt_s + (get_local $2) + (get_local $4) + ) + ) ) - ;;@ builtins.ts:16:0 (set_global $builtins/i (i32.const 31) ) - ;;@ builtins.ts:17:0 (set_global $builtins/i (i32.const 0) ) - ;;@ builtins.ts:18:0 (set_global $builtins/i (i32.const 1) ) - ;;@ builtins.ts:19:0 (set_global $builtins/i (i32.const 2) ) - ;;@ builtins.ts:20:0 (set_global $builtins/i (i32.const -2147483648) ) - ;;@ builtins.ts:21:0 (set_global $builtins/i - ;;@ builtins.ts:21:4 (select - (i32.const -42) - (i32.const 42) - (i32.const 0) + (tee_local $2 + (i32.const -42) + ) + (i32.sub + (i32.const 0) + (get_local $2) + ) + (i32.gt_s + (get_local $2) + (i32.const 0) + ) ) ) - ;;@ builtins.ts:21:19 (if - ;;@ builtins.ts:21:26 (i32.ne (get_global $builtins/i) - ;;@ builtins.ts:21:31 (i32.const 42) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 21) + (i32.const 19) + ) + (unreachable) + ) ) - ;;@ builtins.ts:22:0 (set_global $builtins/i - ;;@ builtins.ts:22:4 (select - ;;@ builtins.ts:22:13 - (i32.const 1) - ;;@ builtins.ts:22:16 + (tee_local $2 + (i32.const 1) + ) (i32.const 2) - (i32.const 0) + (i32.gt_s + (get_local $2) + (get_local $4) + ) ) ) - ;;@ builtins.ts:22:20 (if - ;;@ builtins.ts:22:27 (i32.ne (get_global $builtins/i) - ;;@ builtins.ts:22:32 (i32.const 2) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 22) + (i32.const 20) + ) + (unreachable) + ) ) - ;;@ builtins.ts:23:0 (set_global $builtins/i - (i32.const 1) + (select + (i32.const 1) + (i32.const 2) + (i32.lt_s + (get_local $2) + (get_local $4) + ) + ) ) - ;;@ builtins.ts:23:20 (if - ;;@ builtins.ts:23:27 (i32.ne (get_global $builtins/i) - ;;@ builtins.ts:23:32 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 23) + (i32.const 20) + ) + (unreachable) + ) ) - ;;@ builtins.ts:34:0 (set_global $builtins/I (i64.const 63) ) - ;;@ builtins.ts:35:0 (set_global $builtins/I (i64.const 0) ) - ;;@ builtins.ts:36:0 (set_global $builtins/I (i64.const 1) ) - ;;@ builtins.ts:37:0 (set_global $builtins/I (i64.const 2) ) - ;;@ builtins.ts:38:0 (set_global $builtins/I (i64.const -9223372036854775808) ) - ;;@ builtins.ts:39:0 (set_global $builtins/I - ;;@ builtins.ts:39:4 (select - (i64.const -42) - (i64.const 42) - (i32.const 0) + (tee_local $3 + (i64.const -42) + ) + (i64.sub + (i64.const 0) + (get_local $3) + ) + (i64.gt_s + (get_local $3) + (i64.const 0) + ) ) ) - ;;@ builtins.ts:39:19 (if - ;;@ builtins.ts:39:26 (i64.ne (get_global $builtins/I) - ;;@ builtins.ts:39:31 (i64.const 42) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 39) + (i32.const 19) + ) + (unreachable) + ) + ) + (set_global $builtins/I + (select + (tee_local $3 + (i64.const 1) + ) + (tee_local $5 + (i64.const 2) + ) + (i64.gt_s + (get_local $3) + (get_local $5) + ) + ) + ) + (if + (i64.ne + (get_global $builtins/I) + (i64.const 2) + ) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 40) + (i32.const 20) + ) + (unreachable) + ) ) - ;;@ builtins.ts:40:0 (set_global $builtins/I - ;;@ builtins.ts:40:4 (select - ;;@ builtins.ts:40:13 (i64.const 1) - ;;@ builtins.ts:40:16 (i64.const 2) - (i32.const 0) + (i64.lt_s + (get_local $3) + (get_local $5) + ) ) ) - ;;@ builtins.ts:40:20 (if - ;;@ builtins.ts:40:27 - (i64.ne - (get_global $builtins/I) - ;;@ builtins.ts:40:32 - (i64.const 2) - ) - (unreachable) - ) - ;;@ builtins.ts:41:0 - (set_global $builtins/I - (i64.const 1) - ) - ;;@ builtins.ts:41:20 - (if - ;;@ builtins.ts:41:27 (i32.ne (get_global $builtins/i) - ;;@ builtins.ts:41:32 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 41) + (i32.const 20) + ) + (unreachable) + ) ) - ;;@ builtins.ts:61:0 (set_global $builtins/f - ;;@ builtins.ts:61:4 (f32.const nan:0x400000) ) - ;;@ builtins.ts:62:0 (set_global $builtins/f - ;;@ builtins.ts:62:4 (f32.const inf) ) - ;;@ builtins.ts:63:0 (set_global $builtins/f (f32.const 1.25) ) - ;;@ builtins.ts:64:0 (set_global $builtins/f (f32.const 2) ) - ;;@ builtins.ts:65:0 (set_global $builtins/f (f32.const 1.25) ) - ;;@ builtins.ts:66:0 (set_global $builtins/f (f32.const 1) ) - ;;@ builtins.ts:67:0 (set_global $builtins/f (f32.const 2.5) ) - ;;@ builtins.ts:68:0 (set_global $builtins/f (f32.const 1.25) ) - ;;@ builtins.ts:69:0 (set_global $builtins/f (f32.const 1.25) ) - ;;@ builtins.ts:70:0 (set_global $builtins/f (f32.const 1.1180340051651) ) - ;;@ builtins.ts:71:0 (set_global $builtins/f (f32.const 1) ) - ;;@ builtins.ts:72:0 (set_global $builtins/b - ;;@ builtins.ts:72:4 (f32.ne - ;;@ builtins.ts:72:15 - (f32.const 1.25) - (f32.const 1.25) + (tee_local $1 + (f32.const 1.25) + ) + (get_local $1) ) ) - ;;@ builtins.ts:73:0 (set_global $builtins/b - (i32.const 1) + (select + (f32.ne + (f32.abs + (f32.const 1.25) + ) + (f32.const inf) + ) + (i32.const 0) + (f32.eq + (get_local $1) + (get_local $1) + ) + ) ) - ;;@ builtins.ts:93:0 (set_global $builtins/F - ;;@ builtins.ts:93:4 (f64.const nan:0x8000000000000) ) - ;;@ builtins.ts:94:0 (set_global $builtins/F - ;;@ builtins.ts:94:4 (f64.const inf) ) - ;;@ builtins.ts:95:0 (set_global $builtins/F (f64.const 1.25) ) - ;;@ builtins.ts:96:0 (set_global $builtins/F (f64.const 2) ) - ;;@ builtins.ts:97:0 (set_global $builtins/F (f64.const 1.25) ) - ;;@ builtins.ts:98:0 (set_global $builtins/F (f64.const 1) ) - ;;@ builtins.ts:99:0 (set_global $builtins/F (f64.const 2.5) ) - ;;@ builtins.ts:100:0 (set_global $builtins/F (f64.const 1.25) ) - ;;@ builtins.ts:101:0 (set_global $builtins/F (f64.const 1) ) - ;;@ builtins.ts:102:0 (set_global $builtins/F (f64.const 1.118033988749895) ) - ;;@ builtins.ts:103:0 (set_global $builtins/F (f64.const 1) ) - ;;@ builtins.ts:104:0 (set_global $builtins/b - ;;@ builtins.ts:104:4 (f64.ne - ;;@ builtins.ts:104:15 - (f64.const 1.25) - (f64.const 1.25) + (tee_local $0 + (f64.const 1.25) + ) + (get_local $0) ) ) - ;;@ builtins.ts:105:0 (set_global $builtins/b - (i32.const 1) + (select + (f64.ne + (f64.abs + (f64.const 1.25) + ) + (f64.const inf) + ) + (i32.const 0) + (f64.eq + (get_local $0) + (get_local $0) + ) + ) ) - ;;@ builtins.ts:109:0 (set_global $builtins/i - ;;@ builtins.ts:109:4 (i32.load - ;;@ builtins.ts:109:14 (i32.const 8) ) ) - ;;@ builtins.ts:109:18 (i32.store - ;;@ builtins.ts:109:29 (i32.const 8) - ;;@ builtins.ts:109:32 (get_global $builtins/i) ) - ;;@ builtins.ts:110:0 (i32.store - ;;@ builtins.ts:110:11 (i32.const 8) - ;;@ builtins.ts:110:14 (i32.load - ;;@ builtins.ts:110:24 (i32.const 8) ) ) - ;;@ builtins.ts:111:0 (set_global $builtins/I - ;;@ builtins.ts:111:4 (i64.load - ;;@ builtins.ts:111:14 (i32.const 8) ) ) - ;;@ builtins.ts:111:18 (i64.store - ;;@ builtins.ts:111:29 (i32.const 8) - ;;@ builtins.ts:111:32 (get_global $builtins/I) ) - ;;@ builtins.ts:112:0 (i64.store - ;;@ builtins.ts:112:11 (i32.const 8) - ;;@ builtins.ts:112:14 (i64.load - ;;@ builtins.ts:112:24 (i32.const 8) ) ) - ;;@ builtins.ts:113:0 (set_global $builtins/f - ;;@ builtins.ts:113:4 (f32.load - ;;@ builtins.ts:113:14 (i32.const 8) ) ) - ;;@ builtins.ts:113:18 (f32.store - ;;@ builtins.ts:113:29 (i32.const 8) - ;;@ builtins.ts:113:32 (get_global $builtins/f) ) - ;;@ builtins.ts:114:0 (f32.store - ;;@ builtins.ts:114:11 (i32.const 8) - ;;@ builtins.ts:114:14 (f32.load - ;;@ builtins.ts:114:24 (i32.const 8) ) ) - ;;@ builtins.ts:115:0 (set_global $builtins/F - ;;@ builtins.ts:115:4 (f64.load - ;;@ builtins.ts:115:14 (i32.const 8) ) ) - ;;@ builtins.ts:115:18 (f64.store - ;;@ builtins.ts:115:29 (i32.const 8) - ;;@ builtins.ts:115:32 (get_global $builtins/F) ) - ;;@ builtins.ts:116:0 (f64.store - ;;@ builtins.ts:116:11 (i32.const 8) - ;;@ builtins.ts:116:14 (f64.load - ;;@ builtins.ts:116:24 (i32.const 8) ) ) - ;;@ builtins.ts:119:0 (set_global $builtins/i - ;;@ builtins.ts:119:4 (i32.load - ;;@ builtins.ts:119:14 (i32.const 8) ) ) - ;;@ builtins.ts:119:34 (i32.store - ;;@ builtins.ts:119:45 (i32.const 8) - ;;@ builtins.ts:119:48 (get_global $builtins/i) ) - ;;@ builtins.ts:120:0 (i32.store - ;;@ builtins.ts:120:11 (i32.const 8) - ;;@ builtins.ts:120:14 (i32.load - ;;@ builtins.ts:120:24 (i32.const 8) ) ) - ;;@ builtins.ts:121:0 (set_global $builtins/I - ;;@ builtins.ts:121:4 (i64.load - ;;@ builtins.ts:121:14 (i32.const 8) ) ) - ;;@ builtins.ts:121:34 (i64.store - ;;@ builtins.ts:121:45 (i32.const 8) - ;;@ builtins.ts:121:48 (get_global $builtins/I) ) - ;;@ builtins.ts:122:0 (i64.store - ;;@ builtins.ts:122:11 (i32.const 8) - ;;@ builtins.ts:122:14 (i64.load - ;;@ builtins.ts:122:24 (i32.const 8) ) ) - ;;@ builtins.ts:123:0 (set_global $builtins/f - ;;@ builtins.ts:123:4 (f32.load - ;;@ builtins.ts:123:14 (i32.const 8) ) ) - ;;@ builtins.ts:123:34 (f32.store - ;;@ builtins.ts:123:45 (i32.const 8) - ;;@ builtins.ts:123:48 (get_global $builtins/f) ) - ;;@ builtins.ts:124:0 (f32.store - ;;@ builtins.ts:124:11 (i32.const 8) - ;;@ builtins.ts:124:14 (f32.load - ;;@ builtins.ts:124:24 (i32.const 8) ) ) - ;;@ builtins.ts:125:0 (set_global $builtins/F - ;;@ builtins.ts:125:4 (f64.load - ;;@ builtins.ts:125:14 (i32.const 8) ) ) - ;;@ builtins.ts:125:34 (f64.store - ;;@ builtins.ts:125:45 (i32.const 8) - ;;@ builtins.ts:125:48 (get_global $builtins/F) ) - ;;@ builtins.ts:126:0 (f64.store - ;;@ builtins.ts:126:11 (i32.const 8) - ;;@ builtins.ts:126:14 (f64.load - ;;@ builtins.ts:126:24 (i32.const 8) ) ) - ;;@ builtins.ts:130:0 (set_global $builtins/i - ;;@ builtins.ts:130:4 (i32.load8_s - ;;@ builtins.ts:130:13 (i32.const 8) ) ) - ;;@ builtins.ts:131:0 (set_global $builtins/i - ;;@ builtins.ts:131:4 (i32.load16_s - ;;@ builtins.ts:131:14 (i32.const 8) ) ) - ;;@ builtins.ts:132:0 (set_global $builtins/i - ;;@ builtins.ts:132:4 (i32.load - ;;@ builtins.ts:132:14 (i32.const 8) ) ) - ;;@ builtins.ts:134:0 (set_global $builtins/i - ;;@ builtins.ts:134:4 (i32.load8_u - ;;@ builtins.ts:134:13 (i32.const 8) ) ) - ;;@ builtins.ts:135:0 (set_global $builtins/i - ;;@ builtins.ts:135:4 (i32.load16_u - ;;@ builtins.ts:135:14 (i32.const 8) ) ) - ;;@ builtins.ts:136:0 (set_global $builtins/i - ;;@ builtins.ts:136:4 (i32.load - ;;@ builtins.ts:136:14 (i32.const 8) ) ) - ;;@ builtins.ts:139:0 (set_global $builtins/u - ;;@ builtins.ts:139:4 (i32.load8_u - ;;@ builtins.ts:139:13 (i32.const 8) ) ) - ;;@ builtins.ts:140:0 (set_global $builtins/u - ;;@ builtins.ts:140:4 (i32.load16_u - ;;@ builtins.ts:140:14 (i32.const 8) ) ) - ;;@ builtins.ts:141:0 (set_global $builtins/u - ;;@ builtins.ts:141:4 (i32.load - ;;@ builtins.ts:141:14 (i32.const 8) ) ) - ;;@ builtins.ts:143:0 (set_global $builtins/u - ;;@ builtins.ts:143:4 (i32.load8_s - ;;@ builtins.ts:143:13 (i32.const 8) ) ) - ;;@ builtins.ts:144:0 (set_global $builtins/u - ;;@ builtins.ts:144:4 (i32.load16_s - ;;@ builtins.ts:144:14 (i32.const 8) ) ) - ;;@ builtins.ts:145:0 (set_global $builtins/u - ;;@ builtins.ts:145:4 (i32.load - ;;@ builtins.ts:145:14 (i32.const 8) ) ) - ;;@ builtins.ts:147:0 (set_global $builtins/I - ;;@ builtins.ts:147:4 (i64.load8_s - ;;@ builtins.ts:147:13 (i32.const 8) ) ) - ;;@ builtins.ts:148:0 (set_global $builtins/I - ;;@ builtins.ts:148:4 (i64.load16_s - ;;@ builtins.ts:148:14 (i32.const 8) ) ) - ;;@ builtins.ts:149:0 (set_global $builtins/I - ;;@ builtins.ts:149:4 (i64.load32_s - ;;@ builtins.ts:149:14 (i32.const 8) ) ) - ;;@ builtins.ts:150:0 (set_global $builtins/I - ;;@ builtins.ts:150:4 (i64.load - ;;@ builtins.ts:150:14 (i32.const 8) ) ) - ;;@ builtins.ts:153:0 (set_global $builtins/U - ;;@ builtins.ts:153:4 (i64.load8_u - ;;@ builtins.ts:153:13 (i32.const 8) ) ) - ;;@ builtins.ts:154:0 (set_global $builtins/U - ;;@ builtins.ts:154:4 (i64.load16_u - ;;@ builtins.ts:154:14 (i32.const 8) ) ) - ;;@ builtins.ts:155:0 (set_global $builtins/U - ;;@ builtins.ts:155:4 (i64.load32_u - ;;@ builtins.ts:155:14 (i32.const 8) ) ) - ;;@ builtins.ts:156:0 (set_global $builtins/U - ;;@ builtins.ts:156:4 (i64.load - ;;@ builtins.ts:156:14 (i32.const 8) ) ) - ;;@ builtins.ts:158:0 (i32.store8 - ;;@ builtins.ts:158:10 (i32.const 8) - ;;@ builtins.ts:158:13 (i32.const 1) ) - ;;@ builtins.ts:159:0 (i32.store16 - ;;@ builtins.ts:159:11 (i32.const 8) - ;;@ builtins.ts:159:14 (i32.const 1) ) - ;;@ builtins.ts:160:0 (i32.store - ;;@ builtins.ts:160:11 (i32.const 8) - ;;@ builtins.ts:160:14 (i32.const 1) ) - ;;@ builtins.ts:162:0 (i64.store8 - ;;@ builtins.ts:162:10 (i32.const 8) - ;;@ builtins.ts:162:13 (i64.const 1) ) - ;;@ builtins.ts:163:0 (i64.store16 - ;;@ builtins.ts:163:11 (i32.const 8) - ;;@ builtins.ts:163:14 (i64.const 1) ) - ;;@ builtins.ts:164:0 (i64.store32 - ;;@ builtins.ts:164:11 (i32.const 8) - ;;@ builtins.ts:164:14 (i64.const 1) ) - ;;@ builtins.ts:165:0 (i64.store - ;;@ builtins.ts:165:11 (i32.const 8) - ;;@ builtins.ts:165:14 (i64.const 1) ) - ;;@ builtins.ts:167:0 (i64.store - ;;@ builtins.ts:167:11 (i32.const 8) (i64.const 1) ) - ;;@ builtins.ts:176:0 (set_global $builtins/i (i32.const 1067450368) ) - ;;@ builtins.ts:177:0 (set_global $builtins/f (f32.const 3.5032461608120427e-44) ) - ;;@ builtins.ts:178:0 (set_global $builtins/I (i64.const 4608308318706860032) ) - ;;@ builtins.ts:179:0 (set_global $builtins/F (f64.const 1.24e-322) ) - ;;@ builtins.ts:185:0 (drop (current_memory) ) - ;;@ builtins.ts:186:0 (drop (grow_memory - ;;@ builtins.ts:186:12 (i32.const 1) ) ) - ;;@ builtins.ts:188:0 (set_global $builtins/s - ;;@ builtins.ts:188:4 (current_memory) ) - ;;@ builtins.ts:189:0 (set_global $builtins/s - ;;@ builtins.ts:189:4 (grow_memory - ;;@ builtins.ts:189:16 (i32.const 1) ) ) - ;;@ builtins.ts:198:0 (set_global $builtins/i (i32.const 10) ) - ;;@ builtins.ts:199:0 (set_global $builtins/I (i64.const 200) ) - ;;@ builtins.ts:200:0 (set_global $builtins/f (f32.const 1.25) ) - ;;@ builtins.ts:201:0 (set_global $builtins/F (f64.const 25) ) - ;;@ builtins.ts:222:0 (if - ;;@ builtins.ts:222:7 (f32.eq - ;;@ builtins.ts:222:18 - (f32.const nan:0x400000) - (f32.const nan:0x400000) + (tee_local $1 + (f32.const nan:0x400000) + ) + (get_local $1) + ) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 222) + (i32.const 0) + ) + (unreachable) ) - (unreachable) ) - ;;@ builtins.ts:223:0 (if - ;;@ builtins.ts:223:7 (f64.eq - ;;@ builtins.ts:223:18 - (f64.const nan:0x8000000000000) - (f64.const nan:0x8000000000000) + (tee_local $0 + (f64.const nan:0x8000000000000) + ) + (get_local $0) + ) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 223) + (i32.const 0) + ) + (unreachable) ) - (unreachable) ) - ;;@ builtins.ts:224:0 (if - ;;@ builtins.ts:224:8 (select (f32.ne (f32.abs - ;;@ builtins.ts:224:22 - (f32.const nan:0x400000) + (tee_local $1 + (f32.const nan:0x400000) + ) ) (f32.const inf) ) (i32.const 0) - (i32.const 0) + (f32.eq + (get_local $1) + (get_local $1) + ) + ) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 224) + (i32.const 0) + ) + (unreachable) ) - (unreachable) ) - ;;@ builtins.ts:225:0 (if - ;;@ builtins.ts:225:8 (select (f32.ne (f32.abs - ;;@ builtins.ts:225:22 - (f32.const inf) + (tee_local $1 + (f32.const inf) + ) ) (f32.const inf) ) (i32.const 0) - (i32.const 1) + (f32.eq + (get_local $1) + (get_local $1) + ) + ) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 225) + (i32.const 0) + ) + (unreachable) ) - (unreachable) ) - ;;@ builtins.ts:226:0 (if - ;;@ builtins.ts:226:8 (select (f64.ne (f64.abs - ;;@ builtins.ts:226:22 - (f64.const nan:0x8000000000000) + (tee_local $0 + (f64.const nan:0x8000000000000) + ) ) (f64.const inf) ) (i32.const 0) - (i32.const 0) + (f64.eq + (get_local $0) + (get_local $0) + ) + ) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 226) + (i32.const 0) + ) + (unreachable) ) - (unreachable) ) - ;;@ builtins.ts:227:0 (if - ;;@ builtins.ts:227:8 (select (f64.ne (f64.abs - ;;@ builtins.ts:227:22 - (f64.const inf) + (tee_local $0 + (f64.const inf) + ) ) (f64.const inf) ) (i32.const 0) - (i32.const 1) + (f64.eq + (get_local $0) + (get_local $0) + ) + ) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 227) + (i32.const 0) + ) + (unreachable) ) - (unreachable) ) - ;;@ builtins.ts:228:0 (if (i32.eqz - ;;@ builtins.ts:228:7 (select (f32.ne (f32.abs - ;;@ builtins.ts:228:21 - (f32.const 0) + (tee_local $1 + (f32.const 0) + ) ) (f32.const inf) ) (i32.const 0) - (i32.const 1) + (f32.eq + (get_local $1) + (get_local $1) + ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 228) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ builtins.ts:229:0 (if (i32.eqz - ;;@ builtins.ts:229:7 (select (f64.ne (f64.abs - ;;@ builtins.ts:229:21 - (f64.const 0) + (tee_local $0 + (f64.const 0) + ) ) (f64.const inf) ) (i32.const 0) - (i32.const 1) + (f64.eq + (get_local $0) + (get_local $0) + ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 229) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ showcase.ts:42:0 (if - ;;@ showcase.ts:42:7 (i32.ne - (tee_local $0 - ;;@ showcase.ts:42:38 + (call $showcase/ANamespace.aNamespacedFunction (get_global $showcase/ANamespace.aNamespacedGlobal) ) - ;;@ showcase.ts:42:71 (i32.const 42) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 42) + (i32.const 0) + ) + (unreachable) + ) ) (set_global $showcase/AnEnum.FORTYTWO - ;;@ showcase.ts:51:13 (get_global $showcase/aMutableGlobal) ) (set_global $showcase/AnEnum.FORTYTHREE @@ -5304,473 +4297,546 @@ (i32.const 1) ) ) - ;;@ showcase.ts:58:0 (if - ;;@ showcase.ts:58:7 (i32.ne (get_global $showcase/AnEnum.FORTYTWO) - ;;@ showcase.ts:58:26 (i32.const 42) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 58) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ showcase.ts:59:0 (if - ;;@ showcase.ts:59:7 (i32.ne (get_global $showcase/AnEnum.FORTYTHREE) - ;;@ showcase.ts:59:28 (i32.const 43) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 59) + (i32.const 0) + ) + (unreachable) + ) + ) + (drop + (call $showcase/addGeneric + (i32.const 1) + (i32.const 2) + ) + ) + (drop + (call $showcase/addGeneric + (f32.const 1) + (f32.const 2) + ) + ) + (drop + (call $showcase/addGeneric + (f64.const 1) + (f64.const 2) + ) ) - ;;@ memcpy.ts:144:0 (i64.store - ;;@ memcpy.ts:144:11 (i32.const 8) - ;;@ memcpy.ts:144:22 (i64.const 1229782938247303441) ) - ;;@ memcpy.ts:145:0 (i64.store - ;;@ memcpy.ts:145:18 (i32.const 16) - ;;@ memcpy.ts:145:22 (i64.const 2459565876494606882) ) - ;;@ memcpy.ts:146:0 (i64.store - ;;@ memcpy.ts:146:18 (i32.const 24) - ;;@ memcpy.ts:146:22 (i64.const 3689348814741910323) ) - ;;@ memcpy.ts:147:0 (i64.store - ;;@ memcpy.ts:147:18 (i32.const 32) - ;;@ memcpy.ts:147:22 (i64.const 4919131752989213764) ) - ;;@ memcpy.ts:150:0 (set_global $memcpy/dest - ;;@ memcpy.ts:150:7 (call $memcpy/memcpy - ;;@ memcpy.ts:150:21 (i32.const 9) - ;;@ memcpy.ts:150:31 (i32.const 24) - ;;@ memcpy.ts:150:35 (i32.const 4) ) ) - ;;@ memcpy.ts:151:0 (if - ;;@ memcpy.ts:151:7 (i32.ne (get_global $memcpy/dest) - ;;@ memcpy.ts:151:22 (i32.const 9) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 151) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:152:0 (if - ;;@ memcpy.ts:152:7 (i64.ne (i64.load - ;;@ memcpy.ts:152:17 (i32.const 8) ) - ;;@ memcpy.ts:152:26 (i64.const 1229783084848853777) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 152) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:154:0 (set_global $memcpy/dest - ;;@ memcpy.ts:154:7 (call $memcpy/memcpy - ;;@ memcpy.ts:154:14 (i32.const 8) - ;;@ memcpy.ts:154:20 (i32.const 8) - ;;@ memcpy.ts:154:26 (i32.const 32) ) ) - ;;@ memcpy.ts:155:0 (if - ;;@ memcpy.ts:155:7 (i32.ne (get_global $memcpy/dest) - ;;@ memcpy.ts:155:15 (i32.const 8) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 155) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:156:0 (if - ;;@ memcpy.ts:156:7 (i64.ne (i64.load - ;;@ memcpy.ts:156:17 (i32.const 8) ) - ;;@ memcpy.ts:156:26 (i64.const 1229783084848853777) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 156) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:157:0 (if - ;;@ memcpy.ts:157:7 (i64.ne (i64.load - ;;@ memcpy.ts:157:24 (i32.const 16) ) - ;;@ memcpy.ts:157:30 (i64.const 2459565876494606882) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 157) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:158:0 (if - ;;@ memcpy.ts:158:7 (i64.ne (i64.load - ;;@ memcpy.ts:158:24 (i32.const 24) ) - ;;@ memcpy.ts:158:31 (i64.const 3689348814741910323) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 158) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:159:0 (if - ;;@ memcpy.ts:159:7 (i64.ne (i64.load - ;;@ memcpy.ts:159:24 (i32.const 32) ) - ;;@ memcpy.ts:159:31 (i64.const 4919131752989213764) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 159) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:161:0 (set_global $memcpy/dest - ;;@ memcpy.ts:161:7 (call $memcpy/memcpy - ;;@ memcpy.ts:161:21 (i32.const 13) - ;;@ memcpy.ts:161:31 (i32.const 36) - ;;@ memcpy.ts:161:35 (i32.const 3) ) ) - ;;@ memcpy.ts:162:0 (if - ;;@ memcpy.ts:162:7 (i64.ne (i64.load - ;;@ memcpy.ts:162:17 (i32.const 8) ) - ;;@ memcpy.ts:162:26 (i64.const 4919131679688438545) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 162) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:164:0 (set_global $memcpy/dest - ;;@ memcpy.ts:164:7 (call $memcpy/memcpy - ;;@ memcpy.ts:164:21 (i32.const 16) - ;;@ memcpy.ts:164:31 (i32.const 24) - ;;@ memcpy.ts:164:35 (i32.const 15) ) ) - ;;@ memcpy.ts:165:0 (if - ;;@ memcpy.ts:165:7 (i64.ne (i64.load - ;;@ memcpy.ts:165:17 (i32.const 8) ) - ;;@ memcpy.ts:165:26 (i64.const 4919131679688438545) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 165) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:166:0 (if - ;;@ memcpy.ts:166:7 (i64.ne (i64.load - ;;@ memcpy.ts:166:24 (i32.const 16) ) - ;;@ memcpy.ts:166:30 (i64.const 3689348814741910323) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 166) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:167:0 (if - ;;@ memcpy.ts:167:7 (i64.ne (i64.load - ;;@ memcpy.ts:167:24 (i32.const 24) ) - ;;@ memcpy.ts:167:31 (i64.const 3694152654344438852) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 167) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ memcpy.ts:168:0 (if - ;;@ memcpy.ts:168:7 (i64.ne (i64.load - ;;@ memcpy.ts:168:24 (i32.const 32) ) - ;;@ memcpy.ts:168:31 (i64.const 4919131752989213764) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 168) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:65:0 (if - ;;@ fmod.ts:65:7 (f64.eq - (tee_local $2 - ;;@ fmod.ts:65:18 + (tee_local $0 (call $fmod/fmod - ;;@ fmod.ts:65:23 (f64.const 1) - ;;@ fmod.ts:65:26 (f64.const nan:0x8000000000000) ) ) - (get_local $2) + (get_local $0) + ) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 65) + (i32.const 0) + ) + (unreachable) ) - (unreachable) ) - ;;@ fmod.ts:66:0 (if - ;;@ fmod.ts:66:7 (f64.ne (call $fmod/fmod - ;;@ fmod.ts:66:12 (f64.const 1.5) - ;;@ fmod.ts:66:17 (f64.const 1) ) - ;;@ fmod.ts:66:25 (f64.const 0.5) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 66) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:67:0 (if (i32.eqz - ;;@ fmod.ts:67:7 (f64.lt (f64.sub (call $fmod/fmod - ;;@ fmod.ts:67:12 (f64.const 9.2) - ;;@ fmod.ts:67:17 (f64.const 2) ) - ;;@ fmod.ts:67:24 (f64.const 1.2) ) - ;;@ fmod.ts:67:30 (f64.const 2.220446049250313e-16) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 67) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:68:0 (if (i32.eqz - ;;@ fmod.ts:68:7 (f64.lt (f64.sub (call $fmod/fmod - ;;@ fmod.ts:68:12 (f64.const 9.2) - ;;@ fmod.ts:68:17 (f64.const 3.7) ) - ;;@ fmod.ts:68:24 (f64.const 1.8) ) - ;;@ fmod.ts:68:30 (f64.const 2.220446049250313e-16) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 68) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:134:0 (if - ;;@ fmod.ts:134:7 (f32.eq (tee_local $1 - ;;@ fmod.ts:134:18 (call $fmod/fmodf - ;;@ fmod.ts:134:24 (f32.const 1) - ;;@ fmod.ts:134:27 (f32.const nan:0x400000) ) ) (get_local $1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 134) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:135:0 (if - ;;@ fmod.ts:135:7 (f32.ne (call $fmod/fmodf - ;;@ fmod.ts:135:13 (f32.const 1.5) - ;;@ fmod.ts:135:18 (f32.const 1) ) - ;;@ fmod.ts:135:26 (f32.const 0.5) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 135) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:136:0 (if (i32.eqz - ;;@ fmod.ts:136:7 (f32.lt (f32.sub (call $fmod/fmodf - ;;@ fmod.ts:136:13 (f32.const 9.199999809265137) - ;;@ fmod.ts:136:18 (f32.const 2) ) - ;;@ fmod.ts:136:25 (f32.const 1.2000000476837158) ) - ;;@ fmod.ts:136:31 (f32.const 1.1920928955078125e-07) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 136) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ fmod.ts:137:0 (if (i32.eqz - ;;@ fmod.ts:137:7 (f32.lt (f32.sub (call $fmod/fmodf - ;;@ fmod.ts:137:13 (f32.const 9.199999809265137) - ;;@ fmod.ts:137:18 (f32.const 3.700000047683716) ) - ;;@ fmod.ts:137:25 (f32.const 1.7999999523162842) ) - ;;@ fmod.ts:137:31 (f32.const 1.1920928955078125e-07) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 137) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ showcase.ts:102:0 (i32.store (get_global $showcase/aClassInstance) - ;;@ showcase.ts:102:24 (i32.const 42) ) - ;;@ showcase.ts:103:0 (f32.store offset=4 (get_global $showcase/aClassInstance) - ;;@ showcase.ts:103:30 (f32.const 9e3) ) - ;;@ showcase.ts:104:0 (if - ;;@ showcase.ts:104:7 (i32.ne (i32.load - ;;@ showcase.ts:104:17 (i32.const 8) ) - ;;@ showcase.ts:104:23 (i32.const 42) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 104) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ showcase.ts:105:0 (if - ;;@ showcase.ts:105:7 (f32.ne (f32.load - ;;@ showcase.ts:105:17 (i32.const 12) ) - ;;@ showcase.ts:105:24 (f32.const 9e3) ) - (unreachable) - ) - (f32.store offset=4 - (tee_local $0 - ;;@ showcase.ts:107:0 - (get_global $showcase/aClassInstance) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 105) + (i32.const 0) + ) + (unreachable) ) + ) + (call $showcase/ADerivedClass#set:aWildAccessorAppears + (get_global $showcase/aClassInstance) (f32.const 123) ) - ;;@ showcase.ts:108:0 (if - ;;@ showcase.ts:108:7 (f32.ne - (f32.load offset=4 - (tee_local $0 - (get_global $showcase/aClassInstance) - ) + (call $showcase/ADerivedClass#get:aWildAccessorAppears + (get_global $showcase/aClassInstance) ) - ;;@ showcase.ts:108:46 (f32.const 123) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 108) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ showcase.ts:110:0 (set_global $showcase/AClass.aStaticField - ;;@ showcase.ts:110:22 (get_global $showcase/aClassInstance) ) - ;;@ showcase.ts:111:0 (if - ;;@ showcase.ts:111:7 (i32.ne (get_global $showcase/AClass.aStaticField) - ;;@ showcase.ts:111:37 (get_global $showcase/aClassInstance) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 111) + (i32.const 0) + ) + (unreachable) + ) ) ) ) diff --git a/tests/compiler/showcase.wast b/tests/compiler/showcase.wast index b14dc28a..e4b36361 100644 --- a/tests/compiler/showcase.wast +++ b/tests/compiler/showcase.wast @@ -1,4 +1,5 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $i (func (result i32))) (type $ii (func (param i32) (result i32))) (type $iii (func (param i32 i32) (result i32))) @@ -8,6 +9,7 @@ (type $iiii (func (param i32 i32 i32) (result i32))) (type $ifv (func (param i32 f32))) (type $if (func (param i32) (result f32))) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $showcase/aConstantGlobal i32 (i32.const 42)) (global $showcase/anExportedConstantGlobal f32 (f32.const 42)) (global $showcase/aMutableGlobal (mut i32) (i32.const 42)) @@ -76,8 +78,13 @@ (global $memcpy/dest (mut i32) (i32.const 0)) (global $showcase/aClassInstance (mut i32) (i32.const 8)) (global $showcase/AClass.aStaticField (mut i32) (i32.const 0)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 140)) (memory $0 1) + (data (i32.const 8) "\n\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s\00") + (data (i32.const 32) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s\00") + (data (i32.const 64) "\0b\00\00\00s\00h\00o\00w\00c\00a\00s\00e\00.\00t\00s\00") + (data (i32.const 96) "\t\00\00\00m\00e\00m\00c\00p\00y\00.\00t\00s\00") + (data (i32.const 120) "\07\00\00\00f\00m\00o\00d\00.\00t\00s\00") (export "anExportedConstantGlobal" (global $showcase/anExportedConstantGlobal)) (export "aConstantGlobal" (global $showcase/aConstantGlobal)) (export "anAliasedConstantGlobal" (global $showcase/anExportedConstantGlobal)) @@ -88,13 +95,13 @@ (export "anExportedFunction" (func $showcase/anExportedFunction)) (export "memory" (memory $0)) (start $start) - (func $showcase/ANamespace.aNamespacedFunction (; 0 ;) (type $ii) (param $0 i32) (result i32) + (func $showcase/ANamespace.aNamespacedFunction (; 1 ;) (type $ii) (param $0 i32) (result i32) ;;@ showcase.ts:38:60 (return (get_local $0) ) ) - (func $showcase/addGeneric (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $showcase/addGeneric (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) ;;@ showcase.ts:64:16 (return ;;@ showcase.ts:64:9 @@ -105,7 +112,7 @@ ) ) ) - (func $showcase/addGeneric (; 2 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) + (func $showcase/addGeneric (; 3 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) ;;@ showcase.ts:64:16 (return ;;@ showcase.ts:64:9 @@ -116,7 +123,7 @@ ) ) ) - (func $showcase/addGeneric (; 3 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) + (func $showcase/addGeneric (; 4 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) ;;@ showcase.ts:64:16 (return ;;@ showcase.ts:64:9 @@ -127,9 +134,9 @@ ) ) ) - (func $showcase/anExportedFunction (; 4 ;) (type $v) + (func $showcase/anExportedFunction (; 5 ;) (type $v) ) - (func $memcpy/memcpy (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $memcpy/memcpy (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2386,7 +2393,7 @@ (get_local $3) ) ) - (func $fmod/fmod (; 6 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) + (func $fmod/fmod (; 7 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i32) @@ -3025,7 +3032,7 @@ ) ) ) - (func $fmod/fmodf (; 7 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) + (func $fmod/fmodf (; 8 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3644,7 +3651,7 @@ ) ) ) - (func $showcase/ADerivedClass#set:aWildAccessorAppears (; 8 ;) (type $ifv) (param $0 i32) (param $1 f32) + (func $showcase/ADerivedClass#set:aWildAccessorAppears (; 9 ;) (type $ifv) (param $0 i32) (param $1 f32) ;;@ showcase.ts:99:39 (f32.store offset=4 (get_local $0) @@ -3652,7 +3659,7 @@ (get_local $1) ) ) - (func $showcase/ADerivedClass#get:aWildAccessorAppears (; 9 ;) (type $if) (param $0 i32) (result f32) + (func $showcase/ADerivedClass#get:aWildAccessorAppears (; 10 ;) (type $if) (param $0 i32) (result f32) ;;@ showcase.ts:98:48 (return ;;@ showcase.ts:98:43 @@ -3661,7 +3668,7 @@ ) ) ) - (func $start (; 10 ;) (type $v) + (func $start (; 11 ;) (type $v) (local $0 i32) (local $1 i64) (local $2 f32) @@ -5633,7 +5640,15 @@ (i32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 12) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:14:0 (set_global $logical/i @@ -5658,7 +5673,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 15) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:19:0 (set_global $logical/I @@ -5683,7 +5706,15 @@ (i64.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 20) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:22:0 (set_global $logical/I @@ -5708,7 +5739,15 @@ (i64.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 23) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:27:0 (set_global $logical/f @@ -5733,7 +5772,15 @@ (f32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 28) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:30:0 (set_global $logical/f @@ -5758,7 +5805,15 @@ (f32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 31) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:35:0 (set_global $logical/F @@ -5783,7 +5838,15 @@ (f64.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 36) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ logical.ts:38:0 (set_global $logical/F @@ -5808,7 +5871,15 @@ (f64.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 39) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:7:0 (drop @@ -5980,7 +6051,15 @@ (i32.const 42) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 21) + (i32.const 19) + ) + (unreachable) + ) ) ;;@ builtins.ts:22:0 (set_global $builtins/i @@ -6010,7 +6089,15 @@ (i32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 22) + (i32.const 20) + ) + (unreachable) + ) ) ;;@ builtins.ts:23:0 (set_global $builtins/i @@ -6040,7 +6127,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 23) + (i32.const 20) + ) + (unreachable) + ) ) ;;@ builtins.ts:27:0 (drop @@ -6178,7 +6273,15 @@ (i64.const 42) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 39) + (i32.const 19) + ) + (unreachable) + ) ) ;;@ builtins.ts:40:0 (set_global $builtins/I @@ -6208,7 +6311,15 @@ (i64.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 40) + (i32.const 20) + ) + (unreachable) + ) ) ;;@ builtins.ts:41:0 (set_global $builtins/I @@ -6238,7 +6349,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 41) + (i32.const 20) + ) + (unreachable) + ) ) ;;@ builtins.ts:47:0 (drop @@ -7365,7 +7484,15 @@ (f64.const nan:0x8000000000000) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 221) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:222:0 (if @@ -7379,7 +7506,15 @@ (get_local $2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 222) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:223:0 (if @@ -7393,7 +7528,15 @@ (get_local $3) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 223) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:224:0 (if @@ -7419,7 +7562,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 224) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:225:0 (if @@ -7445,7 +7596,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 225) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:226:0 (if @@ -7471,7 +7630,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 226) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:227:0 (if @@ -7497,7 +7664,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 227) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:228:0 (if @@ -7520,7 +7695,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 228) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:229:0 (if @@ -7543,7 +7726,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 229) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:242:0 (if @@ -7555,7 +7746,15 @@ (i32.const -128) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 242) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:243:0 (if @@ -7567,7 +7766,15 @@ (i32.const 127) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 243) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:244:0 (if @@ -7579,7 +7786,15 @@ (i32.const -32768) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 244) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:245:0 (if @@ -7591,7 +7806,15 @@ (i32.const 32767) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 245) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:246:0 (if @@ -7603,7 +7826,15 @@ (i32.const -2147483648) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 246) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:247:0 (if @@ -7615,7 +7846,15 @@ (i32.const 2147483647) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 247) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:248:0 (if @@ -7627,7 +7866,15 @@ (i64.const -9223372036854775808) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 248) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:249:0 (if @@ -7639,7 +7886,15 @@ (i64.const 9223372036854775807) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 249) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:251:0 (if @@ -7651,7 +7906,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 251) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:252:0 (if @@ -7663,7 +7926,15 @@ (i32.const 255) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 252) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:253:0 (if @@ -7675,7 +7946,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 253) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:254:0 (if @@ -7687,7 +7966,15 @@ (i32.const 65535) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 254) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:255:0 (if @@ -7699,7 +7986,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 255) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:256:0 (if @@ -7711,7 +8006,15 @@ (i32.const -1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 256) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:257:0 (if @@ -7723,7 +8026,15 @@ (i64.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 257) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:258:0 (if @@ -7735,7 +8046,15 @@ (i64.const -1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 258) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:259:0 (if @@ -7747,7 +8066,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 259) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:259:29 (if @@ -7759,7 +8086,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 259) + (i32.const 29) + ) + (unreachable) + ) ) ;;@ builtins.ts:260:0 (if @@ -7771,7 +8106,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 260) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:260:29 (if @@ -7783,7 +8126,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 260) + (i32.const 29) + ) + (unreachable) + ) ) ;;@ builtins.ts:262:0 (if @@ -7798,7 +8149,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 262) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:263:0 (if @@ -7810,7 +8169,15 @@ (f32.const 3402823466385288598117041e14) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 263) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:264:0 (if @@ -7825,7 +8192,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 264) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:265:0 (if @@ -7837,7 +8212,15 @@ (f32.const 16777215) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 265) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:266:0 (if @@ -7849,7 +8232,15 @@ (f32.const 1.1920928955078125e-07) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 266) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:267:0 (if @@ -7864,7 +8255,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 267) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:268:0 (if @@ -7876,7 +8275,15 @@ (f64.const 1797693134862315708145274e284) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 268) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:269:0 (if @@ -7891,7 +8298,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 269) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:270:0 (if @@ -7903,7 +8318,15 @@ (f64.const 9007199254740991) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 270) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ builtins.ts:271:0 (if @@ -7915,7 +8338,15 @@ (f64.const 2.220446049250313e-16) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 32) + (i32.const 271) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ showcase.ts:42:0 (if @@ -7931,7 +8362,15 @@ (i32.const 42) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 42) + (i32.const 0) + ) + (unreachable) + ) ) (set_global $showcase/AnEnum.FORTYTWO ;;@ showcase.ts:51:13 @@ -7953,7 +8392,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 54) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ showcase.ts:55:0 (if @@ -7965,7 +8412,15 @@ (i32.const 2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 55) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ showcase.ts:56:0 (if @@ -7977,7 +8432,15 @@ (i32.const 4) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 56) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ showcase.ts:57:0 (if @@ -7989,7 +8452,15 @@ (i32.const 5) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 57) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ showcase.ts:58:0 (if @@ -8001,7 +8472,15 @@ (i32.const 42) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 58) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ showcase.ts:59:0 (if @@ -8013,7 +8492,15 @@ (i32.const 43) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 59) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ showcase.ts:62:0 (block @@ -8138,7 +8625,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 151) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:152:0 (if @@ -8153,7 +8648,15 @@ (i64.const 1229783084848853777) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 152) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:154:0 (set_global $memcpy/dest @@ -8177,7 +8680,15 @@ (i32.const 8) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 155) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:156:0 (if @@ -8192,7 +8703,15 @@ (i64.const 1229783084848853777) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 156) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:157:0 (if @@ -8211,7 +8730,15 @@ (i64.const 2459565876494606882) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 157) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:158:0 (if @@ -8230,7 +8757,15 @@ (i64.const 3689348814741910323) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 158) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:159:0 (if @@ -8249,7 +8784,15 @@ (i64.const 4919131752989213764) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 159) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:161:0 (set_global $memcpy/dest @@ -8284,7 +8827,15 @@ (i64.const 4919131679688438545) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 162) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:164:0 (set_global $memcpy/dest @@ -8319,7 +8870,15 @@ (i64.const 4919131679688438545) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 165) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:166:0 (if @@ -8338,7 +8897,15 @@ (i64.const 3689348814741910323) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 166) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:167:0 (if @@ -8357,7 +8924,15 @@ (i64.const 3694152654344438852) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 167) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ memcpy.ts:168:0 (if @@ -8376,7 +8951,15 @@ (i64.const 4919131752989213764) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 96) + (i32.const 168) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:65:0 (if @@ -8395,7 +8978,15 @@ (get_local $3) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 65) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:66:0 (if @@ -8412,7 +9003,15 @@ (f64.const 0.5) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 66) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:67:0 (if @@ -8433,7 +9032,15 @@ (f64.const 2.220446049250313e-16) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 67) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:68:0 (if @@ -8454,7 +9061,15 @@ (f64.const 2.220446049250313e-16) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 68) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:134:0 (if @@ -8473,7 +9088,15 @@ (get_local $2) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 134) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:135:0 (if @@ -8490,7 +9113,15 @@ (f32.const 0.5) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 135) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:136:0 (if @@ -8511,7 +9142,15 @@ (f32.const 1.1920928955078125e-07) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 136) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ fmod.ts:137:0 (if @@ -8532,7 +9171,15 @@ (f32.const 1.1920928955078125e-07) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 120) + (i32.const 137) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ showcase.ts:102:0 (i32.store @@ -8559,7 +9206,15 @@ (i32.const 42) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 104) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ showcase.ts:105:0 (if @@ -8574,7 +9229,15 @@ (f32.const 9e3) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 105) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ showcase.ts:107:0 (call $showcase/ADerivedClass#set:aWildAccessorAppears @@ -8594,7 +9257,15 @@ (f32.const 123) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 108) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ showcase.ts:110:0 (set_global $showcase/AClass.aStaticField @@ -8611,110 +9282,15 @@ (get_global $showcase/aClassInstance) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 64) + (i32.const 111) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: showcase/aConstantGlobal - GLOBAL: showcase/anExportedConstantGlobal - GLOBAL: showcase/aMutableGlobal - GLOBAL: showcase/anInferredI32 - GLOBAL: showcase/anInferredI64 - GLOBAL: showcase/anInferredF64 - GLOBAL: showcase/anInferredF32 - NAMESPACE: showcase/ANamespace - GLOBAL: showcase/ANamespace.aNamespacedGlobal - FUNCTION_PROTOTYPE: showcase/ANamespace.aNamespacedFunction - ENUM: showcase/AnEnum - FUNCTION_PROTOTYPE: showcase/addGeneric - FUNCTION_PROTOTYPE: showcase/anUnusedFunction - FUNCTION_PROTOTYPE: showcase/anExportedFunction - CLASS_PROTOTYPE: showcase/AClass - GLOBAL: showcase/AClass.aStaticField - CLASS_PROTOTYPE: showcase/ADerivedClass - PROPERTY: showcase/ADerivedClass#aWildAccessorAppears - GLOBAL: showcase/aClassInstance - GLOBAL: unary/i - GLOBAL: unary/I - GLOBAL: unary/f - GLOBAL: unary/F - GLOBAL: binary/b - GLOBAL: binary/i - GLOBAL: binary/I - GLOBAL: binary/f - GLOBAL: binary/F - GLOBAL: logical/i - GLOBAL: logical/I - GLOBAL: logical/f - GLOBAL: logical/F - GLOBAL: builtins/b - GLOBAL: builtins/i - GLOBAL: builtins/I - GLOBAL: builtins/f - GLOBAL: builtins/F - GLOBAL: builtins/constantOffset - GLOBAL: builtins/u - GLOBAL: builtins/U - GLOBAL: builtins/s - FUNCTION_PROTOTYPE: builtins/test - FUNCTION_PROTOTYPE: memcpy/memcpy - GLOBAL: memcpy/base - GLOBAL: memcpy/dest - FUNCTION_PROTOTYPE: fmod/fmod - FUNCTION_PROTOTYPE: fmod/fmodf -[program.exports] - GLOBAL: showcase/anExportedConstantGlobal - GLOBAL: showcase/aConstantGlobal - GLOBAL: showcase/anAliasedConstantGlobal - ENUM: showcase/AnEnum - FUNCTION_PROTOTYPE: showcase/anExportedFunction - FUNCTION_PROTOTYPE: builtins/test - FUNCTION_PROTOTYPE: memcpy/memcpy - FUNCTION_PROTOTYPE: fmod/fmod - FUNCTION_PROTOTYPE: fmod/fmodf -;) diff --git a/tests/compiler/std/allocator_arena.optimized.wast b/tests/compiler/std/allocator_arena.optimized.wast index 0da7d298..1de99c3b 100644 --- a/tests/compiler/std/allocator_arena.optimized.wast +++ b/tests/compiler/std/allocator_arena.optimized.wast @@ -3,6 +3,7 @@ (type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiv (func (param i32 i32 i32))) (type $iiii (func (param i32 i32 i32) (result i32))) + (type $iv (func (param i32))) (type $v (func)) (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global "$(lib)/allocator/arena/HEAP_OFFSET" (mut i32) (i32.const 0)) @@ -18,89 +19,62 @@ (local $1 i32) (local $2 i32) (local $3 i32) - ;;@ (lib)/allocator/arena.ts:14:2 (if - ;;@ (lib)/allocator/arena.ts:14:6 (i32.eqz - ;;@ (lib)/allocator/arena.ts:14:7 (get_local $0) ) - ;;@ (lib)/allocator/arena.ts:14:20 (return (i32.const 0) ) ) - ;;@ (lib)/allocator/arena.ts:18:2 (if - ;;@ (lib)/allocator/arena.ts:18:6 (i32.and (if (result i32) (tee_local $0 (i32.gt_u - ;;@ (lib)/allocator/arena.ts:16:2 (tee_local $2 - ;;@ (lib)/allocator/arena.ts:16:12 (i32.and (i32.add - ;;@ (lib)/allocator/arena.ts:16:13 (i32.add - ;;@ (lib)/allocator/arena.ts:15:2 (tee_local $3 - ;;@ (lib)/allocator/arena.ts:15:12 (get_global "$(lib)/allocator/arena/HEAP_OFFSET") ) - ;;@ (lib)/allocator/arena.ts:16:19 (get_local $0) ) - ;;@ (lib)/allocator/arena.ts:16:26 (i32.const 7) ) (i32.const -8) ) ) - ;;@ (lib)/allocator/arena.ts:17:2 (tee_local $1 - ;;@ (lib)/allocator/arena.ts:17:14 (i32.shl (current_memory) - ;;@ (lib)/allocator/arena.ts:17:41 (i32.const 16) ) ) ) ) - ;;@ (lib)/allocator/arena.ts:18:21 (i32.lt_s (grow_memory - ;;@ (lib)/allocator/arena.ts:19:4 (select (tee_local $0 - ;;@ (lib)/allocator/arena.ts:20:6 (i32.shr_u (i32.sub - ;;@ (lib)/allocator/arena.ts:20:7 (i32.and - ;;@ (lib)/allocator/arena.ts:20:8 (i32.add - ;;@ (lib)/allocator/arena.ts:20:9 (get_local $2) - ;;@ (lib)/allocator/arena.ts:20:15 (i32.const 65535) ) (i32.const -65536) ) - ;;@ (lib)/allocator/arena.ts:20:36 (get_local $1) ) - ;;@ (lib)/allocator/arena.ts:20:46 (i32.const 16) ) ) (tee_local $1 - ;;@ (lib)/allocator/arena.ts:21:6 (i32.shr_u (get_local $1) - ;;@ (lib)/allocator/arena.ts:21:46 (i32.const 16) ) ) @@ -110,513 +84,344 @@ ) ) ) - ;;@ (lib)/allocator/arena.ts:23:6 (i32.const 0) ) (get_local $0) ) (i32.const 1) ) - ;;@ (lib)/allocator/arena.ts:23:9 (unreachable) ) - ;;@ (lib)/allocator/arena.ts:24:2 (set_global "$(lib)/allocator/arena/HEAP_OFFSET" - ;;@ (lib)/allocator/arena.ts:24:16 (get_local $2) ) - ;;@ (lib)/allocator/arena.ts:25:9 (get_local $3) ) (func "$(lib)/memory/set_memory" (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i64) (local $4 i32) - ;;@ (lib)/memory.ts:196:2 (if - ;;@ (lib)/memory.ts:196:6 (i32.eqz - ;;@ (lib)/memory.ts:196:7 (get_local $2) ) - ;;@ (lib)/memory.ts:197:4 (return) ) - ;;@ (lib)/memory.ts:198:2 (i32.store8 - ;;@ (lib)/memory.ts:198:12 (get_local $0) - ;;@ (lib)/memory.ts:198:18 (get_local $1) ) - ;;@ (lib)/memory.ts:199:2 (i32.store8 - ;;@ (lib)/memory.ts:199:12 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:199:19 (get_local $2) ) - ;;@ (lib)/memory.ts:199:23 (i32.const 1) ) - ;;@ (lib)/memory.ts:199:26 (get_local $1) ) - ;;@ (lib)/memory.ts:200:2 (if - ;;@ (lib)/memory.ts:200:6 (i32.le_u (get_local $2) - ;;@ (lib)/memory.ts:200:11 (i32.const 2) ) - ;;@ (lib)/memory.ts:201:4 (return) ) - ;;@ (lib)/memory.ts:203:2 (i32.store8 - ;;@ (lib)/memory.ts:203:12 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:203:19 (i32.const 1) ) - ;;@ (lib)/memory.ts:203:22 (get_local $1) ) - ;;@ (lib)/memory.ts:204:2 (i32.store8 - ;;@ (lib)/memory.ts:204:12 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:204:19 (i32.const 2) ) - ;;@ (lib)/memory.ts:204:22 (get_local $1) ) - ;;@ (lib)/memory.ts:205:2 (i32.store8 - ;;@ (lib)/memory.ts:205:12 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:205:19 (get_local $2) ) - ;;@ (lib)/memory.ts:205:23 (i32.const 2) ) - ;;@ (lib)/memory.ts:205:26 (get_local $1) ) - ;;@ (lib)/memory.ts:206:2 (i32.store8 - ;;@ (lib)/memory.ts:206:12 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:206:19 (get_local $2) ) - ;;@ (lib)/memory.ts:206:23 (i32.const 3) ) - ;;@ (lib)/memory.ts:206:26 (get_local $1) ) - ;;@ (lib)/memory.ts:207:2 (if - ;;@ (lib)/memory.ts:207:6 (i32.le_u (get_local $2) - ;;@ (lib)/memory.ts:207:11 (i32.const 6) ) - ;;@ (lib)/memory.ts:208:4 (return) ) - ;;@ (lib)/memory.ts:209:2 (i32.store8 - ;;@ (lib)/memory.ts:209:12 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:209:19 (i32.const 3) ) - ;;@ (lib)/memory.ts:209:22 (get_local $1) ) - ;;@ (lib)/memory.ts:210:2 (i32.store8 - ;;@ (lib)/memory.ts:210:12 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:210:19 (get_local $2) ) - ;;@ (lib)/memory.ts:210:23 (i32.const 4) ) - ;;@ (lib)/memory.ts:210:26 (get_local $1) ) - ;;@ (lib)/memory.ts:211:2 (if - ;;@ (lib)/memory.ts:211:6 (i32.le_u (get_local $2) - ;;@ (lib)/memory.ts:211:11 (i32.const 8) ) - ;;@ (lib)/memory.ts:212:4 (return) ) - ;;@ (lib)/memory.ts:223:2 (i32.store - ;;@ (lib)/memory.ts:216:2 (tee_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:215:2 (tee_local $4 - ;;@ (lib)/memory.ts:215:17 (i32.and (i32.sub (i32.const 0) - ;;@ (lib)/memory.ts:215:18 (get_local $0) ) - ;;@ (lib)/memory.ts:215:25 (i32.const 3) ) ) ) ) - ;;@ (lib)/memory.ts:220:2 (tee_local $1 - ;;@ (lib)/memory.ts:220:17 (i32.mul - ;;@ (lib)/memory.ts:220:28 (get_local $1) (i32.const 16843009) ) ) ) - ;;@ (lib)/memory.ts:224:2 (i32.store - ;;@ (lib)/memory.ts:224:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:218:2 (tee_local $2 (i32.and (i32.sub - ;;@ (lib)/memory.ts:217:2 (get_local $2) - ;;@ (lib)/memory.ts:217:7 (get_local $4) ) (i32.const -4) ) ) ) - ;;@ (lib)/memory.ts:224:24 (i32.const 4) ) - ;;@ (lib)/memory.ts:224:27 (get_local $1) ) - ;;@ (lib)/memory.ts:225:2 (if - ;;@ (lib)/memory.ts:225:6 (i32.le_u (get_local $2) - ;;@ (lib)/memory.ts:225:11 (i32.const 8) ) - ;;@ (lib)/memory.ts:226:4 (return) ) - ;;@ (lib)/memory.ts:227:2 (i32.store - ;;@ (lib)/memory.ts:227:13 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:227:20 (i32.const 4) ) - ;;@ (lib)/memory.ts:227:23 (get_local $1) ) - ;;@ (lib)/memory.ts:228:2 (i32.store - ;;@ (lib)/memory.ts:228:13 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:228:20 (i32.const 8) ) - ;;@ (lib)/memory.ts:228:23 (get_local $1) ) - ;;@ (lib)/memory.ts:229:2 (i32.store - ;;@ (lib)/memory.ts:229:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:229:20 (get_local $2) ) - ;;@ (lib)/memory.ts:229:24 (i32.const 12) ) - ;;@ (lib)/memory.ts:229:28 (get_local $1) ) - ;;@ (lib)/memory.ts:230:2 (i32.store - ;;@ (lib)/memory.ts:230:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:230:20 (get_local $2) ) - ;;@ (lib)/memory.ts:230:24 (i32.const 8) ) - ;;@ (lib)/memory.ts:230:27 (get_local $1) ) - ;;@ (lib)/memory.ts:231:2 (if - ;;@ (lib)/memory.ts:231:6 (i32.le_u (get_local $2) - ;;@ (lib)/memory.ts:231:11 (i32.const 24) ) - ;;@ (lib)/memory.ts:232:4 (return) ) - ;;@ (lib)/memory.ts:233:2 (i32.store - ;;@ (lib)/memory.ts:233:13 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:233:20 (i32.const 12) ) - ;;@ (lib)/memory.ts:233:24 (get_local $1) ) - ;;@ (lib)/memory.ts:234:2 (i32.store - ;;@ (lib)/memory.ts:234:13 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:234:20 (i32.const 16) ) - ;;@ (lib)/memory.ts:234:24 (get_local $1) ) - ;;@ (lib)/memory.ts:235:2 (i32.store - ;;@ (lib)/memory.ts:235:13 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:235:20 (i32.const 20) ) - ;;@ (lib)/memory.ts:235:24 (get_local $1) ) - ;;@ (lib)/memory.ts:236:2 (i32.store - ;;@ (lib)/memory.ts:236:13 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:236:20 (i32.const 24) ) - ;;@ (lib)/memory.ts:236:24 (get_local $1) ) - ;;@ (lib)/memory.ts:237:2 (i32.store - ;;@ (lib)/memory.ts:237:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:237:20 (get_local $2) ) - ;;@ (lib)/memory.ts:237:24 (i32.const 28) ) - ;;@ (lib)/memory.ts:237:28 (get_local $1) ) - ;;@ (lib)/memory.ts:238:2 (i32.store - ;;@ (lib)/memory.ts:238:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:238:20 (get_local $2) ) - ;;@ (lib)/memory.ts:238:24 (i32.const 24) ) - ;;@ (lib)/memory.ts:238:28 (get_local $1) ) - ;;@ (lib)/memory.ts:239:2 (i32.store - ;;@ (lib)/memory.ts:239:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:239:20 (get_local $2) ) - ;;@ (lib)/memory.ts:239:24 (i32.const 20) ) - ;;@ (lib)/memory.ts:239:28 (get_local $1) ) - ;;@ (lib)/memory.ts:240:2 (i32.store - ;;@ (lib)/memory.ts:240:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:240:20 (get_local $2) ) - ;;@ (lib)/memory.ts:240:24 (i32.const 16) ) - ;;@ (lib)/memory.ts:240:28 (get_local $1) ) - ;;@ (lib)/memory.ts:244:2 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:243:2 (tee_local $4 - ;;@ (lib)/memory.ts:243:6 (i32.add - ;;@ (lib)/memory.ts:243:11 (i32.and - ;;@ (lib)/memory.ts:243:12 (get_local $0) - ;;@ (lib)/memory.ts:243:19 (i32.const 4) ) - ;;@ (lib)/memory.ts:243:6 (i32.const 24) ) ) ) ) - ;;@ (lib)/memory.ts:245:2 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:245:7 (get_local $4) ) ) - ;;@ (lib)/memory.ts:248:2 (set_local $3 - ;;@ (lib)/memory.ts:248:17 (i64.or (i64.extend_u/i32 (get_local $1) ) - ;;@ (lib)/memory.ts:248:28 (i64.shl - ;;@ (lib)/memory.ts:248:29 (i64.extend_u/i32 (get_local $1) ) - ;;@ (lib)/memory.ts:248:41 (i64.const 32) ) ) ) (loop $continue|0 (if - ;;@ (lib)/memory.ts:249:9 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:249:14 (i32.const 32) ) (block - ;;@ (lib)/memory.ts:250:4 (i64.store - ;;@ (lib)/memory.ts:250:15 (get_local $0) - ;;@ (lib)/memory.ts:250:21 (get_local $3) ) - ;;@ (lib)/memory.ts:251:4 (i64.store - ;;@ (lib)/memory.ts:251:15 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:251:22 (i32.const 8) ) - ;;@ (lib)/memory.ts:251:25 (get_local $3) ) - ;;@ (lib)/memory.ts:252:4 (i64.store - ;;@ (lib)/memory.ts:252:15 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:252:22 (i32.const 16) ) - ;;@ (lib)/memory.ts:252:26 (get_local $3) ) - ;;@ (lib)/memory.ts:253:4 (i64.store - ;;@ (lib)/memory.ts:253:15 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:253:22 (i32.const 24) ) - ;;@ (lib)/memory.ts:253:26 (get_local $3) ) - ;;@ (lib)/memory.ts:254:4 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:254:9 (i32.const 32) ) ) - ;;@ (lib)/memory.ts:255:4 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:255:12 (i32.const 32) ) ) @@ -630,13 +435,10 @@ (local $4 i32) (loop $continue|0 (if - ;;@ (lib)/memory.ts:8:9 (if (result i32) (get_local $2) - ;;@ (lib)/memory.ts:8:14 (i32.rem_u (get_local $1) - ;;@ (lib)/memory.ts:8:20 (i32.const 4) ) (get_local $2) @@ -645,16 +447,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:9:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:9:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:9:31 (block (result i32) (set_local $1 (i32.add @@ -664,13 +463,11 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:9:22 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:10:4 (set_local $2 (i32.sub (get_local $2) @@ -681,112 +478,78 @@ ) ) ) - ;;@ (lib)/memory.ts:14:2 (if (i32.eqz - ;;@ (lib)/memory.ts:14:6 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:14:13 (i32.const 4) ) ) - ;;@ (lib)/memory.ts:14:21 (block (loop $continue|1 (if - ;;@ (lib)/memory.ts:15:11 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:15:16 (i32.const 16) ) (block - ;;@ (lib)/memory.ts:16:6 (i32.store - ;;@ (lib)/memory.ts:16:17 (get_local $0) - ;;@ (lib)/memory.ts:16:28 (i32.load - ;;@ (lib)/memory.ts:16:38 (get_local $1) ) ) - ;;@ (lib)/memory.ts:17:6 (i32.store - ;;@ (lib)/memory.ts:17:17 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:17:25 (i32.const 4) ) - ;;@ (lib)/memory.ts:17:28 (i32.load - ;;@ (lib)/memory.ts:17:38 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:17:45 (i32.const 4) ) ) ) - ;;@ (lib)/memory.ts:18:6 (i32.store - ;;@ (lib)/memory.ts:18:17 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:18:25 (i32.const 8) ) - ;;@ (lib)/memory.ts:18:28 (i32.load - ;;@ (lib)/memory.ts:18:38 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:18:45 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:19:6 (i32.store - ;;@ (lib)/memory.ts:19:17 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:19:24 (i32.const 12) ) - ;;@ (lib)/memory.ts:19:28 (i32.load - ;;@ (lib)/memory.ts:19:38 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:19:44 (i32.const 12) ) ) ) - ;;@ (lib)/memory.ts:20:6 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:20:13 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:20:17 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:20:25 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:20:29 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:20:34 (i32.const 16) ) ) @@ -794,160 +557,111 @@ ) ) ) - ;;@ (lib)/memory.ts:22:4 (if - ;;@ (lib)/memory.ts:22:8 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:22:12 (i32.const 8) ) - ;;@ (lib)/memory.ts:22:15 (block - ;;@ (lib)/memory.ts:23:6 (i32.store - ;;@ (lib)/memory.ts:23:17 (get_local $0) - ;;@ (lib)/memory.ts:23:27 (i32.load - ;;@ (lib)/memory.ts:23:37 (get_local $1) ) ) - ;;@ (lib)/memory.ts:24:6 (i32.store - ;;@ (lib)/memory.ts:24:17 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:24:24 (i32.const 4) ) - ;;@ (lib)/memory.ts:24:27 (i32.load - ;;@ (lib)/memory.ts:24:37 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:24:43 (i32.const 4) ) ) ) - ;;@ (lib)/memory.ts:25:6 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:25:14 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:25:17 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:25:24 (i32.const 8) ) ) ) ) - ;;@ (lib)/memory.ts:27:4 (if - ;;@ (lib)/memory.ts:27:8 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:27:12 (i32.const 4) ) - ;;@ (lib)/memory.ts:27:15 (block - ;;@ (lib)/memory.ts:28:6 (i32.store - ;;@ (lib)/memory.ts:28:17 (get_local $0) - ;;@ (lib)/memory.ts:28:23 (i32.load - ;;@ (lib)/memory.ts:28:33 (get_local $1) ) ) - ;;@ (lib)/memory.ts:29:6 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:29:14 (i32.const 4) ) ) - ;;@ (lib)/memory.ts:29:17 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:29:24 (i32.const 4) ) ) ) ) - ;;@ (lib)/memory.ts:31:4 (if - ;;@ (lib)/memory.ts:31:8 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:31:12 (i32.const 2) ) - ;;@ (lib)/memory.ts:31:15 (block - ;;@ (lib)/memory.ts:32:6 (i32.store16 - ;;@ (lib)/memory.ts:32:17 (get_local $0) - ;;@ (lib)/memory.ts:32:23 (i32.load16_u - ;;@ (lib)/memory.ts:32:33 (get_local $1) ) ) - ;;@ (lib)/memory.ts:33:6 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:33:14 (i32.const 2) ) ) - ;;@ (lib)/memory.ts:33:17 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:33:24 (i32.const 2) ) ) ) ) - ;;@ (lib)/memory.ts:35:4 (if - ;;@ (lib)/memory.ts:35:8 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:35:12 (i32.const 1) ) - ;;@ (lib)/memory.ts:36:16 (block (set_local $3 (get_local $0) ) - ;;@ (lib)/memory.ts:36:6 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:36:33 (block (result i32) (set_local $3 (get_local $1) ) - ;;@ (lib)/memory.ts:36:24 (i32.load8_u (get_local $3) ) @@ -955,19 +669,14 @@ ) ) ) - ;;@ (lib)/memory.ts:38:4 (return) ) ) - ;;@ (lib)/memory.ts:43:2 (if - ;;@ (lib)/memory.ts:43:6 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:43:11 (i32.const 32) ) - ;;@ (lib)/memory.ts:44:4 (block $break|2 (block $case2|2 (block $case1|2 @@ -975,10 +684,8 @@ (block $tablify|0 (br_table $case0|2 $case1|2 $case2|2 $tablify|0 (i32.sub - ;;@ (lib)/memory.ts:44:12 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:44:19 (i32.const 4) ) (i32.const 1) @@ -987,27 +694,21 @@ ) (br $break|2) ) - ;;@ (lib)/memory.ts:47:8 (set_local $4 - ;;@ (lib)/memory.ts:47:12 (i32.load - ;;@ (lib)/memory.ts:47:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:48:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:48:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:48:35 (block (result i32) (set_local $1 (i32.add @@ -1017,7 +718,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:48:26 (i32.load8_u (get_local $3) ) @@ -1026,16 +726,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:49:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:49:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:49:35 (block (result i32) (set_local $1 (i32.add @@ -1045,7 +742,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:49:26 (i32.load8_u (get_local $3) ) @@ -1054,16 +750,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:50:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:50:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:50:35 (block (result i32) (set_local $1 (i32.add @@ -1073,182 +766,128 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:50:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:51:8 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:51:13 (i32.const 3) ) ) (loop $continue|3 (if - ;;@ (lib)/memory.ts:52:15 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:52:20 (i32.const 17) ) (block - ;;@ (lib)/memory.ts:54:10 (i32.store - ;;@ (lib)/memory.ts:54:21 (get_local $0) - ;;@ (lib)/memory.ts:54:27 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:54:32 (i32.const 24) ) - ;;@ (lib)/memory.ts:54:37 (i32.shl - ;;@ (lib)/memory.ts:53:10 (tee_local $3 - ;;@ (lib)/memory.ts:53:14 (i32.load - ;;@ (lib)/memory.ts:53:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:53:30 (i32.const 1) ) ) ) - ;;@ (lib)/memory.ts:54:42 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:56:10 (i32.store - ;;@ (lib)/memory.ts:56:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:56:28 (i32.const 4) ) - ;;@ (lib)/memory.ts:56:31 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:56:36 (i32.const 24) ) - ;;@ (lib)/memory.ts:56:41 (i32.shl - ;;@ (lib)/memory.ts:55:10 (tee_local $4 - ;;@ (lib)/memory.ts:55:14 (i32.load - ;;@ (lib)/memory.ts:55:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:55:30 (i32.const 5) ) ) ) - ;;@ (lib)/memory.ts:56:46 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:58:10 (i32.store - ;;@ (lib)/memory.ts:58:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:58:28 (i32.const 8) ) - ;;@ (lib)/memory.ts:58:31 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:58:36 (i32.const 24) ) - ;;@ (lib)/memory.ts:58:41 (i32.shl - ;;@ (lib)/memory.ts:57:10 (tee_local $3 - ;;@ (lib)/memory.ts:57:14 (i32.load - ;;@ (lib)/memory.ts:57:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:57:30 (i32.const 9) ) ) ) - ;;@ (lib)/memory.ts:58:46 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:60:10 (i32.store - ;;@ (lib)/memory.ts:60:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:60:28 (i32.const 12) ) - ;;@ (lib)/memory.ts:60:32 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:60:37 (i32.const 24) ) - ;;@ (lib)/memory.ts:60:42 (i32.shl - ;;@ (lib)/memory.ts:59:10 (tee_local $4 - ;;@ (lib)/memory.ts:59:14 (i32.load - ;;@ (lib)/memory.ts:59:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:59:30 (i32.const 13) ) ) ) - ;;@ (lib)/memory.ts:60:47 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:61:10 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:61:17 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:61:21 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:61:29 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:61:33 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:61:38 (i32.const 16) ) ) @@ -1256,30 +895,23 @@ ) ) ) - ;;@ (lib)/memory.ts:63:8 (br $break|2) ) - ;;@ (lib)/memory.ts:65:8 (set_local $4 - ;;@ (lib)/memory.ts:65:12 (i32.load - ;;@ (lib)/memory.ts:65:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:66:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:66:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:66:35 (block (result i32) (set_local $1 (i32.add @@ -1289,7 +921,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:66:26 (i32.load8_u (get_local $3) ) @@ -1298,16 +929,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:67:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:67:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:67:35 (block (result i32) (set_local $1 (i32.add @@ -1317,182 +945,128 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:67:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:68:8 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:68:13 (i32.const 2) ) ) (loop $continue|4 (if - ;;@ (lib)/memory.ts:69:15 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:69:20 (i32.const 18) ) (block - ;;@ (lib)/memory.ts:71:10 (i32.store - ;;@ (lib)/memory.ts:71:21 (get_local $0) - ;;@ (lib)/memory.ts:71:27 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:71:32 (i32.const 16) ) - ;;@ (lib)/memory.ts:71:37 (i32.shl - ;;@ (lib)/memory.ts:70:10 (tee_local $3 - ;;@ (lib)/memory.ts:70:14 (i32.load - ;;@ (lib)/memory.ts:70:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:70:30 (i32.const 2) ) ) ) - ;;@ (lib)/memory.ts:71:42 (i32.const 16) ) ) ) - ;;@ (lib)/memory.ts:73:10 (i32.store - ;;@ (lib)/memory.ts:73:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:73:28 (i32.const 4) ) - ;;@ (lib)/memory.ts:73:31 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:73:36 (i32.const 16) ) - ;;@ (lib)/memory.ts:73:41 (i32.shl - ;;@ (lib)/memory.ts:72:10 (tee_local $4 - ;;@ (lib)/memory.ts:72:14 (i32.load - ;;@ (lib)/memory.ts:72:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:72:30 (i32.const 6) ) ) ) - ;;@ (lib)/memory.ts:73:46 (i32.const 16) ) ) ) - ;;@ (lib)/memory.ts:75:10 (i32.store - ;;@ (lib)/memory.ts:75:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:75:28 (i32.const 8) ) - ;;@ (lib)/memory.ts:75:31 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:75:36 (i32.const 16) ) - ;;@ (lib)/memory.ts:75:41 (i32.shl - ;;@ (lib)/memory.ts:74:10 (tee_local $3 - ;;@ (lib)/memory.ts:74:14 (i32.load - ;;@ (lib)/memory.ts:74:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:74:30 (i32.const 10) ) ) ) - ;;@ (lib)/memory.ts:75:46 (i32.const 16) ) ) ) - ;;@ (lib)/memory.ts:77:10 (i32.store - ;;@ (lib)/memory.ts:77:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:77:28 (i32.const 12) ) - ;;@ (lib)/memory.ts:77:32 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:77:37 (i32.const 16) ) - ;;@ (lib)/memory.ts:77:42 (i32.shl - ;;@ (lib)/memory.ts:76:10 (tee_local $4 - ;;@ (lib)/memory.ts:76:14 (i32.load - ;;@ (lib)/memory.ts:76:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:76:30 (i32.const 14) ) ) ) - ;;@ (lib)/memory.ts:77:47 (i32.const 16) ) ) ) - ;;@ (lib)/memory.ts:78:10 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:78:17 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:78:21 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:78:29 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:78:33 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:78:38 (i32.const 16) ) ) @@ -1500,30 +1074,23 @@ ) ) ) - ;;@ (lib)/memory.ts:80:8 (br $break|2) ) - ;;@ (lib)/memory.ts:82:8 (set_local $4 - ;;@ (lib)/memory.ts:82:12 (i32.load - ;;@ (lib)/memory.ts:82:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:83:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:83:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:83:35 (block (result i32) (set_local $1 (i32.add @@ -1533,182 +1100,128 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:83:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:84:8 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:84:13 (i32.const 1) ) ) (loop $continue|5 (if - ;;@ (lib)/memory.ts:85:15 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:85:20 (i32.const 19) ) (block - ;;@ (lib)/memory.ts:87:10 (i32.store - ;;@ (lib)/memory.ts:87:21 (get_local $0) - ;;@ (lib)/memory.ts:87:27 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:87:32 (i32.const 8) ) - ;;@ (lib)/memory.ts:87:36 (i32.shl - ;;@ (lib)/memory.ts:86:10 (tee_local $3 - ;;@ (lib)/memory.ts:86:14 (i32.load - ;;@ (lib)/memory.ts:86:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:86:30 (i32.const 3) ) ) ) - ;;@ (lib)/memory.ts:87:41 (i32.const 24) ) ) ) - ;;@ (lib)/memory.ts:89:10 (i32.store - ;;@ (lib)/memory.ts:89:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:89:28 (i32.const 4) ) - ;;@ (lib)/memory.ts:89:31 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:89:36 (i32.const 8) ) - ;;@ (lib)/memory.ts:89:40 (i32.shl - ;;@ (lib)/memory.ts:88:10 (tee_local $4 - ;;@ (lib)/memory.ts:88:14 (i32.load - ;;@ (lib)/memory.ts:88:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:88:30 (i32.const 7) ) ) ) - ;;@ (lib)/memory.ts:89:45 (i32.const 24) ) ) ) - ;;@ (lib)/memory.ts:91:10 (i32.store - ;;@ (lib)/memory.ts:91:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:91:28 (i32.const 8) ) - ;;@ (lib)/memory.ts:91:31 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:91:36 (i32.const 8) ) - ;;@ (lib)/memory.ts:91:40 (i32.shl - ;;@ (lib)/memory.ts:90:10 (tee_local $3 - ;;@ (lib)/memory.ts:90:14 (i32.load - ;;@ (lib)/memory.ts:90:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:90:30 (i32.const 11) ) ) ) - ;;@ (lib)/memory.ts:91:45 (i32.const 24) ) ) ) - ;;@ (lib)/memory.ts:93:10 (i32.store - ;;@ (lib)/memory.ts:93:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:93:28 (i32.const 12) ) - ;;@ (lib)/memory.ts:93:32 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:93:37 (i32.const 8) ) - ;;@ (lib)/memory.ts:93:41 (i32.shl - ;;@ (lib)/memory.ts:92:10 (tee_local $4 - ;;@ (lib)/memory.ts:92:14 (i32.load - ;;@ (lib)/memory.ts:92:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:92:30 (i32.const 15) ) ) ) - ;;@ (lib)/memory.ts:93:46 (i32.const 24) ) ) ) - ;;@ (lib)/memory.ts:94:10 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:94:17 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:94:21 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:94:29 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:94:33 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:94:38 (i32.const 16) ) ) @@ -1718,29 +1231,22 @@ ) ) ) - ;;@ (lib)/memory.ts:101:2 (if - ;;@ (lib)/memory.ts:101:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:101:10 (i32.const 16) ) - ;;@ (lib)/memory.ts:101:14 (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:102:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:102:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:102:31 (block (result i32) (set_local $1 (i32.add @@ -1750,7 +1256,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:102:22 (i32.load8_u (get_local $3) ) @@ -1759,16 +1264,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:103:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:103:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:103:31 (block (result i32) (set_local $1 (i32.add @@ -1778,7 +1280,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:103:22 (i32.load8_u (get_local $3) ) @@ -1787,16 +1288,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:104:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:104:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:104:31 (block (result i32) (set_local $1 (i32.add @@ -1806,7 +1304,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:104:22 (i32.load8_u (get_local $3) ) @@ -1815,16 +1312,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:105:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:105:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:105:31 (block (result i32) (set_local $1 (i32.add @@ -1834,7 +1328,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:105:22 (i32.load8_u (get_local $3) ) @@ -1843,16 +1336,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:106:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:106:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:106:31 (block (result i32) (set_local $1 (i32.add @@ -1862,7 +1352,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:106:22 (i32.load8_u (get_local $3) ) @@ -1871,16 +1360,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:107:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:107:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:107:31 (block (result i32) (set_local $1 (i32.add @@ -1890,7 +1376,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:107:22 (i32.load8_u (get_local $3) ) @@ -1899,16 +1384,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:108:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:108:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:108:31 (block (result i32) (set_local $1 (i32.add @@ -1918,7 +1400,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:108:22 (i32.load8_u (get_local $3) ) @@ -1927,16 +1408,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:109:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:109:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:109:31 (block (result i32) (set_local $1 (i32.add @@ -1946,7 +1424,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:109:22 (i32.load8_u (get_local $3) ) @@ -1955,16 +1432,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:110:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:110:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:110:31 (block (result i32) (set_local $1 (i32.add @@ -1974,7 +1448,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:110:22 (i32.load8_u (get_local $3) ) @@ -1983,16 +1456,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:111:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:111:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:111:31 (block (result i32) (set_local $1 (i32.add @@ -2002,7 +1472,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:111:22 (i32.load8_u (get_local $3) ) @@ -2011,16 +1480,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:112:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:112:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:112:31 (block (result i32) (set_local $1 (i32.add @@ -2030,7 +1496,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:112:22 (i32.load8_u (get_local $3) ) @@ -2039,16 +1504,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:113:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:113:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:113:31 (block (result i32) (set_local $1 (i32.add @@ -2058,7 +1520,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:113:22 (i32.load8_u (get_local $3) ) @@ -2067,16 +1528,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:114:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:114:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:114:31 (block (result i32) (set_local $1 (i32.add @@ -2086,7 +1544,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:114:22 (i32.load8_u (get_local $3) ) @@ -2095,16 +1552,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:115:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:115:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:115:31 (block (result i32) (set_local $1 (i32.add @@ -2114,7 +1568,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:115:22 (i32.load8_u (get_local $3) ) @@ -2123,16 +1576,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:116:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:116:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:116:31 (block (result i32) (set_local $1 (i32.add @@ -2142,7 +1592,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:116:22 (i32.load8_u (get_local $3) ) @@ -2151,16 +1600,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:117:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:117:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:117:31 (block (result i32) (set_local $1 (i32.add @@ -2170,7 +1616,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:117:22 (i32.load8_u (get_local $3) ) @@ -2178,29 +1623,22 @@ ) ) ) - ;;@ (lib)/memory.ts:119:2 (if - ;;@ (lib)/memory.ts:119:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:119:10 (i32.const 8) ) - ;;@ (lib)/memory.ts:119:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:120:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:120:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:120:31 (block (result i32) (set_local $1 (i32.add @@ -2210,7 +1648,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:120:22 (i32.load8_u (get_local $3) ) @@ -2219,16 +1656,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:121:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:121:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:121:31 (block (result i32) (set_local $1 (i32.add @@ -2238,7 +1672,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:121:22 (i32.load8_u (get_local $3) ) @@ -2247,16 +1680,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:122:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:122:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:122:31 (block (result i32) (set_local $1 (i32.add @@ -2266,7 +1696,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:122:22 (i32.load8_u (get_local $3) ) @@ -2275,16 +1704,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:123:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:123:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:123:31 (block (result i32) (set_local $1 (i32.add @@ -2294,7 +1720,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:123:22 (i32.load8_u (get_local $3) ) @@ -2303,16 +1728,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:124:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:124:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:124:31 (block (result i32) (set_local $1 (i32.add @@ -2322,7 +1744,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:124:22 (i32.load8_u (get_local $3) ) @@ -2331,16 +1752,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:125:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:125:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:125:31 (block (result i32) (set_local $1 (i32.add @@ -2350,7 +1768,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:125:22 (i32.load8_u (get_local $3) ) @@ -2359,16 +1776,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:126:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:126:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:126:31 (block (result i32) (set_local $1 (i32.add @@ -2378,7 +1792,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:126:22 (i32.load8_u (get_local $3) ) @@ -2387,16 +1800,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:127:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:127:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:127:31 (block (result i32) (set_local $1 (i32.add @@ -2406,7 +1816,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:127:22 (i32.load8_u (get_local $3) ) @@ -2414,29 +1823,22 @@ ) ) ) - ;;@ (lib)/memory.ts:129:2 (if - ;;@ (lib)/memory.ts:129:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:129:10 (i32.const 4) ) - ;;@ (lib)/memory.ts:129:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:130:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:130:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:130:31 (block (result i32) (set_local $1 (i32.add @@ -2446,7 +1848,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:130:22 (i32.load8_u (get_local $3) ) @@ -2455,16 +1856,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:131:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:131:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:131:31 (block (result i32) (set_local $1 (i32.add @@ -2474,7 +1872,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:131:22 (i32.load8_u (get_local $3) ) @@ -2483,16 +1880,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:132:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:132:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:132:31 (block (result i32) (set_local $1 (i32.add @@ -2502,7 +1896,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:132:22 (i32.load8_u (get_local $3) ) @@ -2511,16 +1904,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:133:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:133:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:133:31 (block (result i32) (set_local $1 (i32.add @@ -2530,7 +1920,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:133:22 (i32.load8_u (get_local $3) ) @@ -2538,29 +1927,22 @@ ) ) ) - ;;@ (lib)/memory.ts:135:2 (if - ;;@ (lib)/memory.ts:135:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:135:10 (i32.const 2) ) - ;;@ (lib)/memory.ts:135:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:136:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:136:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:136:31 (block (result i32) (set_local $1 (i32.add @@ -2570,7 +1952,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:136:22 (i32.load8_u (get_local $3) ) @@ -2579,16 +1960,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:137:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:137:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:137:31 (block (result i32) (set_local $1 (i32.add @@ -2598,7 +1976,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:137:22 (i32.load8_u (get_local $3) ) @@ -2606,28 +1983,21 @@ ) ) ) - ;;@ (lib)/memory.ts:139:2 (if - ;;@ (lib)/memory.ts:139:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:139:10 (i32.const 1) ) - ;;@ (lib)/memory.ts:140:14 (block (set_local $3 (get_local $0) ) - ;;@ (lib)/memory.ts:140:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:140:31 (block (result i32) (set_local $3 (get_local $1) ) - ;;@ (lib)/memory.ts:140:22 (i32.load8_u (get_local $3) ) @@ -2638,113 +2008,78 @@ ) (func "$(lib)/memory/move_memory" (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - ;;@ (lib)/memory.ts:148:2 (if - ;;@ (lib)/memory.ts:148:6 (i32.eq (get_local $0) - ;;@ (lib)/memory.ts:148:14 (get_local $1) ) - ;;@ (lib)/memory.ts:149:4 (return) ) - ;;@ (lib)/memory.ts:150:2 (if - ;;@ (lib)/memory.ts:150:6 (i32.and (if (result i32) (tee_local $3 (i32.le_u (i32.add (get_local $1) - ;;@ (lib)/memory.ts:150:12 (get_local $2) ) - ;;@ (lib)/memory.ts:150:17 (get_local $0) ) ) (get_local $3) - ;;@ (lib)/memory.ts:150:25 (i32.le_u (i32.add (get_local $0) - ;;@ (lib)/memory.ts:150:32 (get_local $2) ) - ;;@ (lib)/memory.ts:150:37 (get_local $1) ) ) (i32.const 1) ) - ;;@ (lib)/memory.ts:150:42 (block - ;;@ (lib)/memory.ts:151:4 (call "$(lib)/memory/copy_memory" - ;;@ (lib)/memory.ts:151:16 (get_local $0) - ;;@ (lib)/memory.ts:151:22 (get_local $1) - ;;@ (lib)/memory.ts:151:27 (get_local $2) ) - ;;@ (lib)/memory.ts:152:4 (return) ) ) - ;;@ (lib)/memory.ts:154:2 (if - ;;@ (lib)/memory.ts:154:6 (i32.lt_u (get_local $0) - ;;@ (lib)/memory.ts:154:13 (get_local $1) ) - ;;@ (lib)/memory.ts:154:18 (block - ;;@ (lib)/memory.ts:155:4 (if - ;;@ (lib)/memory.ts:155:8 (i32.eq (i32.rem_u (get_local $1) - ;;@ (lib)/memory.ts:155:14 (i32.const 8) ) - ;;@ (lib)/memory.ts:155:19 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:155:26 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:155:29 (block (loop $continue|0 (if - ;;@ (lib)/memory.ts:156:13 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:156:20 (i32.const 8) ) (block - ;;@ (lib)/memory.ts:157:8 (if - ;;@ (lib)/memory.ts:157:12 (i32.eqz - ;;@ (lib)/memory.ts:157:13 (get_local $2) ) - ;;@ (lib)/memory.ts:158:10 (return) ) - ;;@ (lib)/memory.ts:159:8 (set_local $2 (i32.sub - ;;@ (lib)/memory.ts:159:10 (get_local $2) (i32.const 1) ) @@ -2752,16 +2087,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:160:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:160:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:160:35 (block (result i32) (set_local $1 (i32.add @@ -2771,7 +2103,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:160:26 (i32.load8_u (get_local $3) ) @@ -2783,44 +2114,32 @@ ) (loop $continue|1 (if - ;;@ (lib)/memory.ts:162:13 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:162:18 (i32.const 8) ) (block - ;;@ (lib)/memory.ts:163:8 (i64.store - ;;@ (lib)/memory.ts:163:19 (get_local $0) - ;;@ (lib)/memory.ts:163:25 (i64.load - ;;@ (lib)/memory.ts:163:35 (get_local $1) ) ) - ;;@ (lib)/memory.ts:164:8 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:164:13 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:165:8 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:165:16 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:166:8 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:166:15 (i32.const 8) ) ) @@ -2832,22 +2151,18 @@ ) (loop $continue|2 (if - ;;@ (lib)/memory.ts:169:11 (get_local $2) (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:170:16 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:170:6 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:170:33 (block (result i32) (set_local $1 (i32.add @@ -2857,16 +2172,13 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:170:24 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:171:6 (set_local $2 (i32.sub - ;;@ (lib)/memory.ts:171:8 (get_local $2) (i32.const 1) ) @@ -2876,70 +2188,48 @@ ) ) ) - ;;@ (lib)/memory.ts:173:9 (block - ;;@ (lib)/memory.ts:174:4 (if - ;;@ (lib)/memory.ts:174:8 (i32.eq (i32.rem_u (get_local $1) - ;;@ (lib)/memory.ts:174:14 (i32.const 8) ) - ;;@ (lib)/memory.ts:174:19 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:174:26 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:174:29 (block (loop $continue|3 (if - ;;@ (lib)/memory.ts:175:13 (i32.rem_u (i32.add - ;;@ (lib)/memory.ts:175:14 (get_local $0) - ;;@ (lib)/memory.ts:175:21 (get_local $2) ) - ;;@ (lib)/memory.ts:175:26 (i32.const 8) ) (block - ;;@ (lib)/memory.ts:176:8 (if - ;;@ (lib)/memory.ts:176:12 (i32.eqz - ;;@ (lib)/memory.ts:176:13 (get_local $2) ) - ;;@ (lib)/memory.ts:177:10 (return) ) - ;;@ (lib)/memory.ts:178:8 (i32.store8 - ;;@ (lib)/memory.ts:178:18 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:178:25 (tee_local $2 (i32.sub - ;;@ (lib)/memory.ts:178:27 (get_local $2) (i32.const 1) ) ) ) - ;;@ (lib)/memory.ts:178:30 (i32.load8_u - ;;@ (lib)/memory.ts:178:39 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:178:45 (get_local $2) ) ) @@ -2950,33 +2240,24 @@ ) (loop $continue|4 (if - ;;@ (lib)/memory.ts:180:13 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:180:18 (i32.const 8) ) (block - ;;@ (lib)/memory.ts:182:8 (i64.store - ;;@ (lib)/memory.ts:182:19 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:181:8 (tee_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:181:13 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:182:29 (i64.load - ;;@ (lib)/memory.ts:182:39 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:182:45 (get_local $2) ) ) @@ -2989,29 +2270,21 @@ ) (loop $continue|5 (if - ;;@ (lib)/memory.ts:185:11 (get_local $2) (block - ;;@ (lib)/memory.ts:186:6 (i32.store8 - ;;@ (lib)/memory.ts:186:16 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:186:23 (tee_local $2 (i32.sub - ;;@ (lib)/memory.ts:186:25 (get_local $2) (i32.const 1) ) ) ) - ;;@ (lib)/memory.ts:186:28 (i32.load8_u - ;;@ (lib)/memory.ts:186:37 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:186:43 (get_local $2) ) ) @@ -3024,54 +2297,42 @@ ) ) (func "$(lib)/memory/compare_memory" (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - ;;@ (lib)/memory.ts:262:2 (if - ;;@ (lib)/memory.ts:262:6 (i32.eq (get_local $0) - ;;@ (lib)/memory.ts:262:12 (get_local $1) ) - ;;@ (lib)/memory.ts:263:11 (return (i32.const 0) ) ) (loop $continue|0 (if - ;;@ (lib)/memory.ts:264:9 (if (result i32) (get_local $2) - ;;@ (lib)/memory.ts:264:14 (i32.eq (i32.load8_u - ;;@ (lib)/memory.ts:264:23 (get_local $0) ) - ;;@ (lib)/memory.ts:264:30 (i32.load8_u - ;;@ (lib)/memory.ts:264:39 (get_local $1) ) ) (get_local $2) ) (block - ;;@ (lib)/memory.ts:265:4 (set_local $2 (i32.sub (get_local $2) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:266:4 (set_local $0 (i32.add (get_local $0) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:267:4 (set_local $1 (i32.add (get_local $1) @@ -3082,50 +2343,44 @@ ) ) ) - ;;@ (lib)/memory.ts:269:9 (if (result i32) (get_local $2) - ;;@ (lib)/memory.ts:269:13 (i32.sub (i32.load8_u - ;;@ (lib)/memory.ts:269:27 (get_local $0) ) - ;;@ (lib)/memory.ts:269:33 (i32.load8_u - ;;@ (lib)/memory.ts:269:47 (get_local $1) ) ) - ;;@ (lib)/memory.ts:269:53 (i32.const 0) ) ) - (func $start (; 6 ;) (type $v) + (func "$(lib)/allocator/arena/free_memory" (; 6 ;) (type $iv) (param $0 i32) + (nop) + ) + (func "$(lib)/allocator/arena/reset_memory" (; 7 ;) (type $v) + (set_global "$(lib)/allocator/arena/HEAP_OFFSET" + (get_global $HEAP_BASE) + ) + ) + (func $start (; 8 ;) (type $v) (set_global "$(lib)/allocator/arena/HEAP_OFFSET" - ;;@ (lib)/allocator/arena.ts:11:25 (get_global $HEAP_BASE) ) (set_global $std/allocator_arena/ptr1 - ;;@ std/allocator_arena.ts:4:18 (call "$(lib)/allocator/arena/allocate_memory" - ;;@ std/allocator_arena.ts:4:34 (i32.const 42) ) ) (set_global $std/allocator_arena/ptr2 - ;;@ std/allocator_arena.ts:5:18 (call "$(lib)/allocator/arena/allocate_memory" - ;;@ std/allocator_arena.ts:5:34 (i32.const 42) ) ) - ;;@ std/allocator_arena.ts:7:0 (if - ;;@ std/allocator_arena.ts:7:7 (i32.eq (get_global $std/allocator_arena/ptr1) - ;;@ std/allocator_arena.ts:7:15 (get_global $std/allocator_arena/ptr2) ) (block @@ -3138,42 +2393,29 @@ (unreachable) ) ) - ;;@ std/allocator_arena.ts:9:0 (call "$(lib)/memory/set_memory" - ;;@ std/allocator_arena.ts:9:11 (get_global $std/allocator_arena/ptr1) - ;;@ std/allocator_arena.ts:9:17 (i32.const 18) - ;;@ std/allocator_arena.ts:9:23 (i32.const 42) ) - ;;@ std/allocator_arena.ts:12:5 (set_global $std/allocator_arena/i - ;;@ std/allocator_arena.ts:12:9 (i32.const 0) ) (loop $continue|0 (if - ;;@ std/allocator_arena.ts:12:12 (i32.lt_u (get_global $std/allocator_arena/i) - ;;@ std/allocator_arena.ts:12:16 (i32.const 42) ) (block - ;;@ std/allocator_arena.ts:13:2 (if - ;;@ std/allocator_arena.ts:13:9 (i32.ne (i32.load8_u - ;;@ std/allocator_arena.ts:13:18 (i32.add (get_global $std/allocator_arena/ptr1) - ;;@ std/allocator_arena.ts:13:25 (get_global $std/allocator_arena/i) ) ) - ;;@ std/allocator_arena.ts:13:31 (i32.const 18) ) (block @@ -3186,10 +2428,8 @@ (unreachable) ) ) - ;;@ std/allocator_arena.ts:12:22 (set_global $std/allocator_arena/i (i32.add - ;;@ std/allocator_arena.ts:12:24 (get_global $std/allocator_arena/i) (i32.const 1) ) @@ -3198,42 +2438,29 @@ ) ) ) - ;;@ std/allocator_arena.ts:15:0 (call "$(lib)/memory/move_memory" - ;;@ std/allocator_arena.ts:15:12 (get_global $std/allocator_arena/ptr2) - ;;@ std/allocator_arena.ts:15:18 (get_global $std/allocator_arena/ptr1) - ;;@ std/allocator_arena.ts:15:24 (i32.const 42) ) - ;;@ std/allocator_arena.ts:17:5 (set_global $std/allocator_arena/i - ;;@ std/allocator_arena.ts:17:9 (i32.const 0) ) (loop $continue|1 (if - ;;@ std/allocator_arena.ts:17:12 (i32.lt_u (get_global $std/allocator_arena/i) - ;;@ std/allocator_arena.ts:17:16 (i32.const 42) ) (block - ;;@ std/allocator_arena.ts:18:2 (if - ;;@ std/allocator_arena.ts:18:9 (i32.ne (i32.load8_u - ;;@ std/allocator_arena.ts:18:18 (i32.add (get_global $std/allocator_arena/ptr2) - ;;@ std/allocator_arena.ts:18:25 (get_global $std/allocator_arena/i) ) ) - ;;@ std/allocator_arena.ts:18:31 (i32.const 18) ) (block @@ -3246,10 +2473,8 @@ (unreachable) ) ) - ;;@ std/allocator_arena.ts:17:22 (set_global $std/allocator_arena/i (i32.add - ;;@ std/allocator_arena.ts:17:24 (get_global $std/allocator_arena/i) (i32.const 1) ) @@ -3258,15 +2483,10 @@ ) ) ) - ;;@ std/allocator_arena.ts:20:0 (if - ;;@ std/allocator_arena.ts:20:7 (call "$(lib)/memory/compare_memory" - ;;@ std/allocator_arena.ts:20:22 (get_global $std/allocator_arena/ptr1) - ;;@ std/allocator_arena.ts:20:28 (get_global $std/allocator_arena/ptr2) - ;;@ std/allocator_arena.ts:20:34 (i32.const 42) ) (block @@ -3279,23 +2499,21 @@ (unreachable) ) ) - (set_global "$(lib)/allocator/arena/HEAP_OFFSET" - (get_global $HEAP_BASE) + (call "$(lib)/allocator/arena/free_memory" + (get_global $std/allocator_arena/ptr1) ) - ;;@ std/allocator_arena.ts:26:0 + (call "$(lib)/allocator/arena/free_memory" + (get_global $std/allocator_arena/ptr2) + ) + (call "$(lib)/allocator/arena/reset_memory") (set_global $std/allocator_arena/ptr1 - ;;@ std/allocator_arena.ts:26:7 (call "$(lib)/allocator/arena/allocate_memory" - ;;@ std/allocator_arena.ts:26:23 (i32.const 42) ) ) - ;;@ std/allocator_arena.ts:27:0 (if - ;;@ std/allocator_arena.ts:27:7 (i32.ne (get_global $std/allocator_arena/ptr1) - ;;@ std/allocator_arena.ts:27:15 (get_global $HEAP_BASE) ) (block diff --git a/tests/compiler/std/allocator_arena.wast b/tests/compiler/std/allocator_arena.wast index a24ff7aa..9209621f 100644 --- a/tests/compiler/std/allocator_arena.wast +++ b/tests/compiler/std/allocator_arena.wast @@ -3692,142 +3692,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - CLASS_PROTOTYPE: (lib)/array/Array - PROPERTY: (lib)/array/Array#length - CLASS_PROTOTYPE: Array - CLASS_PROTOTYPE: (lib)/array/CArray - CLASS_PROTOTYPE: CArray - CLASS_PROTOTYPE: (lib)/error/Error - CLASS_PROTOTYPE: Error - CLASS_PROTOTYPE: (lib)/error/RangeError - CLASS_PROTOTYPE: RangeError - CLASS_PROTOTYPE: (lib)/map/Map - PROPERTY: (lib)/map/Map#size - CLASS_PROTOTYPE: Map - FUNCTION_PROTOTYPE: (lib)/memory/copy_memory - FUNCTION_PROTOTYPE: (lib)/memory/move_memory - FUNCTION_PROTOTYPE: move_memory - FUNCTION_PROTOTYPE: (lib)/memory/set_memory - FUNCTION_PROTOTYPE: set_memory - FUNCTION_PROTOTYPE: (lib)/memory/compare_memory - FUNCTION_PROTOTYPE: compare_memory - CLASS_PROTOTYPE: (lib)/regexp/RegExp - CLASS_PROTOTYPE: RegExp - CLASS_PROTOTYPE: (lib)/set/Set - PROPERTY: (lib)/set/Set#size - CLASS_PROTOTYPE: Set - GLOBAL: (lib)/string/EMPTY - GLOBAL: (lib)/string/HEAD - FUNCTION_PROTOTYPE: (lib)/string/allocate - CLASS_PROTOTYPE: (lib)/string/String - FUNCTION_PROTOTYPE: (lib)/string/String.__concat - FUNCTION_PROTOTYPE: (lib)/string/String.__eq - CLASS_PROTOTYPE: String - FUNCTION_PROTOTYPE: (lib)/string/isWhiteSpaceOrLineTerminator - ENUM: (lib)/string/CharCode - FUNCTION_PROTOTYPE: (lib)/string/parseInt - FUNCTION_PROTOTYPE: parseInt - FUNCTION_PROTOTYPE: (lib)/string/parseI32 - FUNCTION_PROTOTYPE: parseI32 - FUNCTION_PROTOTYPE: (lib)/string/parseI64 - FUNCTION_PROTOTYPE: parseI64 - FUNCTION_PROTOTYPE: (lib)/string/parse - FUNCTION_PROTOTYPE: (lib)/string/parseFloat - FUNCTION_PROTOTYPE: parseFloat - GLOBAL: std/allocator_arena/size - GLOBAL: std/allocator_arena/ptr1 - GLOBAL: std/allocator_arena/ptr2 - GLOBAL: std/allocator_arena/i - GLOBAL: (lib)/allocator/arena/ALIGN_LOG2 - GLOBAL: (lib)/allocator/arena/ALIGN_SIZE - GLOBAL: (lib)/allocator/arena/ALIGN_MASK - GLOBAL: (lib)/allocator/arena/HEAP_OFFSET - FUNCTION_PROTOTYPE: (lib)/allocator/arena/allocate_memory - FUNCTION_PROTOTYPE: allocate_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/free_memory - FUNCTION_PROTOTYPE: free_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/reset_memory - FUNCTION_PROTOTYPE: reset_memory -[program.exports] - CLASS_PROTOTYPE: (lib)/array/Array - CLASS_PROTOTYPE: Array - CLASS_PROTOTYPE: (lib)/array/CArray - CLASS_PROTOTYPE: CArray - CLASS_PROTOTYPE: (lib)/error/Error - CLASS_PROTOTYPE: Error - CLASS_PROTOTYPE: (lib)/error/RangeError - CLASS_PROTOTYPE: RangeError - CLASS_PROTOTYPE: (lib)/map/Map - CLASS_PROTOTYPE: Map - FUNCTION_PROTOTYPE: move_memory - FUNCTION_PROTOTYPE: (lib)/memory/move_memory - FUNCTION_PROTOTYPE: set_memory - FUNCTION_PROTOTYPE: (lib)/memory/set_memory - FUNCTION_PROTOTYPE: compare_memory - FUNCTION_PROTOTYPE: (lib)/memory/compare_memory - CLASS_PROTOTYPE: (lib)/regexp/RegExp - CLASS_PROTOTYPE: RegExp - CLASS_PROTOTYPE: (lib)/set/Set - CLASS_PROTOTYPE: Set - CLASS_PROTOTYPE: (lib)/string/String - CLASS_PROTOTYPE: String - FUNCTION_PROTOTYPE: parseInt - FUNCTION_PROTOTYPE: (lib)/string/parseInt - FUNCTION_PROTOTYPE: parseI32 - FUNCTION_PROTOTYPE: (lib)/string/parseI32 - FUNCTION_PROTOTYPE: parseI64 - FUNCTION_PROTOTYPE: (lib)/string/parseI64 - FUNCTION_PROTOTYPE: parseFloat - FUNCTION_PROTOTYPE: (lib)/string/parseFloat - FUNCTION_PROTOTYPE: allocate_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/allocate_memory - FUNCTION_PROTOTYPE: free_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/free_memory - FUNCTION_PROTOTYPE: reset_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/reset_memory -;) diff --git a/tests/compiler/std/array.optimized.wast b/tests/compiler/std/array.optimized.wast index 8ba14890..f2a6dfca 100644 --- a/tests/compiler/std/array.optimized.wast +++ b/tests/compiler/std/array.optimized.wast @@ -2,6 +2,7 @@ (type $ii (func (param i32) (result i32))) (type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiv (func (param i32 i32 i32))) + (type $iv (func (param i32))) (type $iiv (func (param i32 i32))) (type $iii (func (param i32 i32) (result i32))) (type $iiii (func (param i32 i32 i32) (result i32))) @@ -20,89 +21,62 @@ (local $1 i32) (local $2 i32) (local $3 i32) - ;;@ (lib)/allocator/arena.ts:14:2 (if - ;;@ (lib)/allocator/arena.ts:14:6 (i32.eqz - ;;@ (lib)/allocator/arena.ts:14:7 (get_local $0) ) - ;;@ (lib)/allocator/arena.ts:14:20 (return (i32.const 0) ) ) - ;;@ (lib)/allocator/arena.ts:18:2 (if - ;;@ (lib)/allocator/arena.ts:18:6 (i32.and (if (result i32) (tee_local $0 (i32.gt_u - ;;@ (lib)/allocator/arena.ts:16:2 (tee_local $2 - ;;@ (lib)/allocator/arena.ts:16:12 (i32.and (i32.add - ;;@ (lib)/allocator/arena.ts:16:13 (i32.add - ;;@ (lib)/allocator/arena.ts:15:2 (tee_local $3 - ;;@ (lib)/allocator/arena.ts:15:12 (get_global "$(lib)/allocator/arena/HEAP_OFFSET") ) - ;;@ (lib)/allocator/arena.ts:16:19 (get_local $0) ) - ;;@ (lib)/allocator/arena.ts:16:26 (i32.const 7) ) (i32.const -8) ) ) - ;;@ (lib)/allocator/arena.ts:17:2 (tee_local $1 - ;;@ (lib)/allocator/arena.ts:17:14 (i32.shl (current_memory) - ;;@ (lib)/allocator/arena.ts:17:41 (i32.const 16) ) ) ) ) - ;;@ (lib)/allocator/arena.ts:18:21 (i32.lt_s (grow_memory - ;;@ (lib)/allocator/arena.ts:19:4 (select (tee_local $0 - ;;@ (lib)/allocator/arena.ts:20:6 (i32.shr_u (i32.sub - ;;@ (lib)/allocator/arena.ts:20:7 (i32.and - ;;@ (lib)/allocator/arena.ts:20:8 (i32.add - ;;@ (lib)/allocator/arena.ts:20:9 (get_local $2) - ;;@ (lib)/allocator/arena.ts:20:15 (i32.const 65535) ) (i32.const -65536) ) - ;;@ (lib)/allocator/arena.ts:20:36 (get_local $1) ) - ;;@ (lib)/allocator/arena.ts:20:46 (i32.const 16) ) ) (tee_local $1 - ;;@ (lib)/allocator/arena.ts:21:6 (i32.shr_u (get_local $1) - ;;@ (lib)/allocator/arena.ts:21:46 (i32.const 16) ) ) @@ -112,26 +86,20 @@ ) ) ) - ;;@ (lib)/allocator/arena.ts:23:6 (i32.const 0) ) (get_local $0) ) (i32.const 1) ) - ;;@ (lib)/allocator/arena.ts:23:9 (unreachable) ) - ;;@ (lib)/allocator/arena.ts:24:2 (set_global "$(lib)/allocator/arena/HEAP_OFFSET" - ;;@ (lib)/allocator/arena.ts:24:16 (get_local $2) ) - ;;@ (lib)/allocator/arena.ts:25:9 (get_local $3) ) (func "$(lib)/array/Array#get:length" (; 2 ;) (type $ii) (param $0 i32) (result i32) - ;;@ (lib)/array.ts:26:11 (i32.load offset=8 (get_local $0) ) @@ -141,13 +109,10 @@ (local $4 i32) (loop $continue|0 (if - ;;@ (lib)/memory.ts:8:9 (if (result i32) (get_local $2) - ;;@ (lib)/memory.ts:8:14 (i32.rem_u (get_local $1) - ;;@ (lib)/memory.ts:8:20 (i32.const 4) ) (get_local $2) @@ -156,16 +121,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:9:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:9:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:9:31 (block (result i32) (set_local $1 (i32.add @@ -175,13 +137,11 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:9:22 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:10:4 (set_local $2 (i32.sub (get_local $2) @@ -192,112 +152,78 @@ ) ) ) - ;;@ (lib)/memory.ts:14:2 (if (i32.eqz - ;;@ (lib)/memory.ts:14:6 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:14:13 (i32.const 4) ) ) - ;;@ (lib)/memory.ts:14:21 (block (loop $continue|1 (if - ;;@ (lib)/memory.ts:15:11 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:15:16 (i32.const 16) ) (block - ;;@ (lib)/memory.ts:16:6 (i32.store - ;;@ (lib)/memory.ts:16:17 (get_local $0) - ;;@ (lib)/memory.ts:16:28 (i32.load - ;;@ (lib)/memory.ts:16:38 (get_local $1) ) ) - ;;@ (lib)/memory.ts:17:6 (i32.store - ;;@ (lib)/memory.ts:17:17 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:17:25 (i32.const 4) ) - ;;@ (lib)/memory.ts:17:28 (i32.load - ;;@ (lib)/memory.ts:17:38 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:17:45 (i32.const 4) ) ) ) - ;;@ (lib)/memory.ts:18:6 (i32.store - ;;@ (lib)/memory.ts:18:17 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:18:25 (i32.const 8) ) - ;;@ (lib)/memory.ts:18:28 (i32.load - ;;@ (lib)/memory.ts:18:38 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:18:45 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:19:6 (i32.store - ;;@ (lib)/memory.ts:19:17 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:19:24 (i32.const 12) ) - ;;@ (lib)/memory.ts:19:28 (i32.load - ;;@ (lib)/memory.ts:19:38 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:19:44 (i32.const 12) ) ) ) - ;;@ (lib)/memory.ts:20:6 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:20:13 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:20:17 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:20:25 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:20:29 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:20:34 (i32.const 16) ) ) @@ -305,160 +231,111 @@ ) ) ) - ;;@ (lib)/memory.ts:22:4 (if - ;;@ (lib)/memory.ts:22:8 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:22:12 (i32.const 8) ) - ;;@ (lib)/memory.ts:22:15 (block - ;;@ (lib)/memory.ts:23:6 (i32.store - ;;@ (lib)/memory.ts:23:17 (get_local $0) - ;;@ (lib)/memory.ts:23:27 (i32.load - ;;@ (lib)/memory.ts:23:37 (get_local $1) ) ) - ;;@ (lib)/memory.ts:24:6 (i32.store - ;;@ (lib)/memory.ts:24:17 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:24:24 (i32.const 4) ) - ;;@ (lib)/memory.ts:24:27 (i32.load - ;;@ (lib)/memory.ts:24:37 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:24:43 (i32.const 4) ) ) ) - ;;@ (lib)/memory.ts:25:6 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:25:14 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:25:17 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:25:24 (i32.const 8) ) ) ) ) - ;;@ (lib)/memory.ts:27:4 (if - ;;@ (lib)/memory.ts:27:8 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:27:12 (i32.const 4) ) - ;;@ (lib)/memory.ts:27:15 (block - ;;@ (lib)/memory.ts:28:6 (i32.store - ;;@ (lib)/memory.ts:28:17 (get_local $0) - ;;@ (lib)/memory.ts:28:23 (i32.load - ;;@ (lib)/memory.ts:28:33 (get_local $1) ) ) - ;;@ (lib)/memory.ts:29:6 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:29:14 (i32.const 4) ) ) - ;;@ (lib)/memory.ts:29:17 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:29:24 (i32.const 4) ) ) ) ) - ;;@ (lib)/memory.ts:31:4 (if - ;;@ (lib)/memory.ts:31:8 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:31:12 (i32.const 2) ) - ;;@ (lib)/memory.ts:31:15 (block - ;;@ (lib)/memory.ts:32:6 (i32.store16 - ;;@ (lib)/memory.ts:32:17 (get_local $0) - ;;@ (lib)/memory.ts:32:23 (i32.load16_u - ;;@ (lib)/memory.ts:32:33 (get_local $1) ) ) - ;;@ (lib)/memory.ts:33:6 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:33:14 (i32.const 2) ) ) - ;;@ (lib)/memory.ts:33:17 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:33:24 (i32.const 2) ) ) ) ) - ;;@ (lib)/memory.ts:35:4 (if - ;;@ (lib)/memory.ts:35:8 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:35:12 (i32.const 1) ) - ;;@ (lib)/memory.ts:36:16 (block (set_local $3 (get_local $0) ) - ;;@ (lib)/memory.ts:36:6 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:36:33 (block (result i32) (set_local $3 (get_local $1) ) - ;;@ (lib)/memory.ts:36:24 (i32.load8_u (get_local $3) ) @@ -466,19 +343,14 @@ ) ) ) - ;;@ (lib)/memory.ts:38:4 (return) ) ) - ;;@ (lib)/memory.ts:43:2 (if - ;;@ (lib)/memory.ts:43:6 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:43:11 (i32.const 32) ) - ;;@ (lib)/memory.ts:44:4 (block $break|2 (block $case2|2 (block $case1|2 @@ -486,10 +358,8 @@ (block $tablify|0 (br_table $case0|2 $case1|2 $case2|2 $tablify|0 (i32.sub - ;;@ (lib)/memory.ts:44:12 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:44:19 (i32.const 4) ) (i32.const 1) @@ -498,27 +368,21 @@ ) (br $break|2) ) - ;;@ (lib)/memory.ts:47:8 (set_local $4 - ;;@ (lib)/memory.ts:47:12 (i32.load - ;;@ (lib)/memory.ts:47:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:48:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:48:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:48:35 (block (result i32) (set_local $1 (i32.add @@ -528,7 +392,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:48:26 (i32.load8_u (get_local $3) ) @@ -537,16 +400,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:49:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:49:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:49:35 (block (result i32) (set_local $1 (i32.add @@ -556,7 +416,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:49:26 (i32.load8_u (get_local $3) ) @@ -565,16 +424,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:50:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:50:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:50:35 (block (result i32) (set_local $1 (i32.add @@ -584,182 +440,128 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:50:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:51:8 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:51:13 (i32.const 3) ) ) (loop $continue|3 (if - ;;@ (lib)/memory.ts:52:15 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:52:20 (i32.const 17) ) (block - ;;@ (lib)/memory.ts:54:10 (i32.store - ;;@ (lib)/memory.ts:54:21 (get_local $0) - ;;@ (lib)/memory.ts:54:27 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:54:32 (i32.const 24) ) - ;;@ (lib)/memory.ts:54:37 (i32.shl - ;;@ (lib)/memory.ts:53:10 (tee_local $3 - ;;@ (lib)/memory.ts:53:14 (i32.load - ;;@ (lib)/memory.ts:53:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:53:30 (i32.const 1) ) ) ) - ;;@ (lib)/memory.ts:54:42 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:56:10 (i32.store - ;;@ (lib)/memory.ts:56:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:56:28 (i32.const 4) ) - ;;@ (lib)/memory.ts:56:31 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:56:36 (i32.const 24) ) - ;;@ (lib)/memory.ts:56:41 (i32.shl - ;;@ (lib)/memory.ts:55:10 (tee_local $4 - ;;@ (lib)/memory.ts:55:14 (i32.load - ;;@ (lib)/memory.ts:55:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:55:30 (i32.const 5) ) ) ) - ;;@ (lib)/memory.ts:56:46 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:58:10 (i32.store - ;;@ (lib)/memory.ts:58:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:58:28 (i32.const 8) ) - ;;@ (lib)/memory.ts:58:31 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:58:36 (i32.const 24) ) - ;;@ (lib)/memory.ts:58:41 (i32.shl - ;;@ (lib)/memory.ts:57:10 (tee_local $3 - ;;@ (lib)/memory.ts:57:14 (i32.load - ;;@ (lib)/memory.ts:57:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:57:30 (i32.const 9) ) ) ) - ;;@ (lib)/memory.ts:58:46 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:60:10 (i32.store - ;;@ (lib)/memory.ts:60:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:60:28 (i32.const 12) ) - ;;@ (lib)/memory.ts:60:32 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:60:37 (i32.const 24) ) - ;;@ (lib)/memory.ts:60:42 (i32.shl - ;;@ (lib)/memory.ts:59:10 (tee_local $4 - ;;@ (lib)/memory.ts:59:14 (i32.load - ;;@ (lib)/memory.ts:59:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:59:30 (i32.const 13) ) ) ) - ;;@ (lib)/memory.ts:60:47 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:61:10 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:61:17 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:61:21 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:61:29 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:61:33 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:61:38 (i32.const 16) ) ) @@ -767,30 +569,23 @@ ) ) ) - ;;@ (lib)/memory.ts:63:8 (br $break|2) ) - ;;@ (lib)/memory.ts:65:8 (set_local $4 - ;;@ (lib)/memory.ts:65:12 (i32.load - ;;@ (lib)/memory.ts:65:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:66:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:66:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:66:35 (block (result i32) (set_local $1 (i32.add @@ -800,7 +595,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:66:26 (i32.load8_u (get_local $3) ) @@ -809,16 +603,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:67:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:67:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:67:35 (block (result i32) (set_local $1 (i32.add @@ -828,182 +619,128 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:67:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:68:8 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:68:13 (i32.const 2) ) ) (loop $continue|4 (if - ;;@ (lib)/memory.ts:69:15 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:69:20 (i32.const 18) ) (block - ;;@ (lib)/memory.ts:71:10 (i32.store - ;;@ (lib)/memory.ts:71:21 (get_local $0) - ;;@ (lib)/memory.ts:71:27 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:71:32 (i32.const 16) ) - ;;@ (lib)/memory.ts:71:37 (i32.shl - ;;@ (lib)/memory.ts:70:10 (tee_local $3 - ;;@ (lib)/memory.ts:70:14 (i32.load - ;;@ (lib)/memory.ts:70:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:70:30 (i32.const 2) ) ) ) - ;;@ (lib)/memory.ts:71:42 (i32.const 16) ) ) ) - ;;@ (lib)/memory.ts:73:10 (i32.store - ;;@ (lib)/memory.ts:73:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:73:28 (i32.const 4) ) - ;;@ (lib)/memory.ts:73:31 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:73:36 (i32.const 16) ) - ;;@ (lib)/memory.ts:73:41 (i32.shl - ;;@ (lib)/memory.ts:72:10 (tee_local $4 - ;;@ (lib)/memory.ts:72:14 (i32.load - ;;@ (lib)/memory.ts:72:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:72:30 (i32.const 6) ) ) ) - ;;@ (lib)/memory.ts:73:46 (i32.const 16) ) ) ) - ;;@ (lib)/memory.ts:75:10 (i32.store - ;;@ (lib)/memory.ts:75:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:75:28 (i32.const 8) ) - ;;@ (lib)/memory.ts:75:31 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:75:36 (i32.const 16) ) - ;;@ (lib)/memory.ts:75:41 (i32.shl - ;;@ (lib)/memory.ts:74:10 (tee_local $3 - ;;@ (lib)/memory.ts:74:14 (i32.load - ;;@ (lib)/memory.ts:74:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:74:30 (i32.const 10) ) ) ) - ;;@ (lib)/memory.ts:75:46 (i32.const 16) ) ) ) - ;;@ (lib)/memory.ts:77:10 (i32.store - ;;@ (lib)/memory.ts:77:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:77:28 (i32.const 12) ) - ;;@ (lib)/memory.ts:77:32 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:77:37 (i32.const 16) ) - ;;@ (lib)/memory.ts:77:42 (i32.shl - ;;@ (lib)/memory.ts:76:10 (tee_local $4 - ;;@ (lib)/memory.ts:76:14 (i32.load - ;;@ (lib)/memory.ts:76:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:76:30 (i32.const 14) ) ) ) - ;;@ (lib)/memory.ts:77:47 (i32.const 16) ) ) ) - ;;@ (lib)/memory.ts:78:10 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:78:17 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:78:21 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:78:29 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:78:33 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:78:38 (i32.const 16) ) ) @@ -1011,30 +748,23 @@ ) ) ) - ;;@ (lib)/memory.ts:80:8 (br $break|2) ) - ;;@ (lib)/memory.ts:82:8 (set_local $4 - ;;@ (lib)/memory.ts:82:12 (i32.load - ;;@ (lib)/memory.ts:82:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:83:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:83:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:83:35 (block (result i32) (set_local $1 (i32.add @@ -1044,182 +774,128 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:83:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:84:8 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:84:13 (i32.const 1) ) ) (loop $continue|5 (if - ;;@ (lib)/memory.ts:85:15 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:85:20 (i32.const 19) ) (block - ;;@ (lib)/memory.ts:87:10 (i32.store - ;;@ (lib)/memory.ts:87:21 (get_local $0) - ;;@ (lib)/memory.ts:87:27 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:87:32 (i32.const 8) ) - ;;@ (lib)/memory.ts:87:36 (i32.shl - ;;@ (lib)/memory.ts:86:10 (tee_local $3 - ;;@ (lib)/memory.ts:86:14 (i32.load - ;;@ (lib)/memory.ts:86:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:86:30 (i32.const 3) ) ) ) - ;;@ (lib)/memory.ts:87:41 (i32.const 24) ) ) ) - ;;@ (lib)/memory.ts:89:10 (i32.store - ;;@ (lib)/memory.ts:89:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:89:28 (i32.const 4) ) - ;;@ (lib)/memory.ts:89:31 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:89:36 (i32.const 8) ) - ;;@ (lib)/memory.ts:89:40 (i32.shl - ;;@ (lib)/memory.ts:88:10 (tee_local $4 - ;;@ (lib)/memory.ts:88:14 (i32.load - ;;@ (lib)/memory.ts:88:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:88:30 (i32.const 7) ) ) ) - ;;@ (lib)/memory.ts:89:45 (i32.const 24) ) ) ) - ;;@ (lib)/memory.ts:91:10 (i32.store - ;;@ (lib)/memory.ts:91:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:91:28 (i32.const 8) ) - ;;@ (lib)/memory.ts:91:31 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:91:36 (i32.const 8) ) - ;;@ (lib)/memory.ts:91:40 (i32.shl - ;;@ (lib)/memory.ts:90:10 (tee_local $3 - ;;@ (lib)/memory.ts:90:14 (i32.load - ;;@ (lib)/memory.ts:90:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:90:30 (i32.const 11) ) ) ) - ;;@ (lib)/memory.ts:91:45 (i32.const 24) ) ) ) - ;;@ (lib)/memory.ts:93:10 (i32.store - ;;@ (lib)/memory.ts:93:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:93:28 (i32.const 12) ) - ;;@ (lib)/memory.ts:93:32 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:93:37 (i32.const 8) ) - ;;@ (lib)/memory.ts:93:41 (i32.shl - ;;@ (lib)/memory.ts:92:10 (tee_local $4 - ;;@ (lib)/memory.ts:92:14 (i32.load - ;;@ (lib)/memory.ts:92:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:92:30 (i32.const 15) ) ) ) - ;;@ (lib)/memory.ts:93:46 (i32.const 24) ) ) ) - ;;@ (lib)/memory.ts:94:10 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:94:17 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:94:21 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:94:29 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:94:33 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:94:38 (i32.const 16) ) ) @@ -1229,29 +905,22 @@ ) ) ) - ;;@ (lib)/memory.ts:101:2 (if - ;;@ (lib)/memory.ts:101:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:101:10 (i32.const 16) ) - ;;@ (lib)/memory.ts:101:14 (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:102:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:102:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:102:31 (block (result i32) (set_local $1 (i32.add @@ -1261,7 +930,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:102:22 (i32.load8_u (get_local $3) ) @@ -1270,16 +938,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:103:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:103:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:103:31 (block (result i32) (set_local $1 (i32.add @@ -1289,7 +954,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:103:22 (i32.load8_u (get_local $3) ) @@ -1298,16 +962,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:104:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:104:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:104:31 (block (result i32) (set_local $1 (i32.add @@ -1317,7 +978,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:104:22 (i32.load8_u (get_local $3) ) @@ -1326,16 +986,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:105:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:105:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:105:31 (block (result i32) (set_local $1 (i32.add @@ -1345,7 +1002,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:105:22 (i32.load8_u (get_local $3) ) @@ -1354,16 +1010,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:106:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:106:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:106:31 (block (result i32) (set_local $1 (i32.add @@ -1373,7 +1026,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:106:22 (i32.load8_u (get_local $3) ) @@ -1382,16 +1034,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:107:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:107:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:107:31 (block (result i32) (set_local $1 (i32.add @@ -1401,7 +1050,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:107:22 (i32.load8_u (get_local $3) ) @@ -1410,16 +1058,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:108:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:108:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:108:31 (block (result i32) (set_local $1 (i32.add @@ -1429,7 +1074,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:108:22 (i32.load8_u (get_local $3) ) @@ -1438,16 +1082,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:109:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:109:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:109:31 (block (result i32) (set_local $1 (i32.add @@ -1457,7 +1098,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:109:22 (i32.load8_u (get_local $3) ) @@ -1466,16 +1106,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:110:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:110:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:110:31 (block (result i32) (set_local $1 (i32.add @@ -1485,7 +1122,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:110:22 (i32.load8_u (get_local $3) ) @@ -1494,16 +1130,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:111:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:111:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:111:31 (block (result i32) (set_local $1 (i32.add @@ -1513,7 +1146,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:111:22 (i32.load8_u (get_local $3) ) @@ -1522,16 +1154,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:112:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:112:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:112:31 (block (result i32) (set_local $1 (i32.add @@ -1541,7 +1170,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:112:22 (i32.load8_u (get_local $3) ) @@ -1550,16 +1178,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:113:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:113:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:113:31 (block (result i32) (set_local $1 (i32.add @@ -1569,7 +1194,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:113:22 (i32.load8_u (get_local $3) ) @@ -1578,16 +1202,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:114:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:114:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:114:31 (block (result i32) (set_local $1 (i32.add @@ -1597,7 +1218,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:114:22 (i32.load8_u (get_local $3) ) @@ -1606,16 +1226,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:115:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:115:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:115:31 (block (result i32) (set_local $1 (i32.add @@ -1625,7 +1242,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:115:22 (i32.load8_u (get_local $3) ) @@ -1634,16 +1250,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:116:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:116:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:116:31 (block (result i32) (set_local $1 (i32.add @@ -1653,7 +1266,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:116:22 (i32.load8_u (get_local $3) ) @@ -1662,16 +1274,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:117:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:117:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:117:31 (block (result i32) (set_local $1 (i32.add @@ -1681,7 +1290,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:117:22 (i32.load8_u (get_local $3) ) @@ -1689,29 +1297,22 @@ ) ) ) - ;;@ (lib)/memory.ts:119:2 (if - ;;@ (lib)/memory.ts:119:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:119:10 (i32.const 8) ) - ;;@ (lib)/memory.ts:119:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:120:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:120:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:120:31 (block (result i32) (set_local $1 (i32.add @@ -1721,7 +1322,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:120:22 (i32.load8_u (get_local $3) ) @@ -1730,16 +1330,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:121:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:121:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:121:31 (block (result i32) (set_local $1 (i32.add @@ -1749,7 +1346,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:121:22 (i32.load8_u (get_local $3) ) @@ -1758,16 +1354,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:122:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:122:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:122:31 (block (result i32) (set_local $1 (i32.add @@ -1777,7 +1370,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:122:22 (i32.load8_u (get_local $3) ) @@ -1786,16 +1378,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:123:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:123:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:123:31 (block (result i32) (set_local $1 (i32.add @@ -1805,7 +1394,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:123:22 (i32.load8_u (get_local $3) ) @@ -1814,16 +1402,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:124:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:124:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:124:31 (block (result i32) (set_local $1 (i32.add @@ -1833,7 +1418,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:124:22 (i32.load8_u (get_local $3) ) @@ -1842,16 +1426,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:125:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:125:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:125:31 (block (result i32) (set_local $1 (i32.add @@ -1861,7 +1442,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:125:22 (i32.load8_u (get_local $3) ) @@ -1870,16 +1450,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:126:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:126:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:126:31 (block (result i32) (set_local $1 (i32.add @@ -1889,7 +1466,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:126:22 (i32.load8_u (get_local $3) ) @@ -1898,16 +1474,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:127:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:127:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:127:31 (block (result i32) (set_local $1 (i32.add @@ -1917,7 +1490,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:127:22 (i32.load8_u (get_local $3) ) @@ -1925,29 +1497,22 @@ ) ) ) - ;;@ (lib)/memory.ts:129:2 (if - ;;@ (lib)/memory.ts:129:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:129:10 (i32.const 4) ) - ;;@ (lib)/memory.ts:129:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:130:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:130:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:130:31 (block (result i32) (set_local $1 (i32.add @@ -1957,7 +1522,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:130:22 (i32.load8_u (get_local $3) ) @@ -1966,16 +1530,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:131:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:131:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:131:31 (block (result i32) (set_local $1 (i32.add @@ -1985,7 +1546,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:131:22 (i32.load8_u (get_local $3) ) @@ -1994,16 +1554,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:132:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:132:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:132:31 (block (result i32) (set_local $1 (i32.add @@ -2013,7 +1570,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:132:22 (i32.load8_u (get_local $3) ) @@ -2022,16 +1578,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:133:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:133:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:133:31 (block (result i32) (set_local $1 (i32.add @@ -2041,7 +1594,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:133:22 (i32.load8_u (get_local $3) ) @@ -2049,29 +1601,22 @@ ) ) ) - ;;@ (lib)/memory.ts:135:2 (if - ;;@ (lib)/memory.ts:135:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:135:10 (i32.const 2) ) - ;;@ (lib)/memory.ts:135:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:136:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:136:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:136:31 (block (result i32) (set_local $1 (i32.add @@ -2081,7 +1626,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:136:22 (i32.load8_u (get_local $3) ) @@ -2090,16 +1634,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:137:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:137:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:137:31 (block (result i32) (set_local $1 (i32.add @@ -2109,7 +1650,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:137:22 (i32.load8_u (get_local $3) ) @@ -2117,28 +1657,21 @@ ) ) ) - ;;@ (lib)/memory.ts:139:2 (if - ;;@ (lib)/memory.ts:139:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:139:10 (i32.const 1) ) - ;;@ (lib)/memory.ts:140:14 (block (set_local $3 (get_local $0) ) - ;;@ (lib)/memory.ts:140:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:140:31 (block (result i32) (set_local $3 (get_local $1) ) - ;;@ (lib)/memory.ts:140:22 (i32.load8_u (get_local $3) ) @@ -2149,113 +1682,78 @@ ) (func "$(lib)/memory/move_memory" (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - ;;@ (lib)/memory.ts:148:2 (if - ;;@ (lib)/memory.ts:148:6 (i32.eq (get_local $0) - ;;@ (lib)/memory.ts:148:14 (get_local $1) ) - ;;@ (lib)/memory.ts:149:4 (return) ) - ;;@ (lib)/memory.ts:150:2 (if - ;;@ (lib)/memory.ts:150:6 (i32.and (if (result i32) (tee_local $3 (i32.le_u (i32.add (get_local $1) - ;;@ (lib)/memory.ts:150:12 (get_local $2) ) - ;;@ (lib)/memory.ts:150:17 (get_local $0) ) ) (get_local $3) - ;;@ (lib)/memory.ts:150:25 (i32.le_u (i32.add (get_local $0) - ;;@ (lib)/memory.ts:150:32 (get_local $2) ) - ;;@ (lib)/memory.ts:150:37 (get_local $1) ) ) (i32.const 1) ) - ;;@ (lib)/memory.ts:150:42 (block - ;;@ (lib)/memory.ts:151:4 (call "$(lib)/memory/copy_memory" - ;;@ (lib)/memory.ts:151:16 (get_local $0) - ;;@ (lib)/memory.ts:151:22 (get_local $1) - ;;@ (lib)/memory.ts:151:27 (get_local $2) ) - ;;@ (lib)/memory.ts:152:4 (return) ) ) - ;;@ (lib)/memory.ts:154:2 (if - ;;@ (lib)/memory.ts:154:6 (i32.lt_u (get_local $0) - ;;@ (lib)/memory.ts:154:13 (get_local $1) ) - ;;@ (lib)/memory.ts:154:18 (block - ;;@ (lib)/memory.ts:155:4 (if - ;;@ (lib)/memory.ts:155:8 (i32.eq (i32.rem_u (get_local $1) - ;;@ (lib)/memory.ts:155:14 (i32.const 8) ) - ;;@ (lib)/memory.ts:155:19 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:155:26 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:155:29 (block (loop $continue|0 (if - ;;@ (lib)/memory.ts:156:13 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:156:20 (i32.const 8) ) (block - ;;@ (lib)/memory.ts:157:8 (if - ;;@ (lib)/memory.ts:157:12 (i32.eqz - ;;@ (lib)/memory.ts:157:13 (get_local $2) ) - ;;@ (lib)/memory.ts:158:10 (return) ) - ;;@ (lib)/memory.ts:159:8 (set_local $2 (i32.sub - ;;@ (lib)/memory.ts:159:10 (get_local $2) (i32.const 1) ) @@ -2263,16 +1761,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:160:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:160:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:160:35 (block (result i32) (set_local $1 (i32.add @@ -2282,7 +1777,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:160:26 (i32.load8_u (get_local $3) ) @@ -2294,44 +1788,32 @@ ) (loop $continue|1 (if - ;;@ (lib)/memory.ts:162:13 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:162:18 (i32.const 8) ) (block - ;;@ (lib)/memory.ts:163:8 (i64.store - ;;@ (lib)/memory.ts:163:19 (get_local $0) - ;;@ (lib)/memory.ts:163:25 (i64.load - ;;@ (lib)/memory.ts:163:35 (get_local $1) ) ) - ;;@ (lib)/memory.ts:164:8 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:164:13 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:165:8 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:165:16 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:166:8 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:166:15 (i32.const 8) ) ) @@ -2343,22 +1825,18 @@ ) (loop $continue|2 (if - ;;@ (lib)/memory.ts:169:11 (get_local $2) (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:170:16 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:170:6 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:170:33 (block (result i32) (set_local $1 (i32.add @@ -2368,16 +1846,13 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:170:24 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:171:6 (set_local $2 (i32.sub - ;;@ (lib)/memory.ts:171:8 (get_local $2) (i32.const 1) ) @@ -2387,70 +1862,48 @@ ) ) ) - ;;@ (lib)/memory.ts:173:9 (block - ;;@ (lib)/memory.ts:174:4 (if - ;;@ (lib)/memory.ts:174:8 (i32.eq (i32.rem_u (get_local $1) - ;;@ (lib)/memory.ts:174:14 (i32.const 8) ) - ;;@ (lib)/memory.ts:174:19 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:174:26 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:174:29 (block (loop $continue|3 (if - ;;@ (lib)/memory.ts:175:13 (i32.rem_u (i32.add - ;;@ (lib)/memory.ts:175:14 (get_local $0) - ;;@ (lib)/memory.ts:175:21 (get_local $2) ) - ;;@ (lib)/memory.ts:175:26 (i32.const 8) ) (block - ;;@ (lib)/memory.ts:176:8 (if - ;;@ (lib)/memory.ts:176:12 (i32.eqz - ;;@ (lib)/memory.ts:176:13 (get_local $2) ) - ;;@ (lib)/memory.ts:177:10 (return) ) - ;;@ (lib)/memory.ts:178:8 (i32.store8 - ;;@ (lib)/memory.ts:178:18 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:178:25 (tee_local $2 (i32.sub - ;;@ (lib)/memory.ts:178:27 (get_local $2) (i32.const 1) ) ) ) - ;;@ (lib)/memory.ts:178:30 (i32.load8_u - ;;@ (lib)/memory.ts:178:39 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:178:45 (get_local $2) ) ) @@ -2461,33 +1914,24 @@ ) (loop $continue|4 (if - ;;@ (lib)/memory.ts:180:13 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:180:18 (i32.const 8) ) (block - ;;@ (lib)/memory.ts:182:8 (i64.store - ;;@ (lib)/memory.ts:182:19 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:181:8 (tee_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:181:13 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:182:29 (i64.load - ;;@ (lib)/memory.ts:182:39 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:182:45 (get_local $2) ) ) @@ -2500,29 +1944,21 @@ ) (loop $continue|5 (if - ;;@ (lib)/memory.ts:185:11 (get_local $2) (block - ;;@ (lib)/memory.ts:186:6 (i32.store8 - ;;@ (lib)/memory.ts:186:16 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:186:23 (tee_local $2 (i32.sub - ;;@ (lib)/memory.ts:186:25 (get_local $2) (i32.const 1) ) ) ) - ;;@ (lib)/memory.ts:186:28 (i32.load8_u - ;;@ (lib)/memory.ts:186:37 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:186:43 (get_local $2) ) ) @@ -2534,14 +1970,14 @@ ) ) ) - (func "$(lib)/array/Array#__grow" (; 5 ;) (type $iiv) (param $0 i32) (param $1 i32) + (func "$(lib)/allocator/arena/free_memory" (; 5 ;) (type $iv) (param $0 i32) + (nop) + ) + (func "$(lib)/array/Array#__grow" (; 6 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) - ;;@ (lib)/array.ts:8:4 (if - ;;@ (lib)/array.ts:8:11 (i32.le_s (get_local $1) - ;;@ (lib)/array.ts:8:25 (i32.load offset=4 (get_local $0) ) @@ -2556,121 +1992,89 @@ (unreachable) ) ) - ;;@ (lib)/array.ts:9:4 (set_local $2 - ;;@ (lib)/array.ts:9:20 (call "$(lib)/allocator/arena/allocate_memory" - ;;@ (lib)/array.ts:9:36 (i32.mul (get_local $1) - ;;@ (lib)/array.ts:9:57 (i32.const 4) ) ) ) - ;;@ (lib)/array.ts:10:4 (if - ;;@ (lib)/array.ts:10:8 (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:10:23 (block - ;;@ (lib)/array.ts:11:6 (call "$(lib)/memory/move_memory" - ;;@ (lib)/array.ts:11:18 (get_local $2) - ;;@ (lib)/array.ts:11:29 (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:11:44 (i32.mul (i32.load offset=4 (get_local $0) ) - ;;@ (lib)/array.ts:11:62 (i32.const 4) ) ) - (drop - ;;@ (lib)/array.ts:12:18 + (call "$(lib)/allocator/arena/free_memory" (i32.load (get_local $0) ) ) ) ) - ;;@ (lib)/array.ts:14:4 (i32.store (get_local $0) - ;;@ (lib)/array.ts:14:20 (get_local $2) ) - ;;@ (lib)/array.ts:15:4 (i32.store offset=4 (get_local $0) - ;;@ (lib)/array.ts:15:22 (get_local $1) ) ) - (func "$(lib)/array/Array#push" (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func "$(lib)/array/Array#push" (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - ;;@ (lib)/array.ts:78:4 (if - ;;@ (lib)/array.ts:78:8 (i32.eq (i32.load offset=8 (get_local $0) ) - ;;@ (lib)/array.ts:78:25 (i32.load offset=4 (get_local $0) ) ) - ;;@ (lib)/array.ts:79:11 (call "$(lib)/array/Array#__grow" - ;;@ (lib)/array.ts:79:6 (get_local $0) - ;;@ (lib)/array.ts:79:18 (if (result i32) (i32.load offset=4 (get_local $0) ) - ;;@ (lib)/array.ts:79:36 (i32.shl (i32.load offset=4 (get_local $0) ) - ;;@ (lib)/array.ts:79:55 (i32.const 1) ) - ;;@ (lib)/array.ts:79:59 (i32.const 1) ) ) ) - ;;@ (lib)/array.ts:80:4 (i32.store - ;;@ (lib)/array.ts:80:13 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:80:29 (i32.mul (i32.load offset=8 (get_local $0) ) - ;;@ (lib)/array.ts:80:45 (i32.const 4) ) ) - ;;@ (lib)/array.ts:80:58 (get_local $1) ) (i32.store offset=8 - ;;@ (lib)/array.ts:81:13 (get_local $0) (tee_local $2 (i32.add @@ -2683,62 +2087,46 @@ ) (get_local $2) ) - (func "$(lib)/array/Array#__get" (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - ;;@ (lib)/array.ts:39:4 + (func "$(lib)/array/Array#__get" (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (if - ;;@ (lib)/array.ts:39:8 (i32.ge_u (get_local $1) - ;;@ (lib)/array.ts:39:22 (i32.load offset=4 (get_local $0) ) ) - ;;@ (lib)/array.ts:40:6 (unreachable) ) - ;;@ (lib)/array.ts:41:11 (i32.load - ;;@ (lib)/array.ts:41:19 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:41:35 (i32.mul (get_local $1) - ;;@ (lib)/array.ts:41:50 (i32.const 4) ) ) ) ) - (func "$(lib)/array/Array#pop" (; 8 ;) (type $ii) (param $0 i32) (result i32) + (func "$(lib)/array/Array#pop" (; 9 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - ;;@ (lib)/array.ts:85:4 (if - ;;@ (lib)/array.ts:85:8 (i32.lt_s (i32.load offset=8 (get_local $0) ) - ;;@ (lib)/array.ts:85:24 (i32.const 1) ) - ;;@ (lib)/array.ts:86:6 (unreachable) ) - ;;@ (lib)/array.ts:87:11 (i32.load - ;;@ (lib)/array.ts:87:19 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:87:35 (block (result i32) (i32.store offset=8 - ;;@ (lib)/array.ts:87:37 (get_local $0) (tee_local $1 (i32.sub @@ -2749,57 +2137,42 @@ ) ) ) - ;;@ (lib)/array.ts:87:35 (i32.mul (get_local $1) - ;;@ (lib)/array.ts:87:53 (i32.const 4) ) ) ) ) ) - (func "$(lib)/array/Array#unshift" (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func "$(lib)/array/Array#unshift" (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - ;;@ (lib)/array.ts:102:4 (if - ;;@ (lib)/array.ts:102:8 (i32.eq (i32.load offset=8 (get_local $0) ) - ;;@ (lib)/array.ts:101:4 (tee_local $2 - ;;@ (lib)/array.ts:101:22 (i32.load offset=4 (get_local $0) ) ) ) - ;;@ (lib)/array.ts:102:38 (block - ;;@ (lib)/array.ts:105:6 (if - ;;@ (lib)/array.ts:105:13 (i32.le_s - ;;@ (lib)/array.ts:104:6 (tee_local $3 (select - ;;@ (lib)/array.ts:104:43 (i32.shl (get_local $2) - ;;@ (lib)/array.ts:104:58 (i32.const 1) ) - ;;@ (lib)/array.ts:104:62 (i32.const 1) - ;;@ (lib)/array.ts:104:29 (get_local $2) ) ) - ;;@ (lib)/array.ts:105:27 (i32.load offset=4 (get_local $0) ) @@ -2814,99 +2187,71 @@ (unreachable) ) ) - ;;@ (lib)/array.ts:106:6 (set_local $4 - ;;@ (lib)/array.ts:106:22 (call "$(lib)/allocator/arena/allocate_memory" - ;;@ (lib)/array.ts:106:38 (i32.mul (get_local $3) - ;;@ (lib)/array.ts:106:59 (i32.const 4) ) ) ) - ;;@ (lib)/array.ts:107:6 (if - ;;@ (lib)/array.ts:107:10 (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:107:25 (block - ;;@ (lib)/array.ts:108:8 (call "$(lib)/memory/move_memory" - ;;@ (lib)/array.ts:108:20 (i32.add (get_local $4) - ;;@ (lib)/array.ts:108:32 (i32.const 4) ) - ;;@ (lib)/array.ts:108:45 (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:108:60 (i32.mul (get_local $2) - ;;@ (lib)/array.ts:108:74 (i32.const 4) ) ) - (drop - ;;@ (lib)/array.ts:109:20 + (call "$(lib)/allocator/arena/free_memory" (i32.load (get_local $0) ) ) ) ) - ;;@ (lib)/array.ts:111:6 (i32.store (get_local $0) - ;;@ (lib)/array.ts:111:22 (get_local $4) ) - ;;@ (lib)/array.ts:112:6 (i32.store offset=4 (get_local $0) - ;;@ (lib)/array.ts:112:24 (get_local $3) ) ) - ;;@ (lib)/array.ts:114:6 (call "$(lib)/memory/move_memory" - ;;@ (lib)/array.ts:114:18 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:114:34 (i32.const 4) ) - ;;@ (lib)/array.ts:114:47 (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:114:62 (i32.mul (get_local $2) - ;;@ (lib)/array.ts:114:76 (i32.const 4) ) ) ) - ;;@ (lib)/array.ts:115:4 (i32.store - ;;@ (lib)/array.ts:115:13 (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:115:28 (get_local $1) ) (i32.store offset=8 - ;;@ (lib)/array.ts:116:13 (get_local $0) (tee_local $0 (i32.add @@ -2919,495 +2264,331 @@ ) (get_local $0) ) - (func "$(lib)/memory/set_memory" (; 10 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func "$(lib)/memory/set_memory" (; 11 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i64) (local $4 i32) - ;;@ (lib)/memory.ts:196:2 (if - ;;@ (lib)/memory.ts:196:6 (i32.eqz - ;;@ (lib)/memory.ts:196:7 (get_local $2) ) - ;;@ (lib)/memory.ts:197:4 (return) ) - ;;@ (lib)/memory.ts:198:2 (i32.store8 - ;;@ (lib)/memory.ts:198:12 (get_local $0) - ;;@ (lib)/memory.ts:198:18 (get_local $1) ) - ;;@ (lib)/memory.ts:199:2 (i32.store8 - ;;@ (lib)/memory.ts:199:12 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:199:19 (get_local $2) ) - ;;@ (lib)/memory.ts:199:23 (i32.const 1) ) - ;;@ (lib)/memory.ts:199:26 (get_local $1) ) - ;;@ (lib)/memory.ts:200:2 (if - ;;@ (lib)/memory.ts:200:6 (i32.le_u (get_local $2) - ;;@ (lib)/memory.ts:200:11 (i32.const 2) ) - ;;@ (lib)/memory.ts:201:4 (return) ) - ;;@ (lib)/memory.ts:203:2 (i32.store8 - ;;@ (lib)/memory.ts:203:12 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:203:19 (i32.const 1) ) - ;;@ (lib)/memory.ts:203:22 (get_local $1) ) - ;;@ (lib)/memory.ts:204:2 (i32.store8 - ;;@ (lib)/memory.ts:204:12 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:204:19 (i32.const 2) ) - ;;@ (lib)/memory.ts:204:22 (get_local $1) ) - ;;@ (lib)/memory.ts:205:2 (i32.store8 - ;;@ (lib)/memory.ts:205:12 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:205:19 (get_local $2) ) - ;;@ (lib)/memory.ts:205:23 (i32.const 2) ) - ;;@ (lib)/memory.ts:205:26 (get_local $1) ) - ;;@ (lib)/memory.ts:206:2 (i32.store8 - ;;@ (lib)/memory.ts:206:12 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:206:19 (get_local $2) ) - ;;@ (lib)/memory.ts:206:23 (i32.const 3) ) - ;;@ (lib)/memory.ts:206:26 (get_local $1) ) - ;;@ (lib)/memory.ts:207:2 (if - ;;@ (lib)/memory.ts:207:6 (i32.le_u (get_local $2) - ;;@ (lib)/memory.ts:207:11 (i32.const 6) ) - ;;@ (lib)/memory.ts:208:4 (return) ) - ;;@ (lib)/memory.ts:209:2 (i32.store8 - ;;@ (lib)/memory.ts:209:12 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:209:19 (i32.const 3) ) - ;;@ (lib)/memory.ts:209:22 (get_local $1) ) - ;;@ (lib)/memory.ts:210:2 (i32.store8 - ;;@ (lib)/memory.ts:210:12 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:210:19 (get_local $2) ) - ;;@ (lib)/memory.ts:210:23 (i32.const 4) ) - ;;@ (lib)/memory.ts:210:26 (get_local $1) ) - ;;@ (lib)/memory.ts:211:2 (if - ;;@ (lib)/memory.ts:211:6 (i32.le_u (get_local $2) - ;;@ (lib)/memory.ts:211:11 (i32.const 8) ) - ;;@ (lib)/memory.ts:212:4 (return) ) - ;;@ (lib)/memory.ts:223:2 (i32.store - ;;@ (lib)/memory.ts:216:2 (tee_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:215:2 (tee_local $4 - ;;@ (lib)/memory.ts:215:17 (i32.and (i32.sub (i32.const 0) - ;;@ (lib)/memory.ts:215:18 (get_local $0) ) - ;;@ (lib)/memory.ts:215:25 (i32.const 3) ) ) ) ) - ;;@ (lib)/memory.ts:220:2 (tee_local $1 - ;;@ (lib)/memory.ts:220:17 (i32.mul - ;;@ (lib)/memory.ts:220:28 (get_local $1) (i32.const 16843009) ) ) ) - ;;@ (lib)/memory.ts:224:2 (i32.store - ;;@ (lib)/memory.ts:224:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:218:2 (tee_local $2 (i32.and (i32.sub - ;;@ (lib)/memory.ts:217:2 (get_local $2) - ;;@ (lib)/memory.ts:217:7 (get_local $4) ) (i32.const -4) ) ) ) - ;;@ (lib)/memory.ts:224:24 (i32.const 4) ) - ;;@ (lib)/memory.ts:224:27 (get_local $1) ) - ;;@ (lib)/memory.ts:225:2 (if - ;;@ (lib)/memory.ts:225:6 (i32.le_u (get_local $2) - ;;@ (lib)/memory.ts:225:11 (i32.const 8) ) - ;;@ (lib)/memory.ts:226:4 (return) ) - ;;@ (lib)/memory.ts:227:2 (i32.store - ;;@ (lib)/memory.ts:227:13 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:227:20 (i32.const 4) ) - ;;@ (lib)/memory.ts:227:23 (get_local $1) ) - ;;@ (lib)/memory.ts:228:2 (i32.store - ;;@ (lib)/memory.ts:228:13 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:228:20 (i32.const 8) ) - ;;@ (lib)/memory.ts:228:23 (get_local $1) ) - ;;@ (lib)/memory.ts:229:2 (i32.store - ;;@ (lib)/memory.ts:229:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:229:20 (get_local $2) ) - ;;@ (lib)/memory.ts:229:24 (i32.const 12) ) - ;;@ (lib)/memory.ts:229:28 (get_local $1) ) - ;;@ (lib)/memory.ts:230:2 (i32.store - ;;@ (lib)/memory.ts:230:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:230:20 (get_local $2) ) - ;;@ (lib)/memory.ts:230:24 (i32.const 8) ) - ;;@ (lib)/memory.ts:230:27 (get_local $1) ) - ;;@ (lib)/memory.ts:231:2 (if - ;;@ (lib)/memory.ts:231:6 (i32.le_u (get_local $2) - ;;@ (lib)/memory.ts:231:11 (i32.const 24) ) - ;;@ (lib)/memory.ts:232:4 (return) ) - ;;@ (lib)/memory.ts:233:2 (i32.store - ;;@ (lib)/memory.ts:233:13 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:233:20 (i32.const 12) ) - ;;@ (lib)/memory.ts:233:24 (get_local $1) ) - ;;@ (lib)/memory.ts:234:2 (i32.store - ;;@ (lib)/memory.ts:234:13 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:234:20 (i32.const 16) ) - ;;@ (lib)/memory.ts:234:24 (get_local $1) ) - ;;@ (lib)/memory.ts:235:2 (i32.store - ;;@ (lib)/memory.ts:235:13 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:235:20 (i32.const 20) ) - ;;@ (lib)/memory.ts:235:24 (get_local $1) ) - ;;@ (lib)/memory.ts:236:2 (i32.store - ;;@ (lib)/memory.ts:236:13 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:236:20 (i32.const 24) ) - ;;@ (lib)/memory.ts:236:24 (get_local $1) ) - ;;@ (lib)/memory.ts:237:2 (i32.store - ;;@ (lib)/memory.ts:237:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:237:20 (get_local $2) ) - ;;@ (lib)/memory.ts:237:24 (i32.const 28) ) - ;;@ (lib)/memory.ts:237:28 (get_local $1) ) - ;;@ (lib)/memory.ts:238:2 (i32.store - ;;@ (lib)/memory.ts:238:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:238:20 (get_local $2) ) - ;;@ (lib)/memory.ts:238:24 (i32.const 24) ) - ;;@ (lib)/memory.ts:238:28 (get_local $1) ) - ;;@ (lib)/memory.ts:239:2 (i32.store - ;;@ (lib)/memory.ts:239:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:239:20 (get_local $2) ) - ;;@ (lib)/memory.ts:239:24 (i32.const 20) ) - ;;@ (lib)/memory.ts:239:28 (get_local $1) ) - ;;@ (lib)/memory.ts:240:2 (i32.store - ;;@ (lib)/memory.ts:240:13 (i32.sub (i32.add (get_local $0) - ;;@ (lib)/memory.ts:240:20 (get_local $2) ) - ;;@ (lib)/memory.ts:240:24 (i32.const 16) ) - ;;@ (lib)/memory.ts:240:28 (get_local $1) ) - ;;@ (lib)/memory.ts:244:2 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:243:2 (tee_local $4 - ;;@ (lib)/memory.ts:243:6 (i32.add - ;;@ (lib)/memory.ts:243:11 (i32.and - ;;@ (lib)/memory.ts:243:12 (get_local $0) - ;;@ (lib)/memory.ts:243:19 (i32.const 4) ) - ;;@ (lib)/memory.ts:243:6 (i32.const 24) ) ) ) ) - ;;@ (lib)/memory.ts:245:2 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:245:7 (get_local $4) ) ) - ;;@ (lib)/memory.ts:248:2 (set_local $3 - ;;@ (lib)/memory.ts:248:17 (i64.or (i64.extend_u/i32 (get_local $1) ) - ;;@ (lib)/memory.ts:248:28 (i64.shl - ;;@ (lib)/memory.ts:248:29 (i64.extend_u/i32 (get_local $1) ) - ;;@ (lib)/memory.ts:248:41 (i64.const 32) ) ) ) (loop $continue|0 (if - ;;@ (lib)/memory.ts:249:9 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:249:14 (i32.const 32) ) (block - ;;@ (lib)/memory.ts:250:4 (i64.store - ;;@ (lib)/memory.ts:250:15 (get_local $0) - ;;@ (lib)/memory.ts:250:21 (get_local $3) ) - ;;@ (lib)/memory.ts:251:4 (i64.store - ;;@ (lib)/memory.ts:251:15 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:251:22 (i32.const 8) ) - ;;@ (lib)/memory.ts:251:25 (get_local $3) ) - ;;@ (lib)/memory.ts:252:4 (i64.store - ;;@ (lib)/memory.ts:252:15 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:252:22 (i32.const 16) ) - ;;@ (lib)/memory.ts:252:26 (get_local $3) ) - ;;@ (lib)/memory.ts:253:4 (i64.store - ;;@ (lib)/memory.ts:253:15 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:253:22 (i32.const 24) ) - ;;@ (lib)/memory.ts:253:26 (get_local $3) ) - ;;@ (lib)/memory.ts:254:4 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:254:9 (i32.const 32) ) ) - ;;@ (lib)/memory.ts:255:4 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:255:12 (i32.const 32) ) ) @@ -3416,88 +2597,63 @@ ) ) ) - (func "$(lib)/array/Array#shift" (; 11 ;) (type $ii) (param $0 i32) (result i32) + (func "$(lib)/array/Array#shift" (; 12 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - ;;@ (lib)/array.ts:91:4 (if - ;;@ (lib)/array.ts:91:8 (i32.lt_s (i32.load offset=8 (get_local $0) ) - ;;@ (lib)/array.ts:91:24 (i32.const 1) ) - ;;@ (lib)/array.ts:92:6 (unreachable) ) - ;;@ (lib)/array.ts:93:4 (set_local $1 - ;;@ (lib)/array.ts:93:18 (i32.load - ;;@ (lib)/array.ts:93:26 (i32.load (get_local $0) ) ) ) - ;;@ (lib)/array.ts:94:4 (call "$(lib)/memory/move_memory" - ;;@ (lib)/array.ts:94:16 (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:94:31 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:94:47 (i32.const 4) ) - ;;@ (lib)/array.ts:94:60 (i32.mul (i32.sub - ;;@ (lib)/array.ts:94:61 (i32.load offset=4 (get_local $0) ) - ;;@ (lib)/array.ts:94:79 (i32.const 1) ) - ;;@ (lib)/array.ts:94:84 (i32.const 4) ) ) - ;;@ (lib)/array.ts:95:4 (call "$(lib)/memory/set_memory" - ;;@ (lib)/array.ts:95:15 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:95:31 (i32.mul (i32.sub - ;;@ (lib)/array.ts:95:32 (i32.load offset=4 (get_local $0) ) - ;;@ (lib)/array.ts:95:50 (i32.const 1) ) - ;;@ (lib)/array.ts:95:55 (i32.const 4) ) ) - ;;@ (lib)/array.ts:95:68 (i32.const 0) - ;;@ (lib)/array.ts:95:71 (i32.const 4) ) - ;;@ (lib)/array.ts:96:4 (i32.store offset=8 - ;;@ (lib)/array.ts:96:6 (get_local $0) (i32.sub (i32.load offset=8 @@ -3506,110 +2662,82 @@ (i32.const 1) ) ) - ;;@ (lib)/array.ts:97:11 (get_local $1) ) - (func "$(lib)/array/Array#reverse" (; 12 ;) (type $ii) (param $0 i32) (result i32) + (func "$(lib)/array/Array#reverse" (; 13 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (set_local $2 - ;;@ (lib)/array.ts:157:45 (i32.sub (i32.load offset=8 - ;;@ (lib)/array.ts:157:52 (get_local $0) ) - ;;@ (lib)/array.ts:157:68 (i32.const 1) ) ) (loop $continue|0 (if - ;;@ (lib)/array.ts:157:71 (i32.lt_u (get_local $1) - ;;@ (lib)/array.ts:157:79 (get_local $2) ) (block - ;;@ (lib)/array.ts:158:6 (set_local $3 - ;;@ (lib)/array.ts:158:17 (i32.load - ;;@ (lib)/array.ts:158:25 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:158:41 (i32.mul (get_local $1) - ;;@ (lib)/array.ts:158:49 (i32.const 4) ) ) ) ) - ;;@ (lib)/array.ts:159:6 (i32.store - ;;@ (lib)/array.ts:159:15 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:159:31 (i32.mul (get_local $1) - ;;@ (lib)/array.ts:159:39 (i32.const 4) ) ) - ;;@ (lib)/array.ts:159:52 (i32.load - ;;@ (lib)/array.ts:159:60 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:159:76 (i32.mul (get_local $2) - ;;@ (lib)/array.ts:159:83 (i32.const 4) ) ) ) ) - ;;@ (lib)/array.ts:160:6 (i32.store - ;;@ (lib)/array.ts:160:15 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:160:31 (i32.mul (get_local $2) - ;;@ (lib)/array.ts:160:38 (i32.const 4) ) ) - ;;@ (lib)/array.ts:160:51 (get_local $3) ) - ;;@ (lib)/array.ts:157:85 (set_local $1 (i32.add - ;;@ (lib)/array.ts:157:87 (get_local $1) (i32.const 1) ) ) - ;;@ (lib)/array.ts:157:94 (set_local $2 (i32.sub - ;;@ (lib)/array.ts:157:96 (get_local $2) (i32.const 1) ) @@ -3618,71 +2746,53 @@ ) ) ) - ;;@ (lib)/array.ts:162:11 (get_local $0) ) - (func "$(lib)/array/Array#indexOf" (; 13 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - ;;@ (lib)/array.ts:54:4 + (func "$(lib)/array/Array#indexOf" (; 14 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (if - ;;@ (lib)/array.ts:54:8 (i32.lt_s (get_local $2) - ;;@ (lib)/array.ts:54:20 (i32.const 0) ) - ;;@ (lib)/array.ts:55:6 (set_local $2 - ;;@ (lib)/array.ts:55:18 (i32.add (i32.load offset=8 (get_local $0) ) - ;;@ (lib)/array.ts:55:34 (get_local $2) ) ) ) (loop $continue|0 (if - ;;@ (lib)/array.ts:56:11 (i32.lt_u (get_local $2) - ;;@ (lib)/array.ts:56:28 (i32.load offset=8 (get_local $0) ) ) (block - ;;@ (lib)/array.ts:57:6 (if - ;;@ (lib)/array.ts:57:10 (i32.eq (i32.load - ;;@ (lib)/array.ts:57:18 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:57:34 (i32.mul (get_local $2) - ;;@ (lib)/array.ts:57:46 (i32.const 4) ) ) ) - ;;@ (lib)/array.ts:57:62 (get_local $1) ) - ;;@ (lib)/array.ts:58:15 (return (get_local $2) ) ) - ;;@ (lib)/array.ts:59:6 (set_local $2 (i32.add - ;;@ (lib)/array.ts:59:8 (get_local $2) (i32.const 1) ) @@ -3693,114 +2803,79 @@ ) (i32.const -1) ) - (func "$(lib)/array/Array#splice" (; 14 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) - ;;@ (lib)/array.ts:141:4 + (func "$(lib)/array/Array#splice" (; 15 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (if - ;;@ (lib)/array.ts:141:8 (i32.lt_s (get_local $2) - ;;@ (lib)/array.ts:141:22 (i32.const 1) ) - ;;@ (lib)/array.ts:142:6 (return) ) - ;;@ (lib)/array.ts:143:4 (if - ;;@ (lib)/array.ts:143:8 (i32.lt_s (get_local $1) - ;;@ (lib)/array.ts:143:16 (i32.const 0) ) - ;;@ (lib)/array.ts:145:6 (if - ;;@ (lib)/array.ts:145:10 (i32.lt_s - ;;@ (lib)/array.ts:144:6 (tee_local $1 - ;;@ (lib)/array.ts:144:14 (i32.add (i32.load offset=8 (get_local $0) ) - ;;@ (lib)/array.ts:144:30 (get_local $1) ) ) - ;;@ (lib)/array.ts:145:18 (i32.const 0) ) - ;;@ (lib)/array.ts:146:8 (set_local $1 - ;;@ (lib)/array.ts:146:16 (i32.const 0) ) - ;;@ (lib)/array.ts:147:11 (if - ;;@ (lib)/array.ts:147:15 (i32.ge_s (get_local $1) - ;;@ (lib)/array.ts:147:24 (i32.load offset=8 (get_local $0) ) ) - ;;@ (lib)/array.ts:148:8 (return) ) ) - ;;@ (lib)/array.ts:149:11 (if - ;;@ (lib)/array.ts:149:15 (i32.ge_s (get_local $1) - ;;@ (lib)/array.ts:149:24 (i32.load offset=8 (get_local $0) ) ) - ;;@ (lib)/array.ts:150:6 (return) ) ) - ;;@ (lib)/array.ts:152:4 (call "$(lib)/memory/move_memory" - ;;@ (lib)/array.ts:152:16 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:152:32 (i32.mul (get_local $1) - ;;@ (lib)/array.ts:152:47 (i32.const 4) ) ) - ;;@ (lib)/array.ts:152:60 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/array.ts:152:76 (i32.mul (i32.add - ;;@ (lib)/array.ts:152:84 (get_local $1) - ;;@ (lib)/array.ts:151:4 (tee_local $2 - ;;@ (lib)/array.ts:151:18 (select - ;;@ (lib)/array.ts:151:22 (get_local $2) (tee_local $1 - ;;@ (lib)/array.ts:151:35 (i32.sub (i32.load offset=8 (get_local $0) ) - ;;@ (lib)/array.ts:151:51 (get_local $1) ) ) @@ -3811,44 +2886,34 @@ ) ) ) - ;;@ (lib)/array.ts:152:107 (i32.const 4) ) ) - ;;@ (lib)/array.ts:152:120 (i32.mul (get_local $2) - ;;@ (lib)/array.ts:152:134 (i32.const 4) ) ) - ;;@ (lib)/array.ts:153:4 (i32.store offset=8 (get_local $0) (i32.sub (i32.load offset=8 (get_local $0) ) - ;;@ (lib)/array.ts:153:21 (get_local $2) ) ) ) - (func $start (; 15 ;) (type $v) + (func $start (; 16 ;) (type $v) (set_global "$(lib)/allocator/arena/HEAP_OFFSET" - ;;@ (lib)/allocator/arena.ts:11:25 (get_global $HEAP_BASE) ) (set_global $std/array/arr - ;;@ std/array.ts:3:10 (call "$(lib)/allocator/arena/allocate_memory" - ;;@ std/array.ts:3:44 (i32.const 12) ) ) - ;;@ std/array.ts:5:0 (if - ;;@ std/array.ts:5:7 (call "$(lib)/array/Array#get:length" (get_global $std/array/arr) ) @@ -3862,9 +2927,7 @@ (unreachable) ) ) - ;;@ std/array.ts:6:0 (if - ;;@ std/array.ts:6:7 (i32.load offset=4 (get_global $std/array/arr) ) @@ -3878,25 +2941,18 @@ (unreachable) ) ) - ;;@ std/array.ts:8:4 (drop (call "$(lib)/array/Array#push" - ;;@ std/array.ts:8:0 (get_global $std/array/arr) - ;;@ std/array.ts:8:9 (i32.const 42) ) ) - ;;@ std/array.ts:10:0 (if - ;;@ std/array.ts:10:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:10:11 (i32.const 0) ) - ;;@ std/array.ts:10:17 (i32.const 42) ) (block @@ -3909,14 +2965,11 @@ (unreachable) ) ) - ;;@ std/array.ts:11:0 (if - ;;@ std/array.ts:11:7 (i32.ne (call "$(lib)/array/Array#get:length" (get_global $std/array/arr) ) - ;;@ std/array.ts:11:21 (i32.const 1) ) (block @@ -3929,14 +2982,11 @@ (unreachable) ) ) - ;;@ std/array.ts:12:0 (if - ;;@ std/array.ts:12:7 (i32.ne (i32.load offset=4 (get_global $std/array/arr) ) - ;;@ std/array.ts:12:25 (i32.const 1) ) (block @@ -3950,18 +3000,13 @@ ) ) (set_global $std/array/i - ;;@ std/array.ts:14:12 (call "$(lib)/array/Array#pop" - ;;@ std/array.ts:14:8 (get_global $std/array/arr) ) ) - ;;@ std/array.ts:16:0 (if - ;;@ std/array.ts:16:7 (i32.ne (get_global $std/array/i) - ;;@ std/array.ts:16:12 (i32.const 42) ) (block @@ -3974,9 +3019,7 @@ (unreachable) ) ) - ;;@ std/array.ts:17:0 (if - ;;@ std/array.ts:17:7 (call "$(lib)/array/Array#get:length" (get_global $std/array/arr) ) @@ -3990,14 +3033,11 @@ (unreachable) ) ) - ;;@ std/array.ts:18:0 (if - ;;@ std/array.ts:18:7 (i32.ne (i32.load offset=4 (get_global $std/array/arr) ) - ;;@ std/array.ts:18:25 (i32.const 1) ) (block @@ -4010,23 +3050,17 @@ (unreachable) ) ) - ;;@ std/array.ts:20:4 (drop (call "$(lib)/array/Array#push" - ;;@ std/array.ts:20:0 (get_global $std/array/arr) - ;;@ std/array.ts:20:9 (i32.const 43) ) ) - ;;@ std/array.ts:22:0 (if - ;;@ std/array.ts:22:7 (i32.ne (call "$(lib)/array/Array#get:length" (get_global $std/array/arr) ) - ;;@ std/array.ts:22:21 (i32.const 1) ) (block @@ -4039,14 +3073,11 @@ (unreachable) ) ) - ;;@ std/array.ts:23:0 (if - ;;@ std/array.ts:23:7 (i32.ne (i32.load offset=4 (get_global $std/array/arr) ) - ;;@ std/array.ts:23:25 (i32.const 1) ) (block @@ -4059,16 +3090,12 @@ (unreachable) ) ) - ;;@ std/array.ts:24:0 (if - ;;@ std/array.ts:24:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:24:11 (i32.const 0) ) - ;;@ std/array.ts:24:17 (i32.const 43) ) (block @@ -4081,23 +3108,17 @@ (unreachable) ) ) - ;;@ std/array.ts:26:4 (drop (call "$(lib)/array/Array#push" - ;;@ std/array.ts:26:0 (get_global $std/array/arr) - ;;@ std/array.ts:26:9 (i32.const 44) ) ) - ;;@ std/array.ts:28:0 (if - ;;@ std/array.ts:28:7 (i32.ne (call "$(lib)/array/Array#get:length" (get_global $std/array/arr) ) - ;;@ std/array.ts:28:21 (i32.const 2) ) (block @@ -4110,14 +3131,11 @@ (unreachable) ) ) - ;;@ std/array.ts:29:0 (if - ;;@ std/array.ts:29:7 (i32.ne (i32.load offset=4 (get_global $std/array/arr) ) - ;;@ std/array.ts:29:25 (i32.const 2) ) (block @@ -4130,16 +3148,12 @@ (unreachable) ) ) - ;;@ std/array.ts:30:0 (if - ;;@ std/array.ts:30:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:30:11 (i32.const 0) ) - ;;@ std/array.ts:30:17 (i32.const 43) ) (block @@ -4152,16 +3166,12 @@ (unreachable) ) ) - ;;@ std/array.ts:31:0 (if - ;;@ std/array.ts:31:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:31:11 (i32.const 1) ) - ;;@ std/array.ts:31:17 (i32.const 44) ) (block @@ -4174,23 +3184,17 @@ (unreachable) ) ) - ;;@ std/array.ts:33:4 (drop (call "$(lib)/array/Array#push" - ;;@ std/array.ts:33:0 (get_global $std/array/arr) - ;;@ std/array.ts:33:9 (i32.const 45) ) ) - ;;@ std/array.ts:35:0 (if - ;;@ std/array.ts:35:7 (i32.ne (call "$(lib)/array/Array#get:length" (get_global $std/array/arr) ) - ;;@ std/array.ts:35:21 (i32.const 3) ) (block @@ -4203,14 +3207,11 @@ (unreachable) ) ) - ;;@ std/array.ts:36:0 (if - ;;@ std/array.ts:36:7 (i32.ne (i32.load offset=4 (get_global $std/array/arr) ) - ;;@ std/array.ts:36:25 (i32.const 4) ) (block @@ -4223,16 +3224,12 @@ (unreachable) ) ) - ;;@ std/array.ts:37:0 (if - ;;@ std/array.ts:37:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:37:11 (i32.const 0) ) - ;;@ std/array.ts:37:17 (i32.const 43) ) (block @@ -4245,16 +3242,12 @@ (unreachable) ) ) - ;;@ std/array.ts:38:0 (if - ;;@ std/array.ts:38:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:38:11 (i32.const 1) ) - ;;@ std/array.ts:38:17 (i32.const 44) ) (block @@ -4267,16 +3260,12 @@ (unreachable) ) ) - ;;@ std/array.ts:39:0 (if - ;;@ std/array.ts:39:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:39:11 (i32.const 2) ) - ;;@ std/array.ts:39:17 (i32.const 45) ) (block @@ -4289,23 +3278,17 @@ (unreachable) ) ) - ;;@ std/array.ts:41:4 (drop (call "$(lib)/array/Array#unshift" - ;;@ std/array.ts:41:0 (get_global $std/array/arr) - ;;@ std/array.ts:41:12 (i32.const 42) ) ) - ;;@ std/array.ts:43:0 (if - ;;@ std/array.ts:43:7 (i32.ne (call "$(lib)/array/Array#get:length" (get_global $std/array/arr) ) - ;;@ std/array.ts:43:21 (i32.const 4) ) (block @@ -4318,14 +3301,11 @@ (unreachable) ) ) - ;;@ std/array.ts:44:0 (if - ;;@ std/array.ts:44:7 (i32.ne (i32.load offset=4 (get_global $std/array/arr) ) - ;;@ std/array.ts:44:25 (i32.const 4) ) (block @@ -4338,16 +3318,12 @@ (unreachable) ) ) - ;;@ std/array.ts:45:0 (if - ;;@ std/array.ts:45:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:45:11 (i32.const 0) ) - ;;@ std/array.ts:45:17 (i32.const 42) ) (block @@ -4360,16 +3336,12 @@ (unreachable) ) ) - ;;@ std/array.ts:46:0 (if - ;;@ std/array.ts:46:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:46:11 (i32.const 1) ) - ;;@ std/array.ts:46:17 (i32.const 43) ) (block @@ -4382,16 +3354,12 @@ (unreachable) ) ) - ;;@ std/array.ts:47:0 (if - ;;@ std/array.ts:47:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:47:11 (i32.const 2) ) - ;;@ std/array.ts:47:17 (i32.const 44) ) (block @@ -4404,16 +3372,12 @@ (unreachable) ) ) - ;;@ std/array.ts:48:0 (if - ;;@ std/array.ts:48:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:48:11 (i32.const 3) ) - ;;@ std/array.ts:48:17 (i32.const 45) ) (block @@ -4426,23 +3390,17 @@ (unreachable) ) ) - ;;@ std/array.ts:50:4 (drop (call "$(lib)/array/Array#unshift" - ;;@ std/array.ts:50:0 (get_global $std/array/arr) - ;;@ std/array.ts:50:12 (i32.const 41) ) ) - ;;@ std/array.ts:52:0 (if - ;;@ std/array.ts:52:7 (i32.ne (call "$(lib)/array/Array#get:length" (get_global $std/array/arr) ) - ;;@ std/array.ts:52:21 (i32.const 5) ) (block @@ -4455,14 +3413,11 @@ (unreachable) ) ) - ;;@ std/array.ts:53:0 (if - ;;@ std/array.ts:53:7 (i32.ne (i32.load offset=4 (get_global $std/array/arr) ) - ;;@ std/array.ts:53:25 (i32.const 8) ) (block @@ -4475,16 +3430,12 @@ (unreachable) ) ) - ;;@ std/array.ts:54:0 (if - ;;@ std/array.ts:54:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:54:11 (i32.const 0) ) - ;;@ std/array.ts:54:17 (i32.const 41) ) (block @@ -4497,16 +3448,12 @@ (unreachable) ) ) - ;;@ std/array.ts:55:0 (if - ;;@ std/array.ts:55:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:55:11 (i32.const 1) ) - ;;@ std/array.ts:55:17 (i32.const 42) ) (block @@ -4519,16 +3466,12 @@ (unreachable) ) ) - ;;@ std/array.ts:56:0 (if - ;;@ std/array.ts:56:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:56:11 (i32.const 2) ) - ;;@ std/array.ts:56:17 (i32.const 43) ) (block @@ -4541,16 +3484,12 @@ (unreachable) ) ) - ;;@ std/array.ts:57:0 (if - ;;@ std/array.ts:57:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:57:11 (i32.const 3) ) - ;;@ std/array.ts:57:17 (i32.const 44) ) (block @@ -4563,16 +3502,12 @@ (unreachable) ) ) - ;;@ std/array.ts:58:0 (if - ;;@ std/array.ts:58:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:58:11 (i32.const 4) ) - ;;@ std/array.ts:58:17 (i32.const 45) ) (block @@ -4585,20 +3520,14 @@ (unreachable) ) ) - ;;@ std/array.ts:60:0 (set_global $std/array/i - ;;@ std/array.ts:60:8 (call "$(lib)/array/Array#shift" - ;;@ std/array.ts:60:4 (get_global $std/array/arr) ) ) - ;;@ std/array.ts:62:0 (if - ;;@ std/array.ts:62:7 (i32.ne (get_global $std/array/i) - ;;@ std/array.ts:62:12 (i32.const 41) ) (block @@ -4611,14 +3540,11 @@ (unreachable) ) ) - ;;@ std/array.ts:63:0 (if - ;;@ std/array.ts:63:7 (i32.ne (call "$(lib)/array/Array#get:length" (get_global $std/array/arr) ) - ;;@ std/array.ts:63:21 (i32.const 4) ) (block @@ -4631,14 +3557,11 @@ (unreachable) ) ) - ;;@ std/array.ts:64:0 (if - ;;@ std/array.ts:64:7 (i32.ne (i32.load offset=4 (get_global $std/array/arr) ) - ;;@ std/array.ts:64:25 (i32.const 8) ) (block @@ -4651,16 +3574,12 @@ (unreachable) ) ) - ;;@ std/array.ts:65:0 (if - ;;@ std/array.ts:65:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:65:11 (i32.const 0) ) - ;;@ std/array.ts:65:17 (i32.const 42) ) (block @@ -4673,16 +3592,12 @@ (unreachable) ) ) - ;;@ std/array.ts:66:0 (if - ;;@ std/array.ts:66:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:66:11 (i32.const 1) ) - ;;@ std/array.ts:66:17 (i32.const 43) ) (block @@ -4695,16 +3610,12 @@ (unreachable) ) ) - ;;@ std/array.ts:67:0 (if - ;;@ std/array.ts:67:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:67:11 (i32.const 2) ) - ;;@ std/array.ts:67:17 (i32.const 44) ) (block @@ -4717,16 +3628,12 @@ (unreachable) ) ) - ;;@ std/array.ts:68:0 (if - ;;@ std/array.ts:68:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:68:11 (i32.const 3) ) - ;;@ std/array.ts:68:17 (i32.const 45) ) (block @@ -4739,20 +3646,14 @@ (unreachable) ) ) - ;;@ std/array.ts:70:0 (set_global $std/array/i - ;;@ std/array.ts:70:8 (call "$(lib)/array/Array#pop" - ;;@ std/array.ts:70:4 (get_global $std/array/arr) ) ) - ;;@ std/array.ts:72:0 (if - ;;@ std/array.ts:72:7 (i32.ne (get_global $std/array/i) - ;;@ std/array.ts:72:12 (i32.const 45) ) (block @@ -4765,14 +3666,11 @@ (unreachable) ) ) - ;;@ std/array.ts:73:0 (if - ;;@ std/array.ts:73:7 (i32.ne (call "$(lib)/array/Array#get:length" (get_global $std/array/arr) ) - ;;@ std/array.ts:73:21 (i32.const 3) ) (block @@ -4785,14 +3683,11 @@ (unreachable) ) ) - ;;@ std/array.ts:74:0 (if - ;;@ std/array.ts:74:7 (i32.ne (i32.load offset=4 (get_global $std/array/arr) ) - ;;@ std/array.ts:74:25 (i32.const 8) ) (block @@ -4805,16 +3700,12 @@ (unreachable) ) ) - ;;@ std/array.ts:75:0 (if - ;;@ std/array.ts:75:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:75:11 (i32.const 0) ) - ;;@ std/array.ts:75:17 (i32.const 42) ) (block @@ -4827,16 +3718,12 @@ (unreachable) ) ) - ;;@ std/array.ts:76:0 (if - ;;@ std/array.ts:76:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:76:11 (i32.const 1) ) - ;;@ std/array.ts:76:17 (i32.const 43) ) (block @@ -4849,16 +3736,12 @@ (unreachable) ) ) - ;;@ std/array.ts:77:0 (if - ;;@ std/array.ts:77:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:77:11 (i32.const 2) ) - ;;@ std/array.ts:77:17 (i32.const 44) ) (block @@ -4871,21 +3754,16 @@ (unreachable) ) ) - ;;@ std/array.ts:79:4 (drop (call "$(lib)/array/Array#reverse" - ;;@ std/array.ts:79:0 (get_global $std/array/arr) ) ) - ;;@ std/array.ts:81:0 (if - ;;@ std/array.ts:81:7 (i32.ne (call "$(lib)/array/Array#get:length" (get_global $std/array/arr) ) - ;;@ std/array.ts:81:21 (i32.const 3) ) (block @@ -4898,14 +3776,11 @@ (unreachable) ) ) - ;;@ std/array.ts:82:0 (if - ;;@ std/array.ts:82:7 (i32.ne (i32.load offset=4 (get_global $std/array/arr) ) - ;;@ std/array.ts:82:25 (i32.const 8) ) (block @@ -4918,16 +3793,12 @@ (unreachable) ) ) - ;;@ std/array.ts:83:0 (if - ;;@ std/array.ts:83:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:83:11 (i32.const 0) ) - ;;@ std/array.ts:83:17 (i32.const 44) ) (block @@ -4940,16 +3811,12 @@ (unreachable) ) ) - ;;@ std/array.ts:84:0 (if - ;;@ std/array.ts:84:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:84:11 (i32.const 1) ) - ;;@ std/array.ts:84:17 (i32.const 43) ) (block @@ -4962,16 +3829,12 @@ (unreachable) ) ) - ;;@ std/array.ts:85:0 (if - ;;@ std/array.ts:85:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:85:11 (i32.const 2) ) - ;;@ std/array.ts:85:17 (i32.const 42) ) (block @@ -4984,20 +3847,14 @@ (unreachable) ) ) - ;;@ std/array.ts:87:0 (set_global $std/array/i - ;;@ std/array.ts:87:8 (call "$(lib)/array/Array#indexOf" - ;;@ std/array.ts:87:4 (get_global $std/array/arr) - ;;@ std/array.ts:87:16 (i32.const 44) (i32.const 0) ) ) - ;;@ std/array.ts:89:0 (if - ;;@ std/array.ts:89:7 (get_global $std/array/i) (block (call $abort @@ -5009,23 +3866,16 @@ (unreachable) ) ) - ;;@ std/array.ts:91:0 (set_global $std/array/i - ;;@ std/array.ts:91:8 (call "$(lib)/array/Array#indexOf" - ;;@ std/array.ts:91:4 (get_global $std/array/arr) - ;;@ std/array.ts:91:16 (i32.const 42) (i32.const 0) ) ) - ;;@ std/array.ts:93:0 (if - ;;@ std/array.ts:93:7 (i32.ne (get_global $std/array/i) - ;;@ std/array.ts:93:12 (i32.const 2) ) (block @@ -5038,21 +3888,14 @@ (unreachable) ) ) - ;;@ std/array.ts:95:0 (set_global $std/array/i - ;;@ std/array.ts:95:8 (call "$(lib)/array/Array#indexOf" - ;;@ std/array.ts:95:4 (get_global $std/array/arr) - ;;@ std/array.ts:95:16 (i32.const 45) - ;;@ (lib)/array.ts:53:45 (i32.const 0) ) ) - ;;@ std/array.ts:97:0 (if - ;;@ std/array.ts:97:7 (i32.ne (get_global $std/array/i) (i32.const -1) @@ -5067,23 +3910,16 @@ (unreachable) ) ) - ;;@ std/array.ts:99:4 (call "$(lib)/array/Array#splice" - ;;@ std/array.ts:99:0 (get_global $std/array/arr) - ;;@ std/array.ts:99:11 (i32.const 1) - ;;@ std/array.ts:99:14 (i32.const 1) ) - ;;@ std/array.ts:101:0 (if - ;;@ std/array.ts:101:7 (i32.ne (call "$(lib)/array/Array#get:length" (get_global $std/array/arr) ) - ;;@ std/array.ts:101:21 (i32.const 2) ) (block @@ -5096,14 +3932,11 @@ (unreachable) ) ) - ;;@ std/array.ts:102:0 (if - ;;@ std/array.ts:102:7 (i32.ne (i32.load offset=4 (get_global $std/array/arr) ) - ;;@ std/array.ts:102:25 (i32.const 8) ) (block @@ -5116,16 +3949,12 @@ (unreachable) ) ) - ;;@ std/array.ts:103:0 (if - ;;@ std/array.ts:103:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:103:11 (i32.const 0) ) - ;;@ std/array.ts:103:17 (i32.const 44) ) (block @@ -5138,16 +3967,12 @@ (unreachable) ) ) - ;;@ std/array.ts:104:0 (if - ;;@ std/array.ts:104:7 (i32.ne (call "$(lib)/array/Array#__get" (get_global $std/array/arr) - ;;@ std/array.ts:104:11 (i32.const 1) ) - ;;@ std/array.ts:104:17 (i32.const 42) ) (block diff --git a/tests/compiler/std/array.wast b/tests/compiler/std/array.wast index bf5baca1..02c2a6b2 100644 --- a/tests/compiler/std/array.wast +++ b/tests/compiler/std/array.wast @@ -5714,140 +5714,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - CLASS_PROTOTYPE: (lib)/array/Array - PROPERTY: (lib)/array/Array#length - CLASS_PROTOTYPE: Array - CLASS_PROTOTYPE: (lib)/array/CArray - CLASS_PROTOTYPE: CArray - CLASS_PROTOTYPE: (lib)/error/Error - CLASS_PROTOTYPE: Error - CLASS_PROTOTYPE: (lib)/error/RangeError - CLASS_PROTOTYPE: RangeError - CLASS_PROTOTYPE: (lib)/map/Map - PROPERTY: (lib)/map/Map#size - CLASS_PROTOTYPE: Map - FUNCTION_PROTOTYPE: (lib)/memory/copy_memory - FUNCTION_PROTOTYPE: (lib)/memory/move_memory - FUNCTION_PROTOTYPE: move_memory - FUNCTION_PROTOTYPE: (lib)/memory/set_memory - FUNCTION_PROTOTYPE: set_memory - FUNCTION_PROTOTYPE: (lib)/memory/compare_memory - FUNCTION_PROTOTYPE: compare_memory - CLASS_PROTOTYPE: (lib)/regexp/RegExp - CLASS_PROTOTYPE: RegExp - CLASS_PROTOTYPE: (lib)/set/Set - PROPERTY: (lib)/set/Set#size - CLASS_PROTOTYPE: Set - GLOBAL: (lib)/string/EMPTY - GLOBAL: (lib)/string/HEAD - FUNCTION_PROTOTYPE: (lib)/string/allocate - CLASS_PROTOTYPE: (lib)/string/String - FUNCTION_PROTOTYPE: (lib)/string/String.__concat - FUNCTION_PROTOTYPE: (lib)/string/String.__eq - CLASS_PROTOTYPE: String - FUNCTION_PROTOTYPE: (lib)/string/isWhiteSpaceOrLineTerminator - ENUM: (lib)/string/CharCode - FUNCTION_PROTOTYPE: (lib)/string/parseInt - FUNCTION_PROTOTYPE: parseInt - FUNCTION_PROTOTYPE: (lib)/string/parseI32 - FUNCTION_PROTOTYPE: parseI32 - FUNCTION_PROTOTYPE: (lib)/string/parseI64 - FUNCTION_PROTOTYPE: parseI64 - FUNCTION_PROTOTYPE: (lib)/string/parse - FUNCTION_PROTOTYPE: (lib)/string/parseFloat - FUNCTION_PROTOTYPE: parseFloat - GLOBAL: std/array/arr - GLOBAL: std/array/i - GLOBAL: (lib)/allocator/arena/ALIGN_LOG2 - GLOBAL: (lib)/allocator/arena/ALIGN_SIZE - GLOBAL: (lib)/allocator/arena/ALIGN_MASK - GLOBAL: (lib)/allocator/arena/HEAP_OFFSET - FUNCTION_PROTOTYPE: (lib)/allocator/arena/allocate_memory - FUNCTION_PROTOTYPE: allocate_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/free_memory - FUNCTION_PROTOTYPE: free_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/reset_memory - FUNCTION_PROTOTYPE: reset_memory -[program.exports] - CLASS_PROTOTYPE: (lib)/array/Array - CLASS_PROTOTYPE: Array - CLASS_PROTOTYPE: (lib)/array/CArray - CLASS_PROTOTYPE: CArray - CLASS_PROTOTYPE: (lib)/error/Error - CLASS_PROTOTYPE: Error - CLASS_PROTOTYPE: (lib)/error/RangeError - CLASS_PROTOTYPE: RangeError - CLASS_PROTOTYPE: (lib)/map/Map - CLASS_PROTOTYPE: Map - FUNCTION_PROTOTYPE: move_memory - FUNCTION_PROTOTYPE: (lib)/memory/move_memory - FUNCTION_PROTOTYPE: set_memory - FUNCTION_PROTOTYPE: (lib)/memory/set_memory - FUNCTION_PROTOTYPE: compare_memory - FUNCTION_PROTOTYPE: (lib)/memory/compare_memory - CLASS_PROTOTYPE: (lib)/regexp/RegExp - CLASS_PROTOTYPE: RegExp - CLASS_PROTOTYPE: (lib)/set/Set - CLASS_PROTOTYPE: Set - CLASS_PROTOTYPE: (lib)/string/String - CLASS_PROTOTYPE: String - FUNCTION_PROTOTYPE: parseInt - FUNCTION_PROTOTYPE: (lib)/string/parseInt - FUNCTION_PROTOTYPE: parseI32 - FUNCTION_PROTOTYPE: (lib)/string/parseI32 - FUNCTION_PROTOTYPE: parseI64 - FUNCTION_PROTOTYPE: (lib)/string/parseI64 - FUNCTION_PROTOTYPE: parseFloat - FUNCTION_PROTOTYPE: (lib)/string/parseFloat - FUNCTION_PROTOTYPE: allocate_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/allocate_memory - FUNCTION_PROTOTYPE: free_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/free_memory - FUNCTION_PROTOTYPE: reset_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/reset_memory -;) diff --git a/tests/compiler/std/carray.optimized.wast b/tests/compiler/std/carray.optimized.wast index 4bcbeb1d..a69d9df9 100644 --- a/tests/compiler/std/carray.optimized.wast +++ b/tests/compiler/std/carray.optimized.wast @@ -11,70 +11,49 @@ (export "memory" (memory $0)) (start $start) (func "$(lib)/array/CArray#__get" (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - ;;@ (lib)/array.ts:173:4 (if - ;;@ (lib)/array.ts:173:8 (i32.lt_s (get_local $1) - ;;@ (lib)/array.ts:173:16 (i32.const 0) ) - ;;@ (lib)/array.ts:174:6 (unreachable) ) - ;;@ (lib)/array.ts:175:11 (i32.load - ;;@ (lib)/array.ts:175:19 (i32.add (get_local $0) - ;;@ (lib)/array.ts:175:45 (i32.mul (get_local $1) - ;;@ (lib)/array.ts:175:60 (i32.const 4) ) ) ) ) (func "$(lib)/array/CArray#__set" (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) - ;;@ (lib)/array.ts:180:4 (if - ;;@ (lib)/array.ts:180:8 (i32.lt_s (get_local $1) - ;;@ (lib)/array.ts:180:16 (i32.const 0) ) - ;;@ (lib)/array.ts:181:6 (unreachable) ) - ;;@ (lib)/array.ts:182:4 (i32.store - ;;@ (lib)/array.ts:182:13 (i32.add (get_local $0) - ;;@ (lib)/array.ts:182:39 (i32.mul (get_local $1) - ;;@ (lib)/array.ts:182:54 (i32.const 4) ) ) - ;;@ (lib)/array.ts:182:67 (get_local $2) ) ) (func $start (; 3 ;) (type $v) (local $0 i32) (set_global $std/carray/arr - ;;@ std/carray.ts:6:23 (get_global $HEAP_BASE) ) - ;;@ std/carray.ts:8:0 (if - ;;@ std/carray.ts:8:7 (i32.load - ;;@ std/carray.ts:8:17 (get_global $HEAP_BASE) ) (block @@ -87,14 +66,10 @@ (unreachable) ) ) - ;;@ std/carray.ts:9:0 (if - ;;@ std/carray.ts:9:7 (i32.load - ;;@ std/carray.ts:9:17 (i32.add (get_global $HEAP_BASE) - ;;@ std/carray.ts:9:29 (i32.const 4) ) ) @@ -108,12 +83,9 @@ (unreachable) ) ) - ;;@ std/carray.ts:11:0 (if - ;;@ std/carray.ts:11:7 (call "$(lib)/array/CArray#__get" (get_global $std/carray/arr) - ;;@ std/carray.ts:11:11 (i32.const 0) ) (block @@ -126,12 +98,9 @@ (unreachable) ) ) - ;;@ std/carray.ts:12:0 (if - ;;@ std/carray.ts:12:7 (call "$(lib)/array/CArray#__get" (get_global $std/carray/arr) - ;;@ std/carray.ts:12:11 (i32.const 1) ) (block @@ -144,31 +113,21 @@ (unreachable) ) ) - ;;@ std/carray.ts:14:0 (call "$(lib)/array/CArray#__set" (get_global $std/carray/arr) - ;;@ std/carray.ts:14:4 (i32.const 0) - ;;@ std/carray.ts:14:9 (i32.const 42) ) - ;;@ std/carray.ts:15:0 (call "$(lib)/array/CArray#__set" (get_global $std/carray/arr) - ;;@ std/carray.ts:15:4 (i32.const 1) - ;;@ std/carray.ts:15:9 (i32.const 24) ) - ;;@ std/carray.ts:17:0 (if - ;;@ std/carray.ts:17:7 (i32.ne (i32.load - ;;@ std/carray.ts:17:17 (get_global $HEAP_BASE) ) - ;;@ std/carray.ts:17:31 (i32.const 42) ) (block @@ -181,19 +140,14 @@ (unreachable) ) ) - ;;@ std/carray.ts:18:0 (if - ;;@ std/carray.ts:18:7 (i32.ne (i32.load - ;;@ std/carray.ts:18:17 (i32.add (get_global $HEAP_BASE) - ;;@ std/carray.ts:18:29 (i32.const 4) ) ) - ;;@ std/carray.ts:18:35 (i32.const 24) ) (block @@ -206,16 +160,12 @@ (unreachable) ) ) - ;;@ std/carray.ts:20:0 (if - ;;@ std/carray.ts:20:7 (i32.ne (call "$(lib)/array/CArray#__get" (get_global $std/carray/arr) - ;;@ std/carray.ts:20:11 (i32.const 0) ) - ;;@ std/carray.ts:20:17 (i32.const 42) ) (block @@ -228,16 +178,12 @@ (unreachable) ) ) - ;;@ std/carray.ts:21:0 (if - ;;@ std/carray.ts:21:7 (i32.ne (call "$(lib)/array/CArray#__get" (get_global $std/carray/arr) - ;;@ std/carray.ts:21:11 (i32.const 1) ) - ;;@ std/carray.ts:21:17 (i32.const 24) ) (block @@ -250,24 +196,17 @@ (unreachable) ) ) - ;;@ std/carray.ts:23:0 (if - ;;@ std/carray.ts:23:7 (block (result i32) (call "$(lib)/array/CArray#__set" - ;;@ std/carray.ts:23:8 (get_global $std/carray/arr) - ;;@ std/carray.ts:23:12 (i32.const 3) (tee_local $0 - ;;@ std/carray.ts:23:17 (i32.const 9000) ) ) - ;;@ std/carray.ts:23:7 (i32.ne (get_local $0) - ;;@ std/carray.ts:23:26 (i32.const 9000) ) ) @@ -281,19 +220,14 @@ (unreachable) ) ) - ;;@ std/carray.ts:25:0 (if - ;;@ std/carray.ts:25:7 (i32.ne (i32.load - ;;@ std/carray.ts:25:17 (i32.add (get_global $HEAP_BASE) - ;;@ std/carray.ts:25:29 (i32.const 12) ) ) - ;;@ std/carray.ts:25:36 (i32.const 9000) ) (block @@ -306,16 +240,12 @@ (unreachable) ) ) - ;;@ std/carray.ts:26:0 (if - ;;@ std/carray.ts:26:7 (i32.ne (call "$(lib)/array/CArray#__get" (get_global $std/carray/arr) - ;;@ std/carray.ts:26:11 (i32.const 3) ) - ;;@ std/carray.ts:26:17 (i32.const 9000) ) (block diff --git a/tests/compiler/std/carray.wast b/tests/compiler/std/carray.wast index fef988e8..da954e65 100644 --- a/tests/compiler/std/carray.wast +++ b/tests/compiler/std/carray.wast @@ -370,123 +370,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - CLASS_PROTOTYPE: (lib)/array/Array - PROPERTY: (lib)/array/Array#length - CLASS_PROTOTYPE: Array - CLASS_PROTOTYPE: (lib)/array/CArray - CLASS_PROTOTYPE: CArray - CLASS_PROTOTYPE: (lib)/error/Error - CLASS_PROTOTYPE: Error - CLASS_PROTOTYPE: (lib)/error/RangeError - CLASS_PROTOTYPE: RangeError - CLASS_PROTOTYPE: (lib)/map/Map - PROPERTY: (lib)/map/Map#size - CLASS_PROTOTYPE: Map - FUNCTION_PROTOTYPE: (lib)/memory/copy_memory - FUNCTION_PROTOTYPE: (lib)/memory/move_memory - FUNCTION_PROTOTYPE: move_memory - FUNCTION_PROTOTYPE: (lib)/memory/set_memory - FUNCTION_PROTOTYPE: set_memory - FUNCTION_PROTOTYPE: (lib)/memory/compare_memory - FUNCTION_PROTOTYPE: compare_memory - CLASS_PROTOTYPE: (lib)/regexp/RegExp - CLASS_PROTOTYPE: RegExp - CLASS_PROTOTYPE: (lib)/set/Set - PROPERTY: (lib)/set/Set#size - CLASS_PROTOTYPE: Set - GLOBAL: (lib)/string/EMPTY - GLOBAL: (lib)/string/HEAD - FUNCTION_PROTOTYPE: (lib)/string/allocate - CLASS_PROTOTYPE: (lib)/string/String - FUNCTION_PROTOTYPE: (lib)/string/String.__concat - FUNCTION_PROTOTYPE: (lib)/string/String.__eq - CLASS_PROTOTYPE: String - FUNCTION_PROTOTYPE: (lib)/string/isWhiteSpaceOrLineTerminator - ENUM: (lib)/string/CharCode - FUNCTION_PROTOTYPE: (lib)/string/parseInt - FUNCTION_PROTOTYPE: parseInt - FUNCTION_PROTOTYPE: (lib)/string/parseI32 - FUNCTION_PROTOTYPE: parseI32 - FUNCTION_PROTOTYPE: (lib)/string/parseI64 - FUNCTION_PROTOTYPE: parseI64 - FUNCTION_PROTOTYPE: (lib)/string/parse - FUNCTION_PROTOTYPE: (lib)/string/parseFloat - FUNCTION_PROTOTYPE: parseFloat - GLOBAL: std/carray/arr -[program.exports] - CLASS_PROTOTYPE: (lib)/array/Array - CLASS_PROTOTYPE: Array - CLASS_PROTOTYPE: (lib)/array/CArray - CLASS_PROTOTYPE: CArray - CLASS_PROTOTYPE: (lib)/error/Error - CLASS_PROTOTYPE: Error - CLASS_PROTOTYPE: (lib)/error/RangeError - CLASS_PROTOTYPE: RangeError - CLASS_PROTOTYPE: (lib)/map/Map - CLASS_PROTOTYPE: Map - FUNCTION_PROTOTYPE: move_memory - FUNCTION_PROTOTYPE: (lib)/memory/move_memory - FUNCTION_PROTOTYPE: set_memory - FUNCTION_PROTOTYPE: (lib)/memory/set_memory - FUNCTION_PROTOTYPE: compare_memory - FUNCTION_PROTOTYPE: (lib)/memory/compare_memory - CLASS_PROTOTYPE: (lib)/regexp/RegExp - CLASS_PROTOTYPE: RegExp - CLASS_PROTOTYPE: (lib)/set/Set - CLASS_PROTOTYPE: Set - CLASS_PROTOTYPE: (lib)/string/String - CLASS_PROTOTYPE: String - FUNCTION_PROTOTYPE: parseInt - FUNCTION_PROTOTYPE: (lib)/string/parseInt - FUNCTION_PROTOTYPE: parseI32 - FUNCTION_PROTOTYPE: (lib)/string/parseI32 - FUNCTION_PROTOTYPE: parseI64 - FUNCTION_PROTOTYPE: (lib)/string/parseI64 - FUNCTION_PROTOTYPE: parseFloat - FUNCTION_PROTOTYPE: (lib)/string/parseFloat -;) diff --git a/tests/compiler/std/new.optimized.wast b/tests/compiler/std/new.optimized.wast index 89abd4a0..3d582192 100644 --- a/tests/compiler/std/new.optimized.wast +++ b/tests/compiler/std/new.optimized.wast @@ -1,5 +1,6 @@ (module (type $ii (func (param i32) (result i32))) + (type $ifv (func (param i32 f32))) (type $v (func)) (global "$(lib)/allocator/arena/HEAP_OFFSET" (mut i32) (i32.const 0)) (global $std/new/aClass (mut i32) (i32.const 0)) @@ -11,89 +12,62 @@ (local $1 i32) (local $2 i32) (local $3 i32) - ;;@ (lib)/allocator/arena.ts:14:2 (if - ;;@ (lib)/allocator/arena.ts:14:6 (i32.eqz - ;;@ (lib)/allocator/arena.ts:14:7 (get_local $0) ) - ;;@ (lib)/allocator/arena.ts:14:20 (return (i32.const 0) ) ) - ;;@ (lib)/allocator/arena.ts:18:2 (if - ;;@ (lib)/allocator/arena.ts:18:6 (i32.and (if (result i32) (tee_local $0 (i32.gt_u - ;;@ (lib)/allocator/arena.ts:16:2 (tee_local $2 - ;;@ (lib)/allocator/arena.ts:16:12 (i32.and (i32.add - ;;@ (lib)/allocator/arena.ts:16:13 (i32.add - ;;@ (lib)/allocator/arena.ts:15:2 (tee_local $3 - ;;@ (lib)/allocator/arena.ts:15:12 (get_global "$(lib)/allocator/arena/HEAP_OFFSET") ) - ;;@ (lib)/allocator/arena.ts:16:19 (get_local $0) ) - ;;@ (lib)/allocator/arena.ts:16:26 (i32.const 7) ) (i32.const -8) ) ) - ;;@ (lib)/allocator/arena.ts:17:2 (tee_local $1 - ;;@ (lib)/allocator/arena.ts:17:14 (i32.shl (current_memory) - ;;@ (lib)/allocator/arena.ts:17:41 (i32.const 16) ) ) ) ) - ;;@ (lib)/allocator/arena.ts:18:21 (i32.lt_s (grow_memory - ;;@ (lib)/allocator/arena.ts:19:4 (select (tee_local $0 - ;;@ (lib)/allocator/arena.ts:20:6 (i32.shr_u (i32.sub - ;;@ (lib)/allocator/arena.ts:20:7 (i32.and - ;;@ (lib)/allocator/arena.ts:20:8 (i32.add - ;;@ (lib)/allocator/arena.ts:20:9 (get_local $2) - ;;@ (lib)/allocator/arena.ts:20:15 (i32.const 65535) ) (i32.const -65536) ) - ;;@ (lib)/allocator/arena.ts:20:36 (get_local $1) ) - ;;@ (lib)/allocator/arena.ts:20:46 (i32.const 16) ) ) (tee_local $1 - ;;@ (lib)/allocator/arena.ts:21:6 (i32.shr_u (get_local $1) - ;;@ (lib)/allocator/arena.ts:21:46 (i32.const 16) ) ) @@ -103,33 +77,40 @@ ) ) ) - ;;@ (lib)/allocator/arena.ts:23:6 (i32.const 0) ) (get_local $0) ) (i32.const 1) ) - ;;@ (lib)/allocator/arena.ts:23:9 (unreachable) ) - ;;@ (lib)/allocator/arena.ts:24:2 (set_global "$(lib)/allocator/arena/HEAP_OFFSET" - ;;@ (lib)/allocator/arena.ts:24:16 (get_local $2) ) - ;;@ (lib)/allocator/arena.ts:25:9 (get_local $3) ) - (func $start (; 1 ;) (type $v) + (func $std/new/AClass#constructor (; 1 ;) (type $ifv) (param $0 i32) (param $1 f32) + (i32.store + (get_local $0) + (i32.add + (i32.load + (get_local $0) + ) + (i32.const 1) + ) + ) + (f32.store offset=4 + (get_local $0) + (get_local $1) + ) + ) + (func $start (; 2 ;) (type $v) (local $0 i32) - (local $1 i32) (set_global "$(lib)/allocator/arena/HEAP_OFFSET" - ;;@ (lib)/allocator/arena.ts:11:25 (get_global $HEAP_BASE) ) (set_global $std/new/aClass - ;;@ std/new.ts:13:13 (block (result i32) (i32.store (tee_local $0 @@ -137,27 +118,14 @@ (i32.const 8) ) ) - ;;@ std/new.ts:5:16 (i32.const 1) ) (f32.store offset=4 (get_local $0) - ;;@ std/new.ts:6:22 (f32.const 2) ) - (i32.store - (tee_local $1 - (get_local $0) - ) - (i32.add - (i32.load - (get_local $1) - ) - (i32.const 1) - ) - ) - (f32.store offset=4 - (get_local $1) + (call $std/new/AClass#constructor + (get_local $0) (f32.const 3) ) (get_local $0) diff --git a/tests/compiler/std/new.wast b/tests/compiler/std/new.wast index 1aca5b41..97c936d2 100644 --- a/tests/compiler/std/new.wast +++ b/tests/compiler/std/new.wast @@ -200,141 +200,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - CLASS_PROTOTYPE: (lib)/array/Array - PROPERTY: (lib)/array/Array#length - CLASS_PROTOTYPE: Array - CLASS_PROTOTYPE: (lib)/array/CArray - CLASS_PROTOTYPE: CArray - CLASS_PROTOTYPE: (lib)/error/Error - CLASS_PROTOTYPE: Error - CLASS_PROTOTYPE: (lib)/error/RangeError - CLASS_PROTOTYPE: RangeError - CLASS_PROTOTYPE: (lib)/map/Map - PROPERTY: (lib)/map/Map#size - CLASS_PROTOTYPE: Map - FUNCTION_PROTOTYPE: (lib)/memory/copy_memory - FUNCTION_PROTOTYPE: (lib)/memory/move_memory - FUNCTION_PROTOTYPE: move_memory - FUNCTION_PROTOTYPE: (lib)/memory/set_memory - FUNCTION_PROTOTYPE: set_memory - FUNCTION_PROTOTYPE: (lib)/memory/compare_memory - FUNCTION_PROTOTYPE: compare_memory - CLASS_PROTOTYPE: (lib)/regexp/RegExp - CLASS_PROTOTYPE: RegExp - CLASS_PROTOTYPE: (lib)/set/Set - PROPERTY: (lib)/set/Set#size - CLASS_PROTOTYPE: Set - GLOBAL: (lib)/string/EMPTY - GLOBAL: (lib)/string/HEAD - FUNCTION_PROTOTYPE: (lib)/string/allocate - CLASS_PROTOTYPE: (lib)/string/String - FUNCTION_PROTOTYPE: (lib)/string/String.__concat - FUNCTION_PROTOTYPE: (lib)/string/String.__eq - CLASS_PROTOTYPE: String - FUNCTION_PROTOTYPE: (lib)/string/isWhiteSpaceOrLineTerminator - ENUM: (lib)/string/CharCode - FUNCTION_PROTOTYPE: (lib)/string/parseInt - FUNCTION_PROTOTYPE: parseInt - FUNCTION_PROTOTYPE: (lib)/string/parseI32 - FUNCTION_PROTOTYPE: parseI32 - FUNCTION_PROTOTYPE: (lib)/string/parseI64 - FUNCTION_PROTOTYPE: parseI64 - FUNCTION_PROTOTYPE: (lib)/string/parse - FUNCTION_PROTOTYPE: (lib)/string/parseFloat - FUNCTION_PROTOTYPE: parseFloat - CLASS_PROTOTYPE: std/new/AClass - GLOBAL: std/new/AClass.aStaticField - GLOBAL: std/new/aClass - GLOBAL: (lib)/allocator/arena/ALIGN_LOG2 - GLOBAL: (lib)/allocator/arena/ALIGN_SIZE - GLOBAL: (lib)/allocator/arena/ALIGN_MASK - GLOBAL: (lib)/allocator/arena/HEAP_OFFSET - FUNCTION_PROTOTYPE: (lib)/allocator/arena/allocate_memory - FUNCTION_PROTOTYPE: allocate_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/free_memory - FUNCTION_PROTOTYPE: free_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/reset_memory - FUNCTION_PROTOTYPE: reset_memory -[program.exports] - CLASS_PROTOTYPE: (lib)/array/Array - CLASS_PROTOTYPE: Array - CLASS_PROTOTYPE: (lib)/array/CArray - CLASS_PROTOTYPE: CArray - CLASS_PROTOTYPE: (lib)/error/Error - CLASS_PROTOTYPE: Error - CLASS_PROTOTYPE: (lib)/error/RangeError - CLASS_PROTOTYPE: RangeError - CLASS_PROTOTYPE: (lib)/map/Map - CLASS_PROTOTYPE: Map - FUNCTION_PROTOTYPE: move_memory - FUNCTION_PROTOTYPE: (lib)/memory/move_memory - FUNCTION_PROTOTYPE: set_memory - FUNCTION_PROTOTYPE: (lib)/memory/set_memory - FUNCTION_PROTOTYPE: compare_memory - FUNCTION_PROTOTYPE: (lib)/memory/compare_memory - CLASS_PROTOTYPE: (lib)/regexp/RegExp - CLASS_PROTOTYPE: RegExp - CLASS_PROTOTYPE: (lib)/set/Set - CLASS_PROTOTYPE: Set - CLASS_PROTOTYPE: (lib)/string/String - CLASS_PROTOTYPE: String - FUNCTION_PROTOTYPE: parseInt - FUNCTION_PROTOTYPE: (lib)/string/parseInt - FUNCTION_PROTOTYPE: parseI32 - FUNCTION_PROTOTYPE: (lib)/string/parseI32 - FUNCTION_PROTOTYPE: parseI64 - FUNCTION_PROTOTYPE: (lib)/string/parseI64 - FUNCTION_PROTOTYPE: parseFloat - FUNCTION_PROTOTYPE: (lib)/string/parseFloat - FUNCTION_PROTOTYPE: allocate_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/allocate_memory - FUNCTION_PROTOTYPE: free_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/free_memory - FUNCTION_PROTOTYPE: reset_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/reset_memory -;) diff --git a/tests/compiler/std/set.optimized.wast b/tests/compiler/std/set.optimized.wast index 14f221c8..2c6f35bc 100644 --- a/tests/compiler/std/set.optimized.wast +++ b/tests/compiler/std/set.optimized.wast @@ -2,6 +2,7 @@ (type $ii (func (param i32) (result i32))) (type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiv (func (param i32 i32 i32))) + (type $iv (func (param i32))) (type $iii (func (param i32 i32) (result i32))) (type $v (func)) (import "env" "abort" (func $abort (param i32 i32 i32 i32))) @@ -17,89 +18,62 @@ (local $1 i32) (local $2 i32) (local $3 i32) - ;;@ (lib)/allocator/arena.ts:14:2 (if - ;;@ (lib)/allocator/arena.ts:14:6 (i32.eqz - ;;@ (lib)/allocator/arena.ts:14:7 (get_local $0) ) - ;;@ (lib)/allocator/arena.ts:14:20 (return (i32.const 0) ) ) - ;;@ (lib)/allocator/arena.ts:18:2 (if - ;;@ (lib)/allocator/arena.ts:18:6 (i32.and (if (result i32) (tee_local $0 (i32.gt_u - ;;@ (lib)/allocator/arena.ts:16:2 (tee_local $2 - ;;@ (lib)/allocator/arena.ts:16:12 (i32.and (i32.add - ;;@ (lib)/allocator/arena.ts:16:13 (i32.add - ;;@ (lib)/allocator/arena.ts:15:2 (tee_local $3 - ;;@ (lib)/allocator/arena.ts:15:12 (get_global "$(lib)/allocator/arena/HEAP_OFFSET") ) - ;;@ (lib)/allocator/arena.ts:16:19 (get_local $0) ) - ;;@ (lib)/allocator/arena.ts:16:26 (i32.const 7) ) (i32.const -8) ) ) - ;;@ (lib)/allocator/arena.ts:17:2 (tee_local $1 - ;;@ (lib)/allocator/arena.ts:17:14 (i32.shl (current_memory) - ;;@ (lib)/allocator/arena.ts:17:41 (i32.const 16) ) ) ) ) - ;;@ (lib)/allocator/arena.ts:18:21 (i32.lt_s (grow_memory - ;;@ (lib)/allocator/arena.ts:19:4 (select (tee_local $0 - ;;@ (lib)/allocator/arena.ts:20:6 (i32.shr_u (i32.sub - ;;@ (lib)/allocator/arena.ts:20:7 (i32.and - ;;@ (lib)/allocator/arena.ts:20:8 (i32.add - ;;@ (lib)/allocator/arena.ts:20:9 (get_local $2) - ;;@ (lib)/allocator/arena.ts:20:15 (i32.const 65535) ) (i32.const -65536) ) - ;;@ (lib)/allocator/arena.ts:20:36 (get_local $1) ) - ;;@ (lib)/allocator/arena.ts:20:46 (i32.const 16) ) ) (tee_local $1 - ;;@ (lib)/allocator/arena.ts:21:6 (i32.shr_u (get_local $1) - ;;@ (lib)/allocator/arena.ts:21:46 (i32.const 16) ) ) @@ -109,26 +83,20 @@ ) ) ) - ;;@ (lib)/allocator/arena.ts:23:6 (i32.const 0) ) (get_local $0) ) (i32.const 1) ) - ;;@ (lib)/allocator/arena.ts:23:9 (unreachable) ) - ;;@ (lib)/allocator/arena.ts:24:2 (set_global "$(lib)/allocator/arena/HEAP_OFFSET" - ;;@ (lib)/allocator/arena.ts:24:16 (get_local $2) ) - ;;@ (lib)/allocator/arena.ts:25:9 (get_local $3) ) (func "$(lib)/set/Set#get:size" (; 2 ;) (type $ii) (param $0 i32) (result i32) - ;;@ (lib)/set.ts:16:11 (i32.load offset=8 (get_local $0) ) @@ -138,13 +106,10 @@ (local $4 i32) (loop $continue|0 (if - ;;@ (lib)/memory.ts:8:9 (if (result i32) (get_local $2) - ;;@ (lib)/memory.ts:8:14 (i32.rem_u (get_local $1) - ;;@ (lib)/memory.ts:8:20 (i32.const 4) ) (get_local $2) @@ -153,16 +118,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:9:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:9:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:9:31 (block (result i32) (set_local $1 (i32.add @@ -172,13 +134,11 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:9:22 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:10:4 (set_local $2 (i32.sub (get_local $2) @@ -189,112 +149,78 @@ ) ) ) - ;;@ (lib)/memory.ts:14:2 (if (i32.eqz - ;;@ (lib)/memory.ts:14:6 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:14:13 (i32.const 4) ) ) - ;;@ (lib)/memory.ts:14:21 (block (loop $continue|1 (if - ;;@ (lib)/memory.ts:15:11 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:15:16 (i32.const 16) ) (block - ;;@ (lib)/memory.ts:16:6 (i32.store - ;;@ (lib)/memory.ts:16:17 (get_local $0) - ;;@ (lib)/memory.ts:16:28 (i32.load - ;;@ (lib)/memory.ts:16:38 (get_local $1) ) ) - ;;@ (lib)/memory.ts:17:6 (i32.store - ;;@ (lib)/memory.ts:17:17 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:17:25 (i32.const 4) ) - ;;@ (lib)/memory.ts:17:28 (i32.load - ;;@ (lib)/memory.ts:17:38 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:17:45 (i32.const 4) ) ) ) - ;;@ (lib)/memory.ts:18:6 (i32.store - ;;@ (lib)/memory.ts:18:17 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:18:25 (i32.const 8) ) - ;;@ (lib)/memory.ts:18:28 (i32.load - ;;@ (lib)/memory.ts:18:38 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:18:45 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:19:6 (i32.store - ;;@ (lib)/memory.ts:19:17 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:19:24 (i32.const 12) ) - ;;@ (lib)/memory.ts:19:28 (i32.load - ;;@ (lib)/memory.ts:19:38 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:19:44 (i32.const 12) ) ) ) - ;;@ (lib)/memory.ts:20:6 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:20:13 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:20:17 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:20:25 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:20:29 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:20:34 (i32.const 16) ) ) @@ -302,160 +228,111 @@ ) ) ) - ;;@ (lib)/memory.ts:22:4 (if - ;;@ (lib)/memory.ts:22:8 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:22:12 (i32.const 8) ) - ;;@ (lib)/memory.ts:22:15 (block - ;;@ (lib)/memory.ts:23:6 (i32.store - ;;@ (lib)/memory.ts:23:17 (get_local $0) - ;;@ (lib)/memory.ts:23:27 (i32.load - ;;@ (lib)/memory.ts:23:37 (get_local $1) ) ) - ;;@ (lib)/memory.ts:24:6 (i32.store - ;;@ (lib)/memory.ts:24:17 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:24:24 (i32.const 4) ) - ;;@ (lib)/memory.ts:24:27 (i32.load - ;;@ (lib)/memory.ts:24:37 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:24:43 (i32.const 4) ) ) ) - ;;@ (lib)/memory.ts:25:6 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:25:14 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:25:17 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:25:24 (i32.const 8) ) ) ) ) - ;;@ (lib)/memory.ts:27:4 (if - ;;@ (lib)/memory.ts:27:8 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:27:12 (i32.const 4) ) - ;;@ (lib)/memory.ts:27:15 (block - ;;@ (lib)/memory.ts:28:6 (i32.store - ;;@ (lib)/memory.ts:28:17 (get_local $0) - ;;@ (lib)/memory.ts:28:23 (i32.load - ;;@ (lib)/memory.ts:28:33 (get_local $1) ) ) - ;;@ (lib)/memory.ts:29:6 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:29:14 (i32.const 4) ) ) - ;;@ (lib)/memory.ts:29:17 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:29:24 (i32.const 4) ) ) ) ) - ;;@ (lib)/memory.ts:31:4 (if - ;;@ (lib)/memory.ts:31:8 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:31:12 (i32.const 2) ) - ;;@ (lib)/memory.ts:31:15 (block - ;;@ (lib)/memory.ts:32:6 (i32.store16 - ;;@ (lib)/memory.ts:32:17 (get_local $0) - ;;@ (lib)/memory.ts:32:23 (i32.load16_u - ;;@ (lib)/memory.ts:32:33 (get_local $1) ) ) - ;;@ (lib)/memory.ts:33:6 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:33:14 (i32.const 2) ) ) - ;;@ (lib)/memory.ts:33:17 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:33:24 (i32.const 2) ) ) ) ) - ;;@ (lib)/memory.ts:35:4 (if - ;;@ (lib)/memory.ts:35:8 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:35:12 (i32.const 1) ) - ;;@ (lib)/memory.ts:36:16 (block (set_local $3 (get_local $0) ) - ;;@ (lib)/memory.ts:36:6 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:36:33 (block (result i32) (set_local $3 (get_local $1) ) - ;;@ (lib)/memory.ts:36:24 (i32.load8_u (get_local $3) ) @@ -463,19 +340,14 @@ ) ) ) - ;;@ (lib)/memory.ts:38:4 (return) ) ) - ;;@ (lib)/memory.ts:43:2 (if - ;;@ (lib)/memory.ts:43:6 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:43:11 (i32.const 32) ) - ;;@ (lib)/memory.ts:44:4 (block $break|2 (block $case2|2 (block $case1|2 @@ -483,10 +355,8 @@ (block $tablify|0 (br_table $case0|2 $case1|2 $case2|2 $tablify|0 (i32.sub - ;;@ (lib)/memory.ts:44:12 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:44:19 (i32.const 4) ) (i32.const 1) @@ -495,27 +365,21 @@ ) (br $break|2) ) - ;;@ (lib)/memory.ts:47:8 (set_local $4 - ;;@ (lib)/memory.ts:47:12 (i32.load - ;;@ (lib)/memory.ts:47:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:48:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:48:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:48:35 (block (result i32) (set_local $1 (i32.add @@ -525,7 +389,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:48:26 (i32.load8_u (get_local $3) ) @@ -534,16 +397,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:49:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:49:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:49:35 (block (result i32) (set_local $1 (i32.add @@ -553,7 +413,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:49:26 (i32.load8_u (get_local $3) ) @@ -562,16 +421,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:50:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:50:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:50:35 (block (result i32) (set_local $1 (i32.add @@ -581,182 +437,128 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:50:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:51:8 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:51:13 (i32.const 3) ) ) (loop $continue|3 (if - ;;@ (lib)/memory.ts:52:15 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:52:20 (i32.const 17) ) (block - ;;@ (lib)/memory.ts:54:10 (i32.store - ;;@ (lib)/memory.ts:54:21 (get_local $0) - ;;@ (lib)/memory.ts:54:27 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:54:32 (i32.const 24) ) - ;;@ (lib)/memory.ts:54:37 (i32.shl - ;;@ (lib)/memory.ts:53:10 (tee_local $3 - ;;@ (lib)/memory.ts:53:14 (i32.load - ;;@ (lib)/memory.ts:53:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:53:30 (i32.const 1) ) ) ) - ;;@ (lib)/memory.ts:54:42 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:56:10 (i32.store - ;;@ (lib)/memory.ts:56:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:56:28 (i32.const 4) ) - ;;@ (lib)/memory.ts:56:31 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:56:36 (i32.const 24) ) - ;;@ (lib)/memory.ts:56:41 (i32.shl - ;;@ (lib)/memory.ts:55:10 (tee_local $4 - ;;@ (lib)/memory.ts:55:14 (i32.load - ;;@ (lib)/memory.ts:55:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:55:30 (i32.const 5) ) ) ) - ;;@ (lib)/memory.ts:56:46 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:58:10 (i32.store - ;;@ (lib)/memory.ts:58:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:58:28 (i32.const 8) ) - ;;@ (lib)/memory.ts:58:31 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:58:36 (i32.const 24) ) - ;;@ (lib)/memory.ts:58:41 (i32.shl - ;;@ (lib)/memory.ts:57:10 (tee_local $3 - ;;@ (lib)/memory.ts:57:14 (i32.load - ;;@ (lib)/memory.ts:57:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:57:30 (i32.const 9) ) ) ) - ;;@ (lib)/memory.ts:58:46 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:60:10 (i32.store - ;;@ (lib)/memory.ts:60:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:60:28 (i32.const 12) ) - ;;@ (lib)/memory.ts:60:32 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:60:37 (i32.const 24) ) - ;;@ (lib)/memory.ts:60:42 (i32.shl - ;;@ (lib)/memory.ts:59:10 (tee_local $4 - ;;@ (lib)/memory.ts:59:14 (i32.load - ;;@ (lib)/memory.ts:59:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:59:30 (i32.const 13) ) ) ) - ;;@ (lib)/memory.ts:60:47 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:61:10 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:61:17 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:61:21 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:61:29 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:61:33 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:61:38 (i32.const 16) ) ) @@ -764,30 +566,23 @@ ) ) ) - ;;@ (lib)/memory.ts:63:8 (br $break|2) ) - ;;@ (lib)/memory.ts:65:8 (set_local $4 - ;;@ (lib)/memory.ts:65:12 (i32.load - ;;@ (lib)/memory.ts:65:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:66:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:66:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:66:35 (block (result i32) (set_local $1 (i32.add @@ -797,7 +592,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:66:26 (i32.load8_u (get_local $3) ) @@ -806,16 +600,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:67:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:67:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:67:35 (block (result i32) (set_local $1 (i32.add @@ -825,182 +616,128 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:67:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:68:8 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:68:13 (i32.const 2) ) ) (loop $continue|4 (if - ;;@ (lib)/memory.ts:69:15 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:69:20 (i32.const 18) ) (block - ;;@ (lib)/memory.ts:71:10 (i32.store - ;;@ (lib)/memory.ts:71:21 (get_local $0) - ;;@ (lib)/memory.ts:71:27 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:71:32 (i32.const 16) ) - ;;@ (lib)/memory.ts:71:37 (i32.shl - ;;@ (lib)/memory.ts:70:10 (tee_local $3 - ;;@ (lib)/memory.ts:70:14 (i32.load - ;;@ (lib)/memory.ts:70:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:70:30 (i32.const 2) ) ) ) - ;;@ (lib)/memory.ts:71:42 (i32.const 16) ) ) ) - ;;@ (lib)/memory.ts:73:10 (i32.store - ;;@ (lib)/memory.ts:73:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:73:28 (i32.const 4) ) - ;;@ (lib)/memory.ts:73:31 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:73:36 (i32.const 16) ) - ;;@ (lib)/memory.ts:73:41 (i32.shl - ;;@ (lib)/memory.ts:72:10 (tee_local $4 - ;;@ (lib)/memory.ts:72:14 (i32.load - ;;@ (lib)/memory.ts:72:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:72:30 (i32.const 6) ) ) ) - ;;@ (lib)/memory.ts:73:46 (i32.const 16) ) ) ) - ;;@ (lib)/memory.ts:75:10 (i32.store - ;;@ (lib)/memory.ts:75:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:75:28 (i32.const 8) ) - ;;@ (lib)/memory.ts:75:31 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:75:36 (i32.const 16) ) - ;;@ (lib)/memory.ts:75:41 (i32.shl - ;;@ (lib)/memory.ts:74:10 (tee_local $3 - ;;@ (lib)/memory.ts:74:14 (i32.load - ;;@ (lib)/memory.ts:74:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:74:30 (i32.const 10) ) ) ) - ;;@ (lib)/memory.ts:75:46 (i32.const 16) ) ) ) - ;;@ (lib)/memory.ts:77:10 (i32.store - ;;@ (lib)/memory.ts:77:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:77:28 (i32.const 12) ) - ;;@ (lib)/memory.ts:77:32 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:77:37 (i32.const 16) ) - ;;@ (lib)/memory.ts:77:42 (i32.shl - ;;@ (lib)/memory.ts:76:10 (tee_local $4 - ;;@ (lib)/memory.ts:76:14 (i32.load - ;;@ (lib)/memory.ts:76:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:76:30 (i32.const 14) ) ) ) - ;;@ (lib)/memory.ts:77:47 (i32.const 16) ) ) ) - ;;@ (lib)/memory.ts:78:10 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:78:17 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:78:21 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:78:29 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:78:33 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:78:38 (i32.const 16) ) ) @@ -1008,30 +745,23 @@ ) ) ) - ;;@ (lib)/memory.ts:80:8 (br $break|2) ) - ;;@ (lib)/memory.ts:82:8 (set_local $4 - ;;@ (lib)/memory.ts:82:12 (i32.load - ;;@ (lib)/memory.ts:82:22 (get_local $1) ) ) (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:83:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:83:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:83:35 (block (result i32) (set_local $1 (i32.add @@ -1041,182 +771,128 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:83:26 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:84:8 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:84:13 (i32.const 1) ) ) (loop $continue|5 (if - ;;@ (lib)/memory.ts:85:15 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:85:20 (i32.const 19) ) (block - ;;@ (lib)/memory.ts:87:10 (i32.store - ;;@ (lib)/memory.ts:87:21 (get_local $0) - ;;@ (lib)/memory.ts:87:27 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:87:32 (i32.const 8) ) - ;;@ (lib)/memory.ts:87:36 (i32.shl - ;;@ (lib)/memory.ts:86:10 (tee_local $3 - ;;@ (lib)/memory.ts:86:14 (i32.load - ;;@ (lib)/memory.ts:86:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:86:30 (i32.const 3) ) ) ) - ;;@ (lib)/memory.ts:87:41 (i32.const 24) ) ) ) - ;;@ (lib)/memory.ts:89:10 (i32.store - ;;@ (lib)/memory.ts:89:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:89:28 (i32.const 4) ) - ;;@ (lib)/memory.ts:89:31 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:89:36 (i32.const 8) ) - ;;@ (lib)/memory.ts:89:40 (i32.shl - ;;@ (lib)/memory.ts:88:10 (tee_local $4 - ;;@ (lib)/memory.ts:88:14 (i32.load - ;;@ (lib)/memory.ts:88:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:88:30 (i32.const 7) ) ) ) - ;;@ (lib)/memory.ts:89:45 (i32.const 24) ) ) ) - ;;@ (lib)/memory.ts:91:10 (i32.store - ;;@ (lib)/memory.ts:91:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:91:28 (i32.const 8) ) - ;;@ (lib)/memory.ts:91:31 (i32.or (i32.shr_u (get_local $4) - ;;@ (lib)/memory.ts:91:36 (i32.const 8) ) - ;;@ (lib)/memory.ts:91:40 (i32.shl - ;;@ (lib)/memory.ts:90:10 (tee_local $3 - ;;@ (lib)/memory.ts:90:14 (i32.load - ;;@ (lib)/memory.ts:90:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:90:30 (i32.const 11) ) ) ) - ;;@ (lib)/memory.ts:91:45 (i32.const 24) ) ) ) - ;;@ (lib)/memory.ts:93:10 (i32.store - ;;@ (lib)/memory.ts:93:21 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:93:28 (i32.const 12) ) - ;;@ (lib)/memory.ts:93:32 (i32.or (i32.shr_u (get_local $3) - ;;@ (lib)/memory.ts:93:37 (i32.const 8) ) - ;;@ (lib)/memory.ts:93:41 (i32.shl - ;;@ (lib)/memory.ts:92:10 (tee_local $4 - ;;@ (lib)/memory.ts:92:14 (i32.load - ;;@ (lib)/memory.ts:92:24 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:92:30 (i32.const 15) ) ) ) - ;;@ (lib)/memory.ts:93:46 (i32.const 24) ) ) ) - ;;@ (lib)/memory.ts:94:10 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:94:17 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:94:21 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:94:29 (i32.const 16) ) ) - ;;@ (lib)/memory.ts:94:33 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:94:38 (i32.const 16) ) ) @@ -1226,29 +902,22 @@ ) ) ) - ;;@ (lib)/memory.ts:101:2 (if - ;;@ (lib)/memory.ts:101:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:101:10 (i32.const 16) ) - ;;@ (lib)/memory.ts:101:14 (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:102:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:102:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:102:31 (block (result i32) (set_local $1 (i32.add @@ -1258,7 +927,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:102:22 (i32.load8_u (get_local $3) ) @@ -1267,16 +935,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:103:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:103:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:103:31 (block (result i32) (set_local $1 (i32.add @@ -1286,7 +951,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:103:22 (i32.load8_u (get_local $3) ) @@ -1295,16 +959,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:104:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:104:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:104:31 (block (result i32) (set_local $1 (i32.add @@ -1314,7 +975,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:104:22 (i32.load8_u (get_local $3) ) @@ -1323,16 +983,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:105:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:105:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:105:31 (block (result i32) (set_local $1 (i32.add @@ -1342,7 +999,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:105:22 (i32.load8_u (get_local $3) ) @@ -1351,16 +1007,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:106:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:106:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:106:31 (block (result i32) (set_local $1 (i32.add @@ -1370,7 +1023,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:106:22 (i32.load8_u (get_local $3) ) @@ -1379,16 +1031,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:107:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:107:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:107:31 (block (result i32) (set_local $1 (i32.add @@ -1398,7 +1047,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:107:22 (i32.load8_u (get_local $3) ) @@ -1407,16 +1055,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:108:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:108:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:108:31 (block (result i32) (set_local $1 (i32.add @@ -1426,7 +1071,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:108:22 (i32.load8_u (get_local $3) ) @@ -1435,16 +1079,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:109:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:109:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:109:31 (block (result i32) (set_local $1 (i32.add @@ -1454,7 +1095,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:109:22 (i32.load8_u (get_local $3) ) @@ -1463,16 +1103,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:110:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:110:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:110:31 (block (result i32) (set_local $1 (i32.add @@ -1482,7 +1119,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:110:22 (i32.load8_u (get_local $3) ) @@ -1491,16 +1127,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:111:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:111:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:111:31 (block (result i32) (set_local $1 (i32.add @@ -1510,7 +1143,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:111:22 (i32.load8_u (get_local $3) ) @@ -1519,16 +1151,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:112:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:112:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:112:31 (block (result i32) (set_local $1 (i32.add @@ -1538,7 +1167,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:112:22 (i32.load8_u (get_local $3) ) @@ -1547,16 +1175,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:113:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:113:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:113:31 (block (result i32) (set_local $1 (i32.add @@ -1566,7 +1191,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:113:22 (i32.load8_u (get_local $3) ) @@ -1575,16 +1199,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:114:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:114:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:114:31 (block (result i32) (set_local $1 (i32.add @@ -1594,7 +1215,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:114:22 (i32.load8_u (get_local $3) ) @@ -1603,16 +1223,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:115:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:115:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:115:31 (block (result i32) (set_local $1 (i32.add @@ -1622,7 +1239,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:115:22 (i32.load8_u (get_local $3) ) @@ -1631,16 +1247,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:116:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:116:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:116:31 (block (result i32) (set_local $1 (i32.add @@ -1650,7 +1263,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:116:22 (i32.load8_u (get_local $3) ) @@ -1659,16 +1271,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:117:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:117:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:117:31 (block (result i32) (set_local $1 (i32.add @@ -1678,7 +1287,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:117:22 (i32.load8_u (get_local $3) ) @@ -1686,29 +1294,22 @@ ) ) ) - ;;@ (lib)/memory.ts:119:2 (if - ;;@ (lib)/memory.ts:119:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:119:10 (i32.const 8) ) - ;;@ (lib)/memory.ts:119:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:120:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:120:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:120:31 (block (result i32) (set_local $1 (i32.add @@ -1718,7 +1319,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:120:22 (i32.load8_u (get_local $3) ) @@ -1727,16 +1327,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:121:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:121:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:121:31 (block (result i32) (set_local $1 (i32.add @@ -1746,7 +1343,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:121:22 (i32.load8_u (get_local $3) ) @@ -1755,16 +1351,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:122:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:122:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:122:31 (block (result i32) (set_local $1 (i32.add @@ -1774,7 +1367,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:122:22 (i32.load8_u (get_local $3) ) @@ -1783,16 +1375,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:123:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:123:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:123:31 (block (result i32) (set_local $1 (i32.add @@ -1802,7 +1391,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:123:22 (i32.load8_u (get_local $3) ) @@ -1811,16 +1399,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:124:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:124:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:124:31 (block (result i32) (set_local $1 (i32.add @@ -1830,7 +1415,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:124:22 (i32.load8_u (get_local $3) ) @@ -1839,16 +1423,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:125:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:125:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:125:31 (block (result i32) (set_local $1 (i32.add @@ -1858,7 +1439,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:125:22 (i32.load8_u (get_local $3) ) @@ -1867,16 +1447,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:126:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:126:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:126:31 (block (result i32) (set_local $1 (i32.add @@ -1886,7 +1463,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:126:22 (i32.load8_u (get_local $3) ) @@ -1895,16 +1471,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:127:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:127:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:127:31 (block (result i32) (set_local $1 (i32.add @@ -1914,7 +1487,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:127:22 (i32.load8_u (get_local $3) ) @@ -1922,29 +1494,22 @@ ) ) ) - ;;@ (lib)/memory.ts:129:2 (if - ;;@ (lib)/memory.ts:129:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:129:10 (i32.const 4) ) - ;;@ (lib)/memory.ts:129:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:130:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:130:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:130:31 (block (result i32) (set_local $1 (i32.add @@ -1954,7 +1519,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:130:22 (i32.load8_u (get_local $3) ) @@ -1963,16 +1527,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:131:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:131:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:131:31 (block (result i32) (set_local $1 (i32.add @@ -1982,7 +1543,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:131:22 (i32.load8_u (get_local $3) ) @@ -1991,16 +1551,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:132:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:132:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:132:31 (block (result i32) (set_local $1 (i32.add @@ -2010,7 +1567,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:132:22 (i32.load8_u (get_local $3) ) @@ -2019,16 +1575,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:133:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:133:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:133:31 (block (result i32) (set_local $1 (i32.add @@ -2038,7 +1591,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:133:22 (i32.load8_u (get_local $3) ) @@ -2046,29 +1598,22 @@ ) ) ) - ;;@ (lib)/memory.ts:135:2 (if - ;;@ (lib)/memory.ts:135:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:135:10 (i32.const 2) ) - ;;@ (lib)/memory.ts:135:13 (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:136:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:136:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:136:31 (block (result i32) (set_local $1 (i32.add @@ -2078,7 +1623,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:136:22 (i32.load8_u (get_local $3) ) @@ -2087,16 +1631,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:137:14 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:137:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:137:31 (block (result i32) (set_local $1 (i32.add @@ -2106,7 +1647,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:137:22 (i32.load8_u (get_local $3) ) @@ -2114,28 +1654,21 @@ ) ) ) - ;;@ (lib)/memory.ts:139:2 (if - ;;@ (lib)/memory.ts:139:6 (i32.and (get_local $2) - ;;@ (lib)/memory.ts:139:10 (i32.const 1) ) - ;;@ (lib)/memory.ts:140:14 (block (set_local $3 (get_local $0) ) - ;;@ (lib)/memory.ts:140:4 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:140:31 (block (result i32) (set_local $3 (get_local $1) ) - ;;@ (lib)/memory.ts:140:22 (i32.load8_u (get_local $3) ) @@ -2146,113 +1679,78 @@ ) (func "$(lib)/memory/move_memory" (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - ;;@ (lib)/memory.ts:148:2 (if - ;;@ (lib)/memory.ts:148:6 (i32.eq (get_local $0) - ;;@ (lib)/memory.ts:148:14 (get_local $1) ) - ;;@ (lib)/memory.ts:149:4 (return) ) - ;;@ (lib)/memory.ts:150:2 (if - ;;@ (lib)/memory.ts:150:6 (i32.and (if (result i32) (tee_local $3 (i32.le_u (i32.add (get_local $1) - ;;@ (lib)/memory.ts:150:12 (get_local $2) ) - ;;@ (lib)/memory.ts:150:17 (get_local $0) ) ) (get_local $3) - ;;@ (lib)/memory.ts:150:25 (i32.le_u (i32.add (get_local $0) - ;;@ (lib)/memory.ts:150:32 (get_local $2) ) - ;;@ (lib)/memory.ts:150:37 (get_local $1) ) ) (i32.const 1) ) - ;;@ (lib)/memory.ts:150:42 (block - ;;@ (lib)/memory.ts:151:4 (call "$(lib)/memory/copy_memory" - ;;@ (lib)/memory.ts:151:16 (get_local $0) - ;;@ (lib)/memory.ts:151:22 (get_local $1) - ;;@ (lib)/memory.ts:151:27 (get_local $2) ) - ;;@ (lib)/memory.ts:152:4 (return) ) ) - ;;@ (lib)/memory.ts:154:2 (if - ;;@ (lib)/memory.ts:154:6 (i32.lt_u (get_local $0) - ;;@ (lib)/memory.ts:154:13 (get_local $1) ) - ;;@ (lib)/memory.ts:154:18 (block - ;;@ (lib)/memory.ts:155:4 (if - ;;@ (lib)/memory.ts:155:8 (i32.eq (i32.rem_u (get_local $1) - ;;@ (lib)/memory.ts:155:14 (i32.const 8) ) - ;;@ (lib)/memory.ts:155:19 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:155:26 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:155:29 (block (loop $continue|0 (if - ;;@ (lib)/memory.ts:156:13 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:156:20 (i32.const 8) ) (block - ;;@ (lib)/memory.ts:157:8 (if - ;;@ (lib)/memory.ts:157:12 (i32.eqz - ;;@ (lib)/memory.ts:157:13 (get_local $2) ) - ;;@ (lib)/memory.ts:158:10 (return) ) - ;;@ (lib)/memory.ts:159:8 (set_local $2 (i32.sub - ;;@ (lib)/memory.ts:159:10 (get_local $2) (i32.const 1) ) @@ -2260,16 +1758,13 @@ (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:160:18 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:160:8 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:160:35 (block (result i32) (set_local $1 (i32.add @@ -2279,7 +1774,6 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:160:26 (i32.load8_u (get_local $3) ) @@ -2291,44 +1785,32 @@ ) (loop $continue|1 (if - ;;@ (lib)/memory.ts:162:13 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:162:18 (i32.const 8) ) (block - ;;@ (lib)/memory.ts:163:8 (i64.store - ;;@ (lib)/memory.ts:163:19 (get_local $0) - ;;@ (lib)/memory.ts:163:25 (i64.load - ;;@ (lib)/memory.ts:163:35 (get_local $1) ) ) - ;;@ (lib)/memory.ts:164:8 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:164:13 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:165:8 (set_local $0 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:165:16 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:166:8 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:166:15 (i32.const 8) ) ) @@ -2340,22 +1822,18 @@ ) (loop $continue|2 (if - ;;@ (lib)/memory.ts:169:11 (get_local $2) (block (set_local $0 (i32.add (tee_local $3 - ;;@ (lib)/memory.ts:170:16 (get_local $0) ) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:170:6 (i32.store8 (get_local $3) - ;;@ (lib)/memory.ts:170:33 (block (result i32) (set_local $1 (i32.add @@ -2365,16 +1843,13 @@ (i32.const 1) ) ) - ;;@ (lib)/memory.ts:170:24 (i32.load8_u (get_local $3) ) ) ) - ;;@ (lib)/memory.ts:171:6 (set_local $2 (i32.sub - ;;@ (lib)/memory.ts:171:8 (get_local $2) (i32.const 1) ) @@ -2384,70 +1859,48 @@ ) ) ) - ;;@ (lib)/memory.ts:173:9 (block - ;;@ (lib)/memory.ts:174:4 (if - ;;@ (lib)/memory.ts:174:8 (i32.eq (i32.rem_u (get_local $1) - ;;@ (lib)/memory.ts:174:14 (i32.const 8) ) - ;;@ (lib)/memory.ts:174:19 (i32.rem_u (get_local $0) - ;;@ (lib)/memory.ts:174:26 (i32.const 8) ) ) - ;;@ (lib)/memory.ts:174:29 (block (loop $continue|3 (if - ;;@ (lib)/memory.ts:175:13 (i32.rem_u (i32.add - ;;@ (lib)/memory.ts:175:14 (get_local $0) - ;;@ (lib)/memory.ts:175:21 (get_local $2) ) - ;;@ (lib)/memory.ts:175:26 (i32.const 8) ) (block - ;;@ (lib)/memory.ts:176:8 (if - ;;@ (lib)/memory.ts:176:12 (i32.eqz - ;;@ (lib)/memory.ts:176:13 (get_local $2) ) - ;;@ (lib)/memory.ts:177:10 (return) ) - ;;@ (lib)/memory.ts:178:8 (i32.store8 - ;;@ (lib)/memory.ts:178:18 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:178:25 (tee_local $2 (i32.sub - ;;@ (lib)/memory.ts:178:27 (get_local $2) (i32.const 1) ) ) ) - ;;@ (lib)/memory.ts:178:30 (i32.load8_u - ;;@ (lib)/memory.ts:178:39 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:178:45 (get_local $2) ) ) @@ -2458,33 +1911,24 @@ ) (loop $continue|4 (if - ;;@ (lib)/memory.ts:180:13 (i32.ge_u (get_local $2) - ;;@ (lib)/memory.ts:180:18 (i32.const 8) ) (block - ;;@ (lib)/memory.ts:182:8 (i64.store - ;;@ (lib)/memory.ts:182:19 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:181:8 (tee_local $2 (i32.sub (get_local $2) - ;;@ (lib)/memory.ts:181:13 (i32.const 8) ) ) ) - ;;@ (lib)/memory.ts:182:29 (i64.load - ;;@ (lib)/memory.ts:182:39 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:182:45 (get_local $2) ) ) @@ -2497,29 +1941,21 @@ ) (loop $continue|5 (if - ;;@ (lib)/memory.ts:185:11 (get_local $2) (block - ;;@ (lib)/memory.ts:186:6 (i32.store8 - ;;@ (lib)/memory.ts:186:16 (i32.add (get_local $0) - ;;@ (lib)/memory.ts:186:23 (tee_local $2 (i32.sub - ;;@ (lib)/memory.ts:186:25 (get_local $2) (i32.const 1) ) ) ) - ;;@ (lib)/memory.ts:186:28 (i32.load8_u - ;;@ (lib)/memory.ts:186:37 (i32.add (get_local $1) - ;;@ (lib)/memory.ts:186:43 (get_local $2) ) ) @@ -2531,13 +1967,14 @@ ) ) ) - (func "$(lib)/set/Set#add" (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func "$(lib)/allocator/arena/free_memory" (; 5 ;) (type $iv) (param $0 i32) + (nop) + ) + (func "$(lib)/set/Set#add" (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - ;;@ (lib)/set.ts:31:4 (if (i32.eqz - ;;@ (lib)/set.ts:31:11 (get_local $0) ) (block @@ -2550,124 +1987,91 @@ (unreachable) ) ) - ;;@ (lib)/set.ts:33:4 (if - ;;@ (lib)/set.ts:33:8 (i32.ge_u (i32.load offset=8 (get_local $0) ) - ;;@ (lib)/set.ts:33:23 (i32.load offset=4 (get_local $0) ) ) - ;;@ (lib)/set.ts:33:40 (block - ;;@ (lib)/set.ts:35:6 (set_local $2 - ;;@ (lib)/set.ts:35:22 (call "$(lib)/allocator/arena/allocate_memory" - ;;@ (lib)/set.ts:35:38 (i32.mul - ;;@ (lib)/set.ts:34:6 (tee_local $3 - ;;@ (lib)/set.ts:34:24 (select (tee_local $2 - ;;@ (lib)/set.ts:34:28 (i32.shl (i32.load offset=4 (get_local $0) ) - ;;@ (lib)/set.ts:34:47 (i32.const 1) ) ) - ;;@ (lib)/set.ts:34:50 - (i32.const 8) + (tee_local $3 + (i32.const 8) + ) (i32.gt_u (get_local $2) - (i32.const 8) + (get_local $3) ) ) ) - ;;@ (lib)/set.ts:35:59 (i32.const 4) ) ) ) - ;;@ (lib)/set.ts:36:6 (if - ;;@ (lib)/set.ts:36:10 (i32.load (get_local $0) ) - ;;@ (lib)/set.ts:36:25 (block - ;;@ (lib)/set.ts:37:8 (call "$(lib)/memory/move_memory" - ;;@ (lib)/set.ts:37:20 (get_local $2) - ;;@ (lib)/set.ts:37:31 (i32.load (get_local $0) ) - ;;@ (lib)/set.ts:37:46 (i32.mul (i32.load offset=4 - ;;@ (lib)/set.ts:37:53 (get_local $0) ) - ;;@ (lib)/set.ts:37:71 (i32.const 4) ) ) - (drop - ;;@ (lib)/set.ts:38:20 + (call "$(lib)/allocator/arena/free_memory" (i32.load (get_local $0) ) ) ) ) - ;;@ (lib)/set.ts:40:6 (i32.store offset=4 (get_local $0) - ;;@ (lib)/set.ts:40:24 (get_local $3) ) - ;;@ (lib)/set.ts:41:6 (i32.store (get_local $0) - ;;@ (lib)/set.ts:41:22 (get_local $2) ) ) ) - ;;@ (lib)/set.ts:43:4 (i32.store - ;;@ (lib)/set.ts:43:13 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/set.ts:43:29 (i32.mul (i32.load offset=8 - ;;@ (lib)/set.ts:43:36 (get_local $0) ) - ;;@ (lib)/set.ts:43:50 (i32.const 4) ) ) - ;;@ (lib)/set.ts:43:63 (get_local $1) ) - ;;@ (lib)/set.ts:44:4 (i32.store offset=8 - ;;@ (lib)/set.ts:44:6 (get_local $0) (i32.add (i32.load offset=8 @@ -2676,16 +2080,13 @@ (i32.const 1) ) ) - ;;@ (lib)/set.ts:45:11 (get_local $0) ) - (func "$(lib)/set/Set#has" (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func "$(lib)/set/Set#has" (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - ;;@ (lib)/set.ts:22:4 (if (i32.eqz - ;;@ (lib)/set.ts:22:11 (get_local $0) ) (block @@ -2699,50 +2100,38 @@ ) ) (set_local $3 - ;;@ (lib)/set.ts:24:46 (i32.load offset=8 (get_local $0) ) ) (loop $continue|0 (if - ;;@ (lib)/set.ts:24:59 (i32.lt_u (get_local $2) - ;;@ (lib)/set.ts:24:67 (get_local $3) ) (block - ;;@ (lib)/set.ts:25:6 (if - ;;@ (lib)/set.ts:25:10 (i32.eq (i32.load - ;;@ (lib)/set.ts:25:18 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/set.ts:25:34 (i32.mul (get_local $2) - ;;@ (lib)/set.ts:25:42 (i32.const 4) ) ) ) - ;;@ (lib)/set.ts:25:58 (get_local $1) ) - ;;@ (lib)/set.ts:26:15 (return (i32.const 1) ) ) - ;;@ (lib)/set.ts:24:74 (set_local $2 (i32.add - ;;@ (lib)/set.ts:24:76 (get_local $2) (i32.const 1) ) @@ -2751,16 +2140,13 @@ ) ) ) - ;;@ (lib)/set.ts:27:11 (i32.const 0) ) - (func "$(lib)/set/Set#delete" (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func "$(lib)/set/Set#delete" (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - ;;@ (lib)/set.ts:49:4 (if (i32.eqz - ;;@ (lib)/set.ts:49:11 (get_local $0) ) (block @@ -2774,105 +2160,77 @@ ) ) (set_local $3 - ;;@ (lib)/set.ts:51:46 (i32.load offset=8 (get_local $0) ) ) (loop $continue|0 (if - ;;@ (lib)/set.ts:51:59 (i32.lt_u (get_local $2) - ;;@ (lib)/set.ts:51:67 (get_local $3) ) (block - ;;@ (lib)/set.ts:52:6 (if - ;;@ (lib)/set.ts:52:10 (i32.eq (i32.load - ;;@ (lib)/set.ts:52:18 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/set.ts:52:34 (i32.mul (get_local $2) - ;;@ (lib)/set.ts:52:42 (i32.const 4) ) ) ) - ;;@ (lib)/set.ts:52:58 (get_local $1) ) - ;;@ (lib)/set.ts:52:65 (block - ;;@ (lib)/set.ts:53:8 (if - ;;@ (lib)/set.ts:53:12 (i32.lt_u (i32.add (get_local $2) - ;;@ (lib)/set.ts:53:20 (i32.const 1) ) - ;;@ (lib)/set.ts:53:24 (i32.load offset=8 (get_local $0) ) ) - ;;@ (lib)/set.ts:54:10 (call "$(lib)/memory/move_memory" - ;;@ (lib)/set.ts:54:22 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/set.ts:54:38 (i32.mul (get_local $2) - ;;@ (lib)/set.ts:54:46 (i32.const 4) ) ) - ;;@ (lib)/set.ts:54:59 (i32.add (i32.load (get_local $0) ) - ;;@ (lib)/set.ts:54:75 (i32.mul (i32.add - ;;@ (lib)/set.ts:54:76 (get_local $2) - ;;@ (lib)/set.ts:54:84 (i32.const 1) ) - ;;@ (lib)/set.ts:54:89 (i32.const 4) ) ) - ;;@ (lib)/set.ts:54:102 (i32.sub (i32.sub (i32.load offset=8 (get_local $0) ) - ;;@ (lib)/set.ts:54:116 (get_local $2) ) - ;;@ (lib)/set.ts:54:124 (i32.const 1) ) ) ) - ;;@ (lib)/set.ts:55:8 (i32.store offset=8 - ;;@ (lib)/set.ts:55:10 (get_local $0) (i32.sub (i32.load offset=8 @@ -2881,16 +2239,13 @@ (i32.const 1) ) ) - ;;@ (lib)/set.ts:56:15 (return (i32.const 1) ) ) ) - ;;@ (lib)/set.ts:51:74 (set_local $2 (i32.add - ;;@ (lib)/set.ts:51:76 (get_local $2) (i32.const 1) ) @@ -2899,263 +2254,12 @@ ) ) ) - ;;@ (lib)/set.ts:58:11 (i32.const 0) ) - (func $start (; 8 ;) (type $v) - (local $0 i32) - (set_global "$(lib)/allocator/arena/HEAP_OFFSET" - ;;@ (lib)/allocator/arena.ts:11:25 - (get_global $HEAP_BASE) - ) - (set_global $std/set/set - ;;@ std/set.ts:5:10 - (call "$(lib)/allocator/arena/allocate_memory" - ;;@ std/set.ts:5:47 - (i32.const 12) - ) - ) - ;;@ std/set.ts:7:0 - (if - ;;@ std/set.ts:7:7 - (call "$(lib)/set/Set#get:size" - (get_global $std/set/set) - ) - (block - (call $abort - (i32.const 0) - (i32.const 8) - (i32.const 7) - (i32.const 0) - ) - (unreachable) - ) - ) - ;;@ std/set.ts:9:4 - (drop - (call "$(lib)/set/Set#add" - ;;@ std/set.ts:9:0 - (get_global $std/set/set) - ;;@ std/set.ts:9:8 - (i32.const 1) - ) - ) - ;;@ std/set.ts:10:4 - (drop - (call "$(lib)/set/Set#add" - ;;@ std/set.ts:10:0 - (get_global $std/set/set) - ;;@ std/set.ts:10:8 - (i32.const 0) - ) - ) - ;;@ std/set.ts:11:4 - (drop - (call "$(lib)/set/Set#add" - ;;@ std/set.ts:11:0 - (get_global $std/set/set) - ;;@ std/set.ts:11:8 - (i32.const 2) - ) - ) - ;;@ std/set.ts:13:0 - (if - ;;@ std/set.ts:13:7 - (i32.ne - (call "$(lib)/set/Set#get:size" - (get_global $std/set/set) - ) - ;;@ std/set.ts:13:19 - (i32.const 3) - ) - (block - (call $abort - (i32.const 0) - (i32.const 8) - (i32.const 13) - (i32.const 0) - ) - (unreachable) - ) - ) - ;;@ std/set.ts:15:0 + (func "$(lib)/set/Set#clear" (; 9 ;) (type $iv) (param $0 i32) (if (i32.eqz - ;;@ std/set.ts:15:11 - (call "$(lib)/set/Set#has" - ;;@ std/set.ts:15:7 - (get_global $std/set/set) - ;;@ std/set.ts:15:15 - (i32.const 1) - ) - ) - (block - (call $abort - (i32.const 0) - (i32.const 8) - (i32.const 15) - (i32.const 0) - ) - (unreachable) - ) - ) - ;;@ std/set.ts:16:0 - (if - (i32.eqz - ;;@ std/set.ts:16:11 - (call "$(lib)/set/Set#has" - ;;@ std/set.ts:16:7 - (get_global $std/set/set) - ;;@ std/set.ts:16:15 - (i32.const 0) - ) - ) - (block - (call $abort - (i32.const 0) - (i32.const 8) - (i32.const 16) - (i32.const 0) - ) - (unreachable) - ) - ) - ;;@ std/set.ts:17:0 - (if - (i32.eqz - ;;@ std/set.ts:17:11 - (call "$(lib)/set/Set#has" - ;;@ std/set.ts:17:7 - (get_global $std/set/set) - ;;@ std/set.ts:17:15 - (i32.const 2) - ) - ) - (block - (call $abort - (i32.const 0) - (i32.const 8) - (i32.const 17) - (i32.const 0) - ) - (unreachable) - ) - ) - ;;@ std/set.ts:18:0 - (if - ;;@ std/set.ts:18:12 - (call "$(lib)/set/Set#has" - ;;@ std/set.ts:18:8 - (get_global $std/set/set) - ;;@ std/set.ts:18:16 - (i32.const 3) - ) - (block - (call $abort - (i32.const 0) - (i32.const 8) - (i32.const 18) - (i32.const 0) - ) - (unreachable) - ) - ) - ;;@ std/set.ts:20:4 - (drop - (call "$(lib)/set/Set#delete" - ;;@ std/set.ts:20:0 - (get_global $std/set/set) - ;;@ std/set.ts:20:11 - (i32.const 0) - ) - ) - ;;@ std/set.ts:22:0 - (if - ;;@ std/set.ts:22:7 - (i32.ne - (call "$(lib)/set/Set#get:size" - (get_global $std/set/set) - ) - ;;@ std/set.ts:22:19 - (i32.const 2) - ) - (block - (call $abort - (i32.const 0) - (i32.const 8) - (i32.const 22) - (i32.const 0) - ) - (unreachable) - ) - ) - ;;@ std/set.ts:23:0 - (if - (i32.eqz - ;;@ std/set.ts:23:11 - (call "$(lib)/set/Set#has" - ;;@ std/set.ts:23:7 - (get_global $std/set/set) - ;;@ std/set.ts:23:15 - (i32.const 1) - ) - ) - (block - (call $abort - (i32.const 0) - (i32.const 8) - (i32.const 23) - (i32.const 0) - ) - (unreachable) - ) - ) - ;;@ std/set.ts:24:0 - (if - ;;@ std/set.ts:24:12 - (call "$(lib)/set/Set#has" - ;;@ std/set.ts:24:8 - (get_global $std/set/set) - ;;@ std/set.ts:24:16 - (i32.const 0) - ) - (block - (call $abort - (i32.const 0) - (i32.const 8) - (i32.const 24) - (i32.const 0) - ) - (unreachable) - ) - ) - ;;@ std/set.ts:25:0 - (if - (i32.eqz - ;;@ std/set.ts:25:11 - (call "$(lib)/set/Set#has" - ;;@ std/set.ts:25:7 - (get_global $std/set/set) - ;;@ std/set.ts:25:15 - (i32.const 2) - ) - ) - (block - (call $abort - (i32.const 0) - (i32.const 8) - (i32.const 25) - (i32.const 0) - ) - (unreachable) - ) - ) - (if - (i32.eqz - (tee_local $0 - ;;@ std/set.ts:27:0 - (get_global $std/set/set) - ) + (get_local $0) ) (block (call $abort @@ -3171,9 +2275,207 @@ (get_local $0) (i32.const 0) ) - ;;@ std/set.ts:29:0 + ) + (func $start (; 10 ;) (type $v) + (set_global "$(lib)/allocator/arena/HEAP_OFFSET" + (get_global $HEAP_BASE) + ) + (set_global $std/set/set + (call "$(lib)/allocator/arena/allocate_memory" + (i32.const 12) + ) + ) + (if + (call "$(lib)/set/Set#get:size" + (get_global $std/set/set) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 7) + (i32.const 0) + ) + (unreachable) + ) + ) + (drop + (call "$(lib)/set/Set#add" + (get_global $std/set/set) + (i32.const 1) + ) + ) + (drop + (call "$(lib)/set/Set#add" + (get_global $std/set/set) + (i32.const 0) + ) + ) + (drop + (call "$(lib)/set/Set#add" + (get_global $std/set/set) + (i32.const 2) + ) + ) + (if + (i32.ne + (call "$(lib)/set/Set#get:size" + (get_global $std/set/set) + ) + (i32.const 3) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 13) + (i32.const 0) + ) + (unreachable) + ) + ) + (if + (i32.eqz + (call "$(lib)/set/Set#has" + (get_global $std/set/set) + (i32.const 1) + ) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 15) + (i32.const 0) + ) + (unreachable) + ) + ) + (if + (i32.eqz + (call "$(lib)/set/Set#has" + (get_global $std/set/set) + (i32.const 0) + ) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 16) + (i32.const 0) + ) + (unreachable) + ) + ) + (if + (i32.eqz + (call "$(lib)/set/Set#has" + (get_global $std/set/set) + (i32.const 2) + ) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 17) + (i32.const 0) + ) + (unreachable) + ) + ) + (if + (call "$(lib)/set/Set#has" + (get_global $std/set/set) + (i32.const 3) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 18) + (i32.const 0) + ) + (unreachable) + ) + ) + (drop + (call "$(lib)/set/Set#delete" + (get_global $std/set/set) + (i32.const 0) + ) + ) + (if + (i32.ne + (call "$(lib)/set/Set#get:size" + (get_global $std/set/set) + ) + (i32.const 2) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 22) + (i32.const 0) + ) + (unreachable) + ) + ) + (if + (i32.eqz + (call "$(lib)/set/Set#has" + (get_global $std/set/set) + (i32.const 1) + ) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 23) + (i32.const 0) + ) + (unreachable) + ) + ) + (if + (call "$(lib)/set/Set#has" + (get_global $std/set/set) + (i32.const 0) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 24) + (i32.const 0) + ) + (unreachable) + ) + ) + (if + (i32.eqz + (call "$(lib)/set/Set#has" + (get_global $std/set/set) + (i32.const 2) + ) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 25) + (i32.const 0) + ) + (unreachable) + ) + ) + (call "$(lib)/set/Set#clear" + (get_global $std/set/set) + ) (if - ;;@ std/set.ts:29:7 (call "$(lib)/set/Set#get:size" (get_global $std/set/set) ) @@ -3187,13 +2489,9 @@ (unreachable) ) ) - ;;@ std/set.ts:30:0 (if - ;;@ std/set.ts:30:12 (call "$(lib)/set/Set#has" - ;;@ std/set.ts:30:8 (get_global $std/set/set) - ;;@ std/set.ts:30:16 (i32.const 1) ) (block diff --git a/tests/compiler/std/set.wast b/tests/compiler/std/set.wast index ddbcf922..2a50f260 100644 --- a/tests/compiler/std/set.wast +++ b/tests/compiler/std/set.wast @@ -3606,139 +3606,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - CLASS_PROTOTYPE: (lib)/array/Array - PROPERTY: (lib)/array/Array#length - CLASS_PROTOTYPE: Array - CLASS_PROTOTYPE: (lib)/array/CArray - CLASS_PROTOTYPE: CArray - CLASS_PROTOTYPE: (lib)/error/Error - CLASS_PROTOTYPE: Error - CLASS_PROTOTYPE: (lib)/error/RangeError - CLASS_PROTOTYPE: RangeError - CLASS_PROTOTYPE: (lib)/map/Map - PROPERTY: (lib)/map/Map#size - CLASS_PROTOTYPE: Map - FUNCTION_PROTOTYPE: (lib)/memory/copy_memory - FUNCTION_PROTOTYPE: (lib)/memory/move_memory - FUNCTION_PROTOTYPE: move_memory - FUNCTION_PROTOTYPE: (lib)/memory/set_memory - FUNCTION_PROTOTYPE: set_memory - FUNCTION_PROTOTYPE: (lib)/memory/compare_memory - FUNCTION_PROTOTYPE: compare_memory - CLASS_PROTOTYPE: (lib)/regexp/RegExp - CLASS_PROTOTYPE: RegExp - CLASS_PROTOTYPE: (lib)/set/Set - PROPERTY: (lib)/set/Set#size - CLASS_PROTOTYPE: Set - GLOBAL: (lib)/string/EMPTY - GLOBAL: (lib)/string/HEAD - FUNCTION_PROTOTYPE: (lib)/string/allocate - CLASS_PROTOTYPE: (lib)/string/String - FUNCTION_PROTOTYPE: (lib)/string/String.__concat - FUNCTION_PROTOTYPE: (lib)/string/String.__eq - CLASS_PROTOTYPE: String - FUNCTION_PROTOTYPE: (lib)/string/isWhiteSpaceOrLineTerminator - ENUM: (lib)/string/CharCode - FUNCTION_PROTOTYPE: (lib)/string/parseInt - FUNCTION_PROTOTYPE: parseInt - FUNCTION_PROTOTYPE: (lib)/string/parseI32 - FUNCTION_PROTOTYPE: parseI32 - FUNCTION_PROTOTYPE: (lib)/string/parseI64 - FUNCTION_PROTOTYPE: parseI64 - FUNCTION_PROTOTYPE: (lib)/string/parse - FUNCTION_PROTOTYPE: (lib)/string/parseFloat - FUNCTION_PROTOTYPE: parseFloat - GLOBAL: std/set/set - GLOBAL: (lib)/allocator/arena/ALIGN_LOG2 - GLOBAL: (lib)/allocator/arena/ALIGN_SIZE - GLOBAL: (lib)/allocator/arena/ALIGN_MASK - GLOBAL: (lib)/allocator/arena/HEAP_OFFSET - FUNCTION_PROTOTYPE: (lib)/allocator/arena/allocate_memory - FUNCTION_PROTOTYPE: allocate_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/free_memory - FUNCTION_PROTOTYPE: free_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/reset_memory - FUNCTION_PROTOTYPE: reset_memory -[program.exports] - CLASS_PROTOTYPE: (lib)/array/Array - CLASS_PROTOTYPE: Array - CLASS_PROTOTYPE: (lib)/array/CArray - CLASS_PROTOTYPE: CArray - CLASS_PROTOTYPE: (lib)/error/Error - CLASS_PROTOTYPE: Error - CLASS_PROTOTYPE: (lib)/error/RangeError - CLASS_PROTOTYPE: RangeError - CLASS_PROTOTYPE: (lib)/map/Map - CLASS_PROTOTYPE: Map - FUNCTION_PROTOTYPE: move_memory - FUNCTION_PROTOTYPE: (lib)/memory/move_memory - FUNCTION_PROTOTYPE: set_memory - FUNCTION_PROTOTYPE: (lib)/memory/set_memory - FUNCTION_PROTOTYPE: compare_memory - FUNCTION_PROTOTYPE: (lib)/memory/compare_memory - CLASS_PROTOTYPE: (lib)/regexp/RegExp - CLASS_PROTOTYPE: RegExp - CLASS_PROTOTYPE: (lib)/set/Set - CLASS_PROTOTYPE: Set - CLASS_PROTOTYPE: (lib)/string/String - CLASS_PROTOTYPE: String - FUNCTION_PROTOTYPE: parseInt - FUNCTION_PROTOTYPE: (lib)/string/parseInt - FUNCTION_PROTOTYPE: parseI32 - FUNCTION_PROTOTYPE: (lib)/string/parseI32 - FUNCTION_PROTOTYPE: parseI64 - FUNCTION_PROTOTYPE: (lib)/string/parseI64 - FUNCTION_PROTOTYPE: parseFloat - FUNCTION_PROTOTYPE: (lib)/string/parseFloat - FUNCTION_PROTOTYPE: allocate_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/allocate_memory - FUNCTION_PROTOTYPE: free_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/free_memory - FUNCTION_PROTOTYPE: reset_memory - FUNCTION_PROTOTYPE: (lib)/allocator/arena/reset_memory -;) diff --git a/tests/compiler/std/string.optimized.wast b/tests/compiler/std/string.optimized.wast index 6e0a7a03..34fd8cc0 100644 --- a/tests/compiler/std/string.optimized.wast +++ b/tests/compiler/std/string.optimized.wast @@ -33,10 +33,8 @@ (export "memory" (memory $0)) (start $start) (func "$(lib)/string/String#charCodeAt" (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - ;;@ (lib)/string.ts:38:4 (if (i32.eqz - ;;@ (lib)/string.ts:38:11 (get_local $0) ) (block @@ -49,85 +47,64 @@ (unreachable) ) ) - ;;@ (lib)/string.ts:40:4 (if - ;;@ (lib)/string.ts:40:8 (i32.ge_u (get_local $1) - ;;@ (lib)/string.ts:40:20 (i32.load (get_local $0) ) ) - ;;@ (lib)/string.ts:41:14 (return (i32.const -1) ) ) - ;;@ (lib)/string.ts:43:11 (i32.load16_u offset=4 - ;;@ (lib)/string.ts:44:6 (i32.add (get_local $0) - ;;@ (lib)/string.ts:44:32 (i32.shl - ;;@ (lib)/string.ts:44:33 (get_local $1) - ;;@ (lib)/string.ts:44:47 (i32.const 1) ) ) ) ) (func "$(lib)/memory/compare_memory" (; 2 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - ;;@ (lib)/memory.ts:262:2 (if - ;;@ (lib)/memory.ts:262:6 (i32.eq (get_local $0) - ;;@ (lib)/memory.ts:262:12 (get_local $1) ) - ;;@ (lib)/memory.ts:263:11 (return (i32.const 0) ) ) (loop $continue|0 (if - ;;@ (lib)/memory.ts:264:9 (if (result i32) (get_local $2) - ;;@ (lib)/memory.ts:264:14 (i32.eq (i32.load8_u - ;;@ (lib)/memory.ts:264:23 (get_local $0) ) - ;;@ (lib)/memory.ts:264:30 (i32.load8_u - ;;@ (lib)/memory.ts:264:39 (get_local $1) ) ) (get_local $2) ) (block - ;;@ (lib)/memory.ts:265:4 (set_local $2 (i32.sub (get_local $2) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:266:4 (set_local $0 (i32.add (get_local $0) (i32.const 1) ) ) - ;;@ (lib)/memory.ts:267:4 (set_local $1 (i32.add (get_local $1) @@ -138,22 +115,16 @@ ) ) ) - ;;@ (lib)/memory.ts:269:9 (if (result i32) (get_local $2) - ;;@ (lib)/memory.ts:269:13 (i32.sub (i32.load8_u - ;;@ (lib)/memory.ts:269:27 (get_local $0) ) - ;;@ (lib)/memory.ts:269:33 (i32.load8_u - ;;@ (lib)/memory.ts:269:47 (get_local $1) ) ) - ;;@ (lib)/memory.ts:269:53 (i32.const 0) ) ) @@ -161,10 +132,8 @@ (local $3 i32) (local $4 i32) (local $5 i32) - ;;@ (lib)/string.ts:166:4 (if (i32.eqz - ;;@ (lib)/string.ts:166:11 (get_local $0) ) (block @@ -177,41 +146,27 @@ (unreachable) ) ) - ;;@ (lib)/string.ts:168:4 (if (i32.eqz - ;;@ (lib)/string.ts:168:8 (get_local $1) ) - ;;@ (lib)/string.ts:169:6 (set_local $1 - ;;@ (lib)/string.ts:169:21 (i32.const 128) ) ) - ;;@ (lib)/string.ts:175:4 (if - ;;@ (lib)/string.ts:175:8 (i32.gt_s (i32.add - ;;@ (lib)/string.ts:174:4 (tee_local $4 - ;;@ (lib)/string.ts:174:30 (i32.load - ;;@ (lib)/string.ts:174:37 (get_local $1) ) ) - ;;@ (lib)/string.ts:173:4 (tee_local $2 - ;;@ (lib)/string.ts:173:23 (select (tee_local $2 - ;;@ (lib)/string.ts:173:34 (select - ;;@ (lib)/string.ts:173:45 (get_local $2) - ;;@ (lib)/string.ts:173:55 (i32.const 0) (i32.gt_s (get_local $2) @@ -220,9 +175,7 @@ ) ) (tee_local $3 - ;;@ (lib)/string.ts:172:4 (tee_local $5 - ;;@ (lib)/string.ts:172:21 (i32.load (get_local $0) ) @@ -235,43 +188,30 @@ ) ) ) - ;;@ (lib)/string.ts:175:31 (get_local $5) ) - ;;@ (lib)/string.ts:176:13 (return (i32.const 0) ) ) - ;;@ (lib)/string.ts:178:11 (i32.eqz - ;;@ (lib)/string.ts:178:12 (call "$(lib)/memory/compare_memory" - ;;@ (lib)/string.ts:179:6 (i32.add (i32.add (get_local $0) - ;;@ (lib)/string.ts:179:32 (i32.const 4) ) - ;;@ (lib)/string.ts:179:39 (i32.shl - ;;@ (lib)/string.ts:179:40 (get_local $2) - ;;@ (lib)/string.ts:179:49 (i32.const 1) ) ) - ;;@ (lib)/string.ts:180:6 (i32.add (get_local $1) - ;;@ (lib)/string.ts:180:40 (i32.const 4) ) - ;;@ (lib)/string.ts:181:6 (i32.shl (get_local $4) - ;;@ (lib)/string.ts:181:22 (i32.const 1) ) ) @@ -279,10 +219,8 @@ ) (func "$(lib)/string/String#endsWith" (; 4 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - ;;@ (lib)/string.ts:103:4 (if (i32.eqz - ;;@ (lib)/string.ts:103:11 (get_local $0) ) (block @@ -295,33 +233,22 @@ (unreachable) ) ) - ;;@ (lib)/string.ts:105:4 (if (i32.eqz - ;;@ (lib)/string.ts:105:8 (get_local $1) ) - ;;@ (lib)/string.ts:106:13 (return (i32.const 0) ) ) - ;;@ (lib)/string.ts:111:4 (if - ;;@ (lib)/string.ts:111:8 (i32.lt_s - ;;@ (lib)/string.ts:110:4 (tee_local $3 - ;;@ (lib)/string.ts:110:23 (i32.sub - ;;@ (lib)/string.ts:108:21 (select (tee_local $2 - ;;@ (lib)/string.ts:108:32 (select - ;;@ (lib)/string.ts:108:36 (get_local $2) - ;;@ (lib)/string.ts:108:49 (i32.const 0) (i32.gt_s (get_local $2) @@ -330,7 +257,6 @@ ) ) (tee_local $3 - ;;@ (lib)/string.ts:108:53 (i32.load (get_local $0) ) @@ -340,52 +266,37 @@ (get_local $3) ) ) - ;;@ (lib)/string.ts:109:4 (tee_local $2 - ;;@ (lib)/string.ts:109:30 (i32.load (get_local $1) ) ) ) ) - ;;@ (lib)/string.ts:111:16 (i32.const 0) ) - ;;@ (lib)/string.ts:112:13 (return (i32.const 0) ) ) - ;;@ (lib)/string.ts:114:11 (i32.eqz - ;;@ (lib)/string.ts:114:12 (call "$(lib)/memory/compare_memory" - ;;@ (lib)/string.ts:115:6 (i32.add (i32.add (get_local $0) - ;;@ (lib)/string.ts:115:32 (i32.const 4) ) - ;;@ (lib)/string.ts:115:39 (i32.shl - ;;@ (lib)/string.ts:115:40 (get_local $3) - ;;@ (lib)/string.ts:115:49 (i32.const 1) ) ) - ;;@ (lib)/string.ts:116:6 (i32.add (get_local $1) - ;;@ (lib)/string.ts:116:40 (i32.const 4) ) - ;;@ (lib)/string.ts:117:6 (i32.shl (get_local $2) - ;;@ (lib)/string.ts:117:22 (i32.const 1) ) ) @@ -395,10 +306,8 @@ (local $3 i32) (local $4 i32) (local $5 i32) - ;;@ (lib)/string.ts:144:4 (if (i32.eqz - ;;@ (lib)/string.ts:144:11 (get_local $0) ) (block @@ -411,36 +320,24 @@ (unreachable) ) ) - ;;@ (lib)/string.ts:146:4 (if (i32.eqz - ;;@ (lib)/string.ts:146:8 (get_local $1) ) - ;;@ (lib)/string.ts:147:6 (set_local $1 - ;;@ (lib)/string.ts:147:21 (i32.const 128) ) ) - ;;@ (lib)/string.ts:152:4 (set_local $4 - ;;@ (lib)/string.ts:152:27 (i32.load - ;;@ (lib)/string.ts:152:34 (get_local $1) ) ) - ;;@ (lib)/string.ts:155:9 (set_local $2 - ;;@ (lib)/string.ts:151:23 (select (tee_local $2 - ;;@ (lib)/string.ts:151:34 (select - ;;@ (lib)/string.ts:149:21 (get_local $2) - ;;@ (lib)/string.ts:151:50 (i32.const 0) (i32.gt_s (get_local $2) @@ -449,9 +346,7 @@ ) ) (tee_local $3 - ;;@ (lib)/string.ts:150:4 (tee_local $5 - ;;@ (lib)/string.ts:150:21 (i32.load (get_local $0) ) @@ -465,62 +360,43 @@ ) (loop $continue|0 (if - ;;@ (lib)/string.ts:155:31 (i32.le_s (i32.add (get_local $2) - ;;@ (lib)/string.ts:155:42 (get_local $4) ) - ;;@ (lib)/string.ts:155:55 (get_local $5) ) (block - ;;@ (lib)/string.ts:156:6 (if - ;;@ (lib)/string.ts:156:10 (i32.eqz - ;;@ (lib)/string.ts:156:11 (call "$(lib)/memory/compare_memory" - ;;@ (lib)/string.ts:157:8 (i32.add (i32.add (get_local $0) - ;;@ (lib)/string.ts:157:34 (i32.const 4) ) - ;;@ (lib)/string.ts:157:41 (i32.shl - ;;@ (lib)/string.ts:157:42 (get_local $2) - ;;@ (lib)/string.ts:157:47 (i32.const 1) ) ) - ;;@ (lib)/string.ts:158:8 (i32.add (get_local $1) - ;;@ (lib)/string.ts:158:42 (i32.const 4) ) - ;;@ (lib)/string.ts:159:8 (i32.shl (get_local $4) - ;;@ (lib)/string.ts:159:21 (i32.const 1) ) ) ) - ;;@ (lib)/string.ts:161:20 (return - ;;@ (lib)/string.ts:161:15 (get_local $2) ) ) - ;;@ (lib)/string.ts:155:60 (set_local $2 (i32.add - ;;@ (lib)/string.ts:155:62 (get_local $2) (i32.const 1) ) @@ -531,83 +407,68 @@ ) (i32.const -1) ) - (func $std/string/getString (; 6 ;) (type $i) (result i32) - ;;@ std/string.ts:17:9 + (func "$(lib)/string/String#includes" (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (i32.ne + (call "$(lib)/string/String#indexOf" + (get_local $0) + (get_local $1) + (get_local $2) + ) + (i32.const -1) + ) + ) + (func $std/string/getString (; 7 ;) (type $i) (result i32) (get_global $std/string/str) ) - (func "$(lib)/string/parse" (; 7 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) + (func "$(lib)/string/parse" (; 8 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 f64) (local $6 f64) - ;;@ (lib)/string.ts:367:2 (if - ;;@ (lib)/string.ts:367:6 (i32.eqz - ;;@ (lib)/string.ts:366:2 (tee_local $4 - ;;@ (lib)/string.ts:366:17 (i32.load (get_local $0) ) ) ) - ;;@ (lib)/string.ts:368:14 (return - ;;@ (lib)/string.ts:368:11 (f64.const nan:0x8000000000000) ) ) (set_local $6 - ;;@ (lib)/string.ts:374:2 (if (result f64) - ;;@ (lib)/string.ts:374:6 (i32.eq - ;;@ (lib)/string.ts:370:2 (tee_local $2 - ;;@ (lib)/string.ts:370:13 (i32.load16_u offset=4 - ;;@ (lib)/string.ts:369:2 (tee_local $3 - ;;@ (lib)/string.ts:369:12 (get_local $0) ) ) ) - ;;@ (lib)/string.ts:374:14 (i32.const 45) ) - ;;@ (lib)/string.ts:374:30 (block (result f64) - ;;@ (lib)/string.ts:375:4 (if - ;;@ (lib)/string.ts:375:8 (i32.eqz - ;;@ (lib)/string.ts:375:9 (tee_local $4 (i32.sub - ;;@ (lib)/string.ts:375:11 (get_local $4) (i32.const 1) ) ) ) - ;;@ (lib)/string.ts:376:16 (return - ;;@ (lib)/string.ts:376:13 (f64.const nan:0x8000000000000) ) ) - ;;@ (lib)/string.ts:377:4 (set_local $2 - ;;@ (lib)/string.ts:377:11 (i32.load16_u offset=4 - ;;@ (lib)/string.ts:377:26 (tee_local $3 (i32.add (get_local $3) - ;;@ (lib)/string.ts:377:33 (i32.const 2) ) ) @@ -615,113 +476,82 @@ ) (f64.const -1) ) - ;;@ (lib)/string.ts:379:9 (if (result f64) - ;;@ (lib)/string.ts:379:13 (i32.eq (get_local $2) - ;;@ (lib)/string.ts:379:21 (i32.const 43) ) - ;;@ (lib)/string.ts:379:36 (block (result f64) - ;;@ (lib)/string.ts:380:4 (if - ;;@ (lib)/string.ts:380:8 (i32.eqz - ;;@ (lib)/string.ts:380:9 (tee_local $4 (i32.sub - ;;@ (lib)/string.ts:380:11 (get_local $4) (i32.const 1) ) ) ) - ;;@ (lib)/string.ts:381:16 (return - ;;@ (lib)/string.ts:381:13 (f64.const nan:0x8000000000000) ) ) - ;;@ (lib)/string.ts:382:4 (set_local $2 - ;;@ (lib)/string.ts:382:11 (i32.load16_u offset=4 - ;;@ (lib)/string.ts:382:26 (tee_local $3 (i32.add (get_local $3) - ;;@ (lib)/string.ts:382:33 (i32.const 2) ) ) ) ) - ;;@ (lib)/string.ts:383:11 (f64.const 1) ) - ;;@ (lib)/string.ts:385:11 (f64.const 1) ) ) ) - ;;@ (lib)/string.ts:388:2 (if - ;;@ (lib)/string.ts:388:7 (get_local $1) - ;;@ (lib)/string.ts:414:9 (if - ;;@ (lib)/string.ts:414:13 (i32.and (if (result i32) (tee_local $0 (i32.lt_s (get_local $1) - ;;@ (lib)/string.ts:414:21 (i32.const 2) ) ) (get_local $0) - ;;@ (lib)/string.ts:414:26 (i32.gt_s (get_local $1) - ;;@ (lib)/string.ts:414:34 (i32.const 36) ) ) (i32.const 1) ) - ;;@ (lib)/string.ts:415:14 (return - ;;@ (lib)/string.ts:415:11 (f64.const nan:0x8000000000000) ) ) (set_local $1 - ;;@ (lib)/string.ts:389:4 (if (result i32) - ;;@ (lib)/string.ts:389:8 (i32.and (if (result i32) (tee_local $0 (i32.eq (get_local $2) - ;;@ (lib)/string.ts:389:16 (i32.const 48) ) ) - ;;@ (lib)/string.ts:389:31 (i32.gt_s (get_local $4) - ;;@ (lib)/string.ts:389:37 (i32.const 2) ) (get_local $0) ) (i32.const 1) ) - ;;@ (lib)/string.ts:390:6 (block $break|0 (result i32) (block $case6|0 (block $case5|0 @@ -731,22 +561,17 @@ (i32.or (i32.eq (tee_local $0 - ;;@ (lib)/string.ts:390:14 (i32.load16_u offset=4 - ;;@ (lib)/string.ts:390:29 (i32.add (get_local $3) - ;;@ (lib)/string.ts:390:35 (i32.const 2) ) ) ) - ;;@ (lib)/string.ts:392:13 (i32.const 66) ) (i32.eq (get_local $0) - ;;@ (lib)/string.ts:393:13 (i32.const 98) ) ) @@ -756,12 +581,10 @@ (i32.or (i32.eq (get_local $0) - ;;@ (lib)/string.ts:398:13 (i32.const 79) ) (i32.eq (get_local $0) - ;;@ (lib)/string.ts:399:13 (i32.const 111) ) ) @@ -770,12 +593,10 @@ (i32.or (i32.eq (get_local $0) - ;;@ (lib)/string.ts:404:13 (i32.const 88) ) (i32.eq (get_local $0) - ;;@ (lib)/string.ts:405:13 (i32.const 120) ) ) @@ -783,85 +604,63 @@ (br $case6|0) ) ) - ;;@ (lib)/string.ts:394:10 (set_local $3 (i32.add (get_local $3) - ;;@ (lib)/string.ts:394:17 (i32.const 4) ) ) - ;;@ (lib)/string.ts:394:20 (set_local $4 (i32.sub (get_local $4) - ;;@ (lib)/string.ts:394:27 (i32.const 2) ) ) - ;;@ (lib)/string.ts:396:10 (br $break|0 - ;;@ (lib)/string.ts:395:18 (i32.const 2) ) ) - ;;@ (lib)/string.ts:400:10 (set_local $3 (i32.add (get_local $3) - ;;@ (lib)/string.ts:400:17 (i32.const 4) ) ) - ;;@ (lib)/string.ts:400:20 (set_local $4 (i32.sub (get_local $4) - ;;@ (lib)/string.ts:400:27 (i32.const 2) ) ) - ;;@ (lib)/string.ts:402:10 (br $break|0 - ;;@ (lib)/string.ts:401:18 (i32.const 8) ) ) - ;;@ (lib)/string.ts:406:10 (set_local $3 (i32.add (get_local $3) - ;;@ (lib)/string.ts:406:17 (i32.const 4) ) ) - ;;@ (lib)/string.ts:406:20 (set_local $4 (i32.sub (get_local $4) - ;;@ (lib)/string.ts:406:27 (i32.const 2) ) ) - ;;@ (lib)/string.ts:408:10 (br $break|0 - ;;@ (lib)/string.ts:407:18 (i32.const 16) ) ) - ;;@ (lib)/string.ts:411:18 (i32.const 10) ) - ;;@ (lib)/string.ts:413:19 (i32.const 10) ) ) ) - ;;@ (lib)/string.ts:419:2 (block $break|1 (loop $continue|1 (if - ;;@ (lib)/string.ts:419:9 (block (result i32) (set_local $4 (i32.sub @@ -874,140 +673,105 @@ (get_local $0) ) (block - ;;@ (lib)/string.ts:421:4 (if - ;;@ (lib)/string.ts:421:8 (i32.and (if (result i32) (tee_local $0 (i32.ge_s - ;;@ (lib)/string.ts:420:4 (tee_local $2 - ;;@ (lib)/string.ts:420:11 (i32.load16_u offset=4 - ;;@ (lib)/string.ts:420:26 (get_local $3) ) ) - ;;@ (lib)/string.ts:421:16 (i32.const 48) ) ) - ;;@ (lib)/string.ts:421:31 (i32.le_s (get_local $2) - ;;@ (lib)/string.ts:421:39 (i32.const 57) ) (get_local $0) ) (i32.const 1) ) - ;;@ (lib)/string.ts:422:6 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/string.ts:422:14 (i32.const 48) ) ) - ;;@ (lib)/string.ts:423:9 (if - ;;@ (lib)/string.ts:423:13 (i32.and (if (result i32) (tee_local $0 (i32.ge_s (get_local $2) - ;;@ (lib)/string.ts:423:21 (i32.const 65) ) ) - ;;@ (lib)/string.ts:423:35 (i32.le_s (get_local $2) - ;;@ (lib)/string.ts:423:43 (i32.const 90) ) (get_local $0) ) (i32.const 1) ) - ;;@ (lib)/string.ts:424:6 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/string.ts:424:14 (i32.const 55) ) ) - ;;@ (lib)/string.ts:425:9 (if - ;;@ (lib)/string.ts:425:13 (i32.and (if (result i32) (tee_local $0 (i32.ge_s (get_local $2) - ;;@ (lib)/string.ts:425:21 (i32.const 97) ) ) - ;;@ (lib)/string.ts:425:35 (i32.le_s (get_local $2) - ;;@ (lib)/string.ts:425:43 (i32.const 122) ) (get_local $0) ) (i32.const 1) ) - ;;@ (lib)/string.ts:426:6 (set_local $2 (i32.sub (get_local $2) - ;;@ (lib)/string.ts:426:14 (i32.const 87) ) ) - ;;@ (lib)/string.ts:428:6 (br $break|1) ) ) ) - ;;@ (lib)/string.ts:430:6 (br_if $break|1 - ;;@ (lib)/string.ts:429:8 (i32.ge_s (get_local $2) - ;;@ (lib)/string.ts:429:16 (get_local $1) ) ) - ;;@ (lib)/string.ts:431:4 (set_local $5 - ;;@ (lib)/string.ts:431:10 (f64.add (f64.mul - ;;@ (lib)/string.ts:431:11 (get_local $5) - ;;@ (lib)/string.ts:431:17 (f64.convert_s/i32 (get_local $1) ) ) - ;;@ (lib)/string.ts:431:26 (f64.convert_s/i32 (get_local $2) ) ) ) - ;;@ (lib)/string.ts:432:4 (set_local $3 (i32.add (get_local $3) - ;;@ (lib)/string.ts:432:11 (i32.const 2) ) ) @@ -1016,94 +780,67 @@ ) ) ) - ;;@ (lib)/string.ts:434:9 (f64.mul (get_local $6) - ;;@ (lib)/string.ts:434:16 (get_local $5) ) ) - (func "$(lib)/string/parseInt" (; 8 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) - ;;@ (lib)/string.ts:354:9 + (func "$(lib)/string/parseInt" (; 9 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (call "$(lib)/string/parse" - ;;@ (lib)/string.ts:354:20 (get_local $0) - ;;@ (lib)/string.ts:354:25 (get_local $1) ) ) - (func "$(lib)/string/parseFloat" (; 9 ;) (type $iF) (param $0 i32) (result f64) + (func "$(lib)/string/parseFloat" (; 10 ;) (type $iF) (param $0 i32) (result f64) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 f64) (local $5 f64) (local $6 f64) - ;;@ (lib)/string.ts:439:2 (if - ;;@ (lib)/string.ts:439:6 (i32.eqz - ;;@ (lib)/string.ts:438:2 (tee_local $3 - ;;@ (lib)/string.ts:438:17 (i32.load (get_local $0) ) ) ) - ;;@ (lib)/string.ts:440:11 (return (f64.const nan:0x8000000000000) ) ) (set_local $6 - ;;@ (lib)/string.ts:446:2 (if (result f64) - ;;@ (lib)/string.ts:446:6 (i32.eq - ;;@ (lib)/string.ts:442:2 (tee_local $2 - ;;@ (lib)/string.ts:442:13 (i32.load16_u offset=4 - ;;@ (lib)/string.ts:441:2 (tee_local $1 - ;;@ (lib)/string.ts:441:12 (get_local $0) ) ) ) - ;;@ (lib)/string.ts:446:14 (i32.const 45) ) - ;;@ (lib)/string.ts:446:30 (block (result f64) - ;;@ (lib)/string.ts:447:4 (if - ;;@ (lib)/string.ts:447:8 (i32.eqz - ;;@ (lib)/string.ts:447:9 (tee_local $3 (i32.sub - ;;@ (lib)/string.ts:447:11 (get_local $3) (i32.const 1) ) ) ) - ;;@ (lib)/string.ts:448:13 (return (f64.const nan:0x8000000000000) ) ) - ;;@ (lib)/string.ts:449:4 (drop - ;;@ (lib)/string.ts:449:11 (i32.load16_u offset=4 - ;;@ (lib)/string.ts:449:26 (tee_local $1 (i32.add (get_local $1) - ;;@ (lib)/string.ts:449:33 (i32.const 2) ) ) @@ -1111,61 +848,44 @@ ) (f64.const -1) ) - ;;@ (lib)/string.ts:451:9 (if (result f64) - ;;@ (lib)/string.ts:451:13 (i32.eq (get_local $2) - ;;@ (lib)/string.ts:451:21 (i32.const 43) ) - ;;@ (lib)/string.ts:451:36 (block (result f64) - ;;@ (lib)/string.ts:452:4 (if - ;;@ (lib)/string.ts:452:8 (i32.eqz - ;;@ (lib)/string.ts:452:9 (tee_local $3 (i32.sub - ;;@ (lib)/string.ts:452:11 (get_local $3) (i32.const 1) ) ) ) - ;;@ (lib)/string.ts:453:13 (return (f64.const nan:0x8000000000000) ) ) - ;;@ (lib)/string.ts:454:4 (drop - ;;@ (lib)/string.ts:454:11 (i32.load16_u offset=4 - ;;@ (lib)/string.ts:454:26 (tee_local $1 (i32.add (get_local $1) - ;;@ (lib)/string.ts:454:33 (i32.const 2) ) ) ) ) - ;;@ (lib)/string.ts:455:11 (f64.const 1) ) - ;;@ (lib)/string.ts:457:11 (f64.const 1) ) ) ) - ;;@ (lib)/string.ts:461:2 (block $break|0 (loop $continue|0 (if - ;;@ (lib)/string.ts:461:9 (block (result i32) (set_local $3 (i32.sub @@ -1178,41 +898,28 @@ (get_local $0) ) (block - ;;@ (lib)/string.ts:463:4 (if - ;;@ (lib)/string.ts:463:8 (i32.eq - ;;@ (lib)/string.ts:462:4 (tee_local $2 - ;;@ (lib)/string.ts:462:11 (i32.load16_u offset=4 - ;;@ (lib)/string.ts:462:26 (get_local $1) ) ) - ;;@ (lib)/string.ts:463:16 (i32.const 46) ) - ;;@ (lib)/string.ts:463:30 (block - ;;@ (lib)/string.ts:464:6 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/string.ts:464:13 (i32.const 2) ) ) - ;;@ (lib)/string.ts:465:6 (set_local $5 - ;;@ (lib)/string.ts:465:21 (f64.const 0.1) ) - ;;@ (lib)/string.ts:466:6 (block $break|1 (loop $continue|1 (if - ;;@ (lib)/string.ts:466:13 (block (result i32) (set_local $3 (i32.sub @@ -1225,30 +932,22 @@ (get_local $0) ) (block - ;;@ (lib)/string.ts:468:8 (if - ;;@ (lib)/string.ts:468:12 (i32.and (if (result i32) (tee_local $0 (i32.eq - ;;@ (lib)/string.ts:467:8 (tee_local $2 - ;;@ (lib)/string.ts:467:15 (i32.load16_u offset=4 - ;;@ (lib)/string.ts:467:30 (get_local $1) ) ) - ;;@ (lib)/string.ts:468:20 (i32.const 69) ) ) (get_local $0) - ;;@ (lib)/string.ts:468:34 (i32.eq (get_local $2) - ;;@ (lib)/string.ts:468:42 (i32.const 101) ) ) @@ -1264,49 +963,37 @@ (unreachable) ) ) - ;;@ (lib)/string.ts:472:10 (br_if $break|1 - ;;@ (lib)/string.ts:471:12 (i32.gt_u - ;;@ (lib)/string.ts:470:8 (tee_local $2 (i32.sub (get_local $2) - ;;@ (lib)/string.ts:470:16 (i32.const 48) ) ) - ;;@ (lib)/string.ts:471:24 (i32.const 9) ) ) - ;;@ (lib)/string.ts:473:8 (set_local $4 (f64.add (get_local $4) - ;;@ (lib)/string.ts:473:15 (f64.mul (f64.convert_s/i32 (get_local $2) ) - ;;@ (lib)/string.ts:473:27 (get_local $5) ) ) ) - ;;@ (lib)/string.ts:474:8 (set_local $5 (f64.mul (get_local $5) - ;;@ (lib)/string.ts:474:15 (f64.const 0.1) ) ) - ;;@ (lib)/string.ts:475:8 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/string.ts:475:15 (i32.const 2) ) ) @@ -1315,47 +1002,34 @@ ) ) ) - ;;@ (lib)/string.ts:477:6 (br $break|0) ) ) - ;;@ (lib)/string.ts:481:6 (br_if $break|0 - ;;@ (lib)/string.ts:480:8 (i32.ge_u - ;;@ (lib)/string.ts:479:4 (tee_local $2 (i32.sub (get_local $2) - ;;@ (lib)/string.ts:479:12 (i32.const 48) ) ) - ;;@ (lib)/string.ts:480:21 (i32.const 10) ) ) - ;;@ (lib)/string.ts:482:4 (set_local $4 - ;;@ (lib)/string.ts:482:10 (f64.add (f64.mul - ;;@ (lib)/string.ts:482:11 (get_local $4) - ;;@ (lib)/string.ts:482:17 (f64.const 10) ) - ;;@ (lib)/string.ts:482:23 (f64.convert_s/i32 (get_local $2) ) ) ) - ;;@ (lib)/string.ts:483:4 (set_local $1 (i32.add (get_local $1) - ;;@ (lib)/string.ts:483:11 (i32.const 2) ) ) @@ -1364,20 +1038,15 @@ ) ) ) - ;;@ (lib)/string.ts:485:9 (f64.mul (get_local $6) - ;;@ (lib)/string.ts:485:16 (get_local $4) ) ) - (func $start (; 10 ;) (type $v) - ;;@ std/string.ts:6:0 + (func $start (; 11 ;) (type $v) (if - ;;@ std/string.ts:6:7 (i32.ne (get_global $std/string/str) - ;;@ std/string.ts:6:33 (i32.const 8) ) (block @@ -1390,14 +1059,11 @@ (unreachable) ) ) - ;;@ std/string.ts:8:0 (if - ;;@ std/string.ts:8:7 (i32.ne (i32.load (get_global $std/string/str) ) - ;;@ std/string.ts:8:21 (i32.const 16) ) (block @@ -1410,18 +1076,12 @@ (unreachable) ) ) - ;;@ std/string.ts:9:0 (if - ;;@ std/string.ts:9:7 (i32.ne - ;;@ std/string.ts:9:11 (call "$(lib)/string/String#charCodeAt" - ;;@ std/string.ts:9:7 (get_global $std/string/str) - ;;@ std/string.ts:9:22 (i32.const 0) ) - ;;@ std/string.ts:9:28 (i32.const 104) ) (block @@ -1434,16 +1094,11 @@ (unreachable) ) ) - ;;@ std/string.ts:10:0 (if (i32.eqz - ;;@ std/string.ts:10:11 (call "$(lib)/string/String#startsWith" - ;;@ std/string.ts:10:7 (get_global $std/string/str) - ;;@ std/string.ts:10:22 (i32.const 120) - ;;@ (lib)/string.ts:165:51 (i32.const 0) ) ) @@ -1457,16 +1112,11 @@ (unreachable) ) ) - ;;@ std/string.ts:11:0 (if (i32.eqz - ;;@ std/string.ts:11:11 (call "$(lib)/string/String#endsWith" - ;;@ std/string.ts:11:7 (get_global $std/string/str) - ;;@ std/string.ts:11:20 (i32.const 144) - ;;@ (lib)/string.ts:102:52 (i32.const 2147483647) ) ) @@ -1480,17 +1130,12 @@ (unreachable) ) ) - ;;@ std/string.ts:12:0 (if (i32.eqz - (i32.ne - (call "$(lib)/string/String#indexOf" - ;;@ std/string.ts:12:7 - (get_global $std/string/str) - (i32.const 160) - (i32.const 0) - ) - (i32.const -1) + (call "$(lib)/string/String#includes" + (get_global $std/string/str) + (i32.const 160) + (i32.const 0) ) ) (block @@ -1503,19 +1148,13 @@ (unreachable) ) ) - ;;@ std/string.ts:13:0 (if - ;;@ std/string.ts:13:7 (i32.ne - ;;@ std/string.ts:13:11 (call "$(lib)/string/String#indexOf" - ;;@ std/string.ts:13:7 (get_global $std/string/str) - ;;@ std/string.ts:13:19 (i32.const 176) (i32.const 0) ) - ;;@ std/string.ts:13:27 (i32.const 2) ) (block @@ -1528,17 +1167,11 @@ (unreachable) ) ) - ;;@ std/string.ts:14:0 (if - ;;@ std/string.ts:14:7 (i32.ne - ;;@ std/string.ts:14:11 (call "$(lib)/string/String#indexOf" - ;;@ std/string.ts:14:7 (get_global $std/string/str) - ;;@ std/string.ts:14:19 (i32.const 184) - ;;@ (lib)/string.ts:143:48 (i32.const 0) ) (i32.const -1) @@ -1553,16 +1186,12 @@ (unreachable) ) ) - ;;@ std/string.ts:20:0 (if - ;;@ std/string.ts:20:7 (f64.ne (call "$(lib)/string/parseInt" - ;;@ std/string.ts:20:16 (i32.const 192) (i32.const 0) ) - ;;@ std/string.ts:20:24 (f64.const 0) ) (block @@ -1575,16 +1204,12 @@ (unreachable) ) ) - ;;@ std/string.ts:21:0 (if - ;;@ std/string.ts:21:7 (f64.ne (call "$(lib)/string/parseInt" - ;;@ std/string.ts:21:16 (i32.const 200) (i32.const 0) ) - ;;@ std/string.ts:21:24 (f64.const 1) ) (block @@ -1597,16 +1222,12 @@ (unreachable) ) ) - ;;@ std/string.ts:22:0 (if - ;;@ std/string.ts:22:7 (f64.ne (call "$(lib)/string/parseInt" - ;;@ std/string.ts:22:16 (i32.const 208) (i32.const 0) ) - ;;@ std/string.ts:22:28 (f64.const 5) ) (block @@ -1619,16 +1240,12 @@ (unreachable) ) ) - ;;@ std/string.ts:23:0 (if - ;;@ std/string.ts:23:7 (f64.ne (call "$(lib)/string/parseInt" - ;;@ std/string.ts:23:16 (i32.const 224) (i32.const 0) ) - ;;@ std/string.ts:23:28 (f64.const 455) ) (block @@ -1641,16 +1258,12 @@ (unreachable) ) ) - ;;@ std/string.ts:24:0 (if - ;;@ std/string.ts:24:7 (f64.ne (call "$(lib)/string/parseInt" - ;;@ std/string.ts:24:16 (i32.const 240) (i32.const 0) ) - ;;@ std/string.ts:24:28 (f64.const 3855) ) (block @@ -1663,16 +1276,12 @@ (unreachable) ) ) - ;;@ std/string.ts:25:0 (if - ;;@ std/string.ts:25:7 (f64.ne (call "$(lib)/string/parseInt" - ;;@ std/string.ts:25:16 (i32.const 256) (i32.const 0) ) - ;;@ std/string.ts:25:28 (f64.const 3855) ) (block @@ -1685,16 +1294,12 @@ (unreachable) ) ) - ;;@ std/string.ts:26:0 (if - ;;@ std/string.ts:26:7 (f64.ne (call "$(lib)/string/parseInt" - ;;@ std/string.ts:26:16 (i32.const 272) (i32.const 0) ) - ;;@ std/string.ts:26:26 (f64.const 11) ) (block @@ -1707,17 +1312,12 @@ (unreachable) ) ) - ;;@ std/string.ts:27:0 (if - ;;@ std/string.ts:27:7 (f64.ne (call "$(lib)/string/parseInt" - ;;@ std/string.ts:27:16 (i32.const 288) - ;;@ (lib)/string.ts:353:51 (i32.const 0) ) - ;;@ std/string.ts:27:27 (f64.const 1) ) (block @@ -1730,15 +1330,11 @@ (unreachable) ) ) - ;;@ std/string.ts:29:0 (if - ;;@ std/string.ts:29:7 (f64.ne (call "$(lib)/string/parseFloat" - ;;@ std/string.ts:29:18 (i32.const 192) ) - ;;@ std/string.ts:29:26 (f64.const 0) ) (block @@ -1751,15 +1347,11 @@ (unreachable) ) ) - ;;@ std/string.ts:30:0 (if - ;;@ std/string.ts:30:7 (f64.ne (call "$(lib)/string/parseFloat" - ;;@ std/string.ts:30:18 (i32.const 200) ) - ;;@ std/string.ts:30:26 (f64.const 1) ) (block @@ -1772,15 +1364,11 @@ (unreachable) ) ) - ;;@ std/string.ts:31:0 (if - ;;@ std/string.ts:31:7 (f64.ne (call "$(lib)/string/parseFloat" - ;;@ std/string.ts:31:18 (i32.const 304) ) - ;;@ std/string.ts:31:28 (f64.const 0.1) ) (block @@ -1793,15 +1381,11 @@ (unreachable) ) ) - ;;@ std/string.ts:32:0 (if - ;;@ std/string.ts:32:7 (f64.ne (call "$(lib)/string/parseFloat" - ;;@ std/string.ts:32:18 (i32.const 320) ) - ;;@ std/string.ts:32:28 (f64.const 0.25) ) (block @@ -1814,15 +1398,11 @@ (unreachable) ) ) - ;;@ std/string.ts:33:0 (if - ;;@ std/string.ts:33:7 (f64.ne (call "$(lib)/string/parseFloat" - ;;@ std/string.ts:33:18 (i32.const 336) ) - ;;@ std/string.ts:33:33 (f64.const 0.1) ) (block diff --git a/tests/compiler/std/string.wast b/tests/compiler/std/string.wast index 78b7b819..51657d40 100644 --- a/tests/compiler/std/string.wast +++ b/tests/compiler/std/string.wast @@ -2168,125 +2168,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - CLASS_PROTOTYPE: (lib)/array/Array - PROPERTY: (lib)/array/Array#length - CLASS_PROTOTYPE: Array - CLASS_PROTOTYPE: (lib)/array/CArray - CLASS_PROTOTYPE: CArray - CLASS_PROTOTYPE: (lib)/error/Error - CLASS_PROTOTYPE: Error - CLASS_PROTOTYPE: (lib)/error/RangeError - CLASS_PROTOTYPE: RangeError - CLASS_PROTOTYPE: (lib)/map/Map - PROPERTY: (lib)/map/Map#size - CLASS_PROTOTYPE: Map - FUNCTION_PROTOTYPE: (lib)/memory/copy_memory - FUNCTION_PROTOTYPE: (lib)/memory/move_memory - FUNCTION_PROTOTYPE: move_memory - FUNCTION_PROTOTYPE: (lib)/memory/set_memory - FUNCTION_PROTOTYPE: set_memory - FUNCTION_PROTOTYPE: (lib)/memory/compare_memory - FUNCTION_PROTOTYPE: compare_memory - CLASS_PROTOTYPE: (lib)/regexp/RegExp - CLASS_PROTOTYPE: RegExp - CLASS_PROTOTYPE: (lib)/set/Set - PROPERTY: (lib)/set/Set#size - CLASS_PROTOTYPE: Set - GLOBAL: (lib)/string/EMPTY - GLOBAL: (lib)/string/HEAD - FUNCTION_PROTOTYPE: (lib)/string/allocate - CLASS_PROTOTYPE: (lib)/string/String - FUNCTION_PROTOTYPE: (lib)/string/String.__concat - FUNCTION_PROTOTYPE: (lib)/string/String.__eq - CLASS_PROTOTYPE: String - FUNCTION_PROTOTYPE: (lib)/string/isWhiteSpaceOrLineTerminator - ENUM: (lib)/string/CharCode - FUNCTION_PROTOTYPE: (lib)/string/parseInt - FUNCTION_PROTOTYPE: parseInt - FUNCTION_PROTOTYPE: (lib)/string/parseI32 - FUNCTION_PROTOTYPE: parseI32 - FUNCTION_PROTOTYPE: (lib)/string/parseI64 - FUNCTION_PROTOTYPE: parseI64 - FUNCTION_PROTOTYPE: (lib)/string/parse - FUNCTION_PROTOTYPE: (lib)/string/parseFloat - FUNCTION_PROTOTYPE: parseFloat - GLOBAL: std/string/str - FUNCTION_PROTOTYPE: std/string/getString -[program.exports] - CLASS_PROTOTYPE: (lib)/array/Array - CLASS_PROTOTYPE: Array - CLASS_PROTOTYPE: (lib)/array/CArray - CLASS_PROTOTYPE: CArray - CLASS_PROTOTYPE: (lib)/error/Error - CLASS_PROTOTYPE: Error - CLASS_PROTOTYPE: (lib)/error/RangeError - CLASS_PROTOTYPE: RangeError - CLASS_PROTOTYPE: (lib)/map/Map - CLASS_PROTOTYPE: Map - FUNCTION_PROTOTYPE: move_memory - FUNCTION_PROTOTYPE: (lib)/memory/move_memory - FUNCTION_PROTOTYPE: set_memory - FUNCTION_PROTOTYPE: (lib)/memory/set_memory - FUNCTION_PROTOTYPE: compare_memory - FUNCTION_PROTOTYPE: (lib)/memory/compare_memory - CLASS_PROTOTYPE: (lib)/regexp/RegExp - CLASS_PROTOTYPE: RegExp - CLASS_PROTOTYPE: (lib)/set/Set - CLASS_PROTOTYPE: Set - CLASS_PROTOTYPE: (lib)/string/String - CLASS_PROTOTYPE: String - FUNCTION_PROTOTYPE: parseInt - FUNCTION_PROTOTYPE: (lib)/string/parseInt - FUNCTION_PROTOTYPE: parseI32 - FUNCTION_PROTOTYPE: (lib)/string/parseI32 - FUNCTION_PROTOTYPE: parseI64 - FUNCTION_PROTOTYPE: (lib)/string/parseI64 - FUNCTION_PROTOTYPE: parseFloat - FUNCTION_PROTOTYPE: (lib)/string/parseFloat - FUNCTION_PROTOTYPE: std/string/getString -;) diff --git a/tests/compiler/switch.optimized.wast b/tests/compiler/switch.optimized.wast index 013f968b..846d91d3 100644 --- a/tests/compiler/switch.optimized.wast +++ b/tests/compiler/switch.optimized.wast @@ -12,10 +12,8 @@ (if (i32.ne (tee_local $1 - ;;@ switch.ts:2:10 (get_local $0) ) - ;;@ switch.ts:3:9 (i32.const 1) ) (block @@ -28,12 +26,10 @@ (i32.or (i32.eq (get_local $1) - ;;@ switch.ts:8:9 (i32.const 2) ) (i32.eq (get_local $1) - ;;@ switch.ts:9:9 (i32.const 3) ) ) @@ -41,17 +37,14 @@ (br $case2|0) ) ) - ;;@ switch.ts:4:13 (return (i32.const 1) ) ) - ;;@ switch.ts:7:13 (return (i32.const 0) ) ) - ;;@ switch.ts:10:13 (i32.const 23) ) (func $switch/doSwitchDefaultFirst (; 1 ;) (type $ii) (param $0 i32) (result i32) @@ -60,10 +53,8 @@ (if (i32.ne (tee_local $1 - ;;@ switch.ts:15:10 (get_local $0) ) - ;;@ switch.ts:18:9 (i32.const 1) ) (block @@ -71,42 +62,34 @@ (i32.or (i32.eq (get_local $1) - ;;@ switch.ts:20:9 (i32.const 2) ) (i32.eq (get_local $1) - ;;@ switch.ts:21:9 (i32.const 3) ) ) ) - ;;@ switch.ts:17:13 (return (i32.const 0) ) ) ) - ;;@ switch.ts:19:13 (return (i32.const 1) ) ) - ;;@ switch.ts:22:13 (i32.const 23) ) (func $switch/doSwitchDefaultOmitted (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - ;;@ switch.ts:27:2 (block $break|0 (block $case2|0 (if (i32.ne (tee_local $1 - ;;@ switch.ts:27:10 (get_local $0) ) - ;;@ switch.ts:28:9 (i32.const 1) ) (block @@ -114,12 +97,10 @@ (i32.or (i32.eq (get_local $1) - ;;@ switch.ts:30:9 (i32.const 2) ) (i32.eq (get_local $1) - ;;@ switch.ts:31:9 (i32.const 3) ) ) @@ -127,17 +108,14 @@ (br $break|0) ) ) - ;;@ switch.ts:29:13 (return (i32.const 1) ) ) - ;;@ switch.ts:32:13 (return (i32.const 23) ) ) - ;;@ switch.ts:34:9 (i32.const 0) ) ) diff --git a/tests/compiler/switch.wast b/tests/compiler/switch.wast index 9014fef0..e7f43f89 100644 --- a/tests/compiler/switch.wast +++ b/tests/compiler/switch.wast @@ -170,56 +170,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: switch/doSwitch - FUNCTION_PROTOTYPE: switch/doSwitchDefaultFirst - FUNCTION_PROTOTYPE: switch/doSwitchDefaultOmitted -[program.exports] - FUNCTION_PROTOTYPE: switch/doSwitch - FUNCTION_PROTOTYPE: switch/doSwitchDefaultFirst - FUNCTION_PROTOTYPE: switch/doSwitchDefaultOmitted -;) diff --git a/tests/compiler/ternary.optimized.wast b/tests/compiler/ternary.optimized.wast index fa4d431f..d0d8d5ae 100644 --- a/tests/compiler/ternary.optimized.wast +++ b/tests/compiler/ternary.optimized.wast @@ -5,15 +5,12 @@ (export "memory" (memory $0)) (start $start) (func $start (; 0 ;) (type $v) - ;;@ ternary.ts:7:0 (set_global $ternary/a (i32.const 1) ) - ;;@ ternary.ts:8:0 (set_global $ternary/a (i32.const 1) ) - ;;@ ternary.ts:9:0 (set_global $ternary/a (i32.const 1) ) diff --git a/tests/compiler/ternary.wast b/tests/compiler/ternary.wast index 9bea0efe..4aed6d9c 100644 --- a/tests/compiler/ternary.wast +++ b/tests/compiler/ternary.wast @@ -85,52 +85,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: ternary/a -[program.exports] - -;) diff --git a/tests/compiler/tlsf.optimized.wast b/tests/compiler/tlsf.optimized.wast index a00b5926..2d521049 100644 --- a/tests/compiler/tlsf.optimized.wast +++ b/tests/compiler/tlsf.optimized.wast @@ -1,196 +1,191 @@ (module (type $ii (func (param i32) (result i32))) (type $iiiiv (func (param i32 i32 i32 i32))) + (type $iiv (func (param i32 i32))) + (type $iiiv (func (param i32 i32 i32))) (type $iv (func (param i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (memory $0 1) + (data (i32.const 8) "\07\00\00\00t\00l\00s\00f\00.\00t\00s") (export "control$construct" (func $tlsf/control$construct)) (export "memory" (memory $0)) (start $start) - (func $tlsf/fls (; 0 ;) (type $ii) (param $0 i32) (result i32) + (func $tlsf/fls (; 1 ;) (type $ii) (param $0 i32) (result i32) (select - ;;@ tlsf.ts:7:21 (i32.sub (i32.const 31) - ;;@ tlsf.ts:7:26 (i32.clz - ;;@ tlsf.ts:7:35 (get_local $0) ) ) (i32.const -1) - ;;@ tlsf.ts:7:10 (get_local $0) ) ) - (func $tlsf/ffs (; 1 ;) (type $ii) (param $0 i32) (result i32) + (func $tlsf/ffs (; 2 ;) (type $ii) (param $0 i32) (result i32) (select - ;;@ tlsf.ts:17:22 (i32.ctz - ;;@ tlsf.ts:17:31 (get_local $0) ) (i32.const -1) - ;;@ tlsf.ts:17:10 (get_local $0) ) ) - (func $tlsf/control$set_block (; 2 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - ;;@ tlsf.ts:173:2 + (func $tlsf/block$set_next_free (; 3 ;) (type $iiv) (param $0 i32) (param $1 i32) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (get_local $1) + ) + ) + (func $tlsf/block$set_prev_free (; 4 ;) (type $iiv) (param $0 i32) (param $1 i32) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (get_local $1) + ) + ) + (func $tlsf/control$set_fl_bitmap (; 5 ;) (type $iiv) (param $0 i32) (param $1 i32) + (i32.store + (i32.add + (get_local $0) + (i32.const 16) + ) + (get_local $1) + ) + ) + (func $tlsf/control$set_sl_bitmap (; 6 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (if - ;;@ tlsf.ts:173:9 (i32.ge_u (get_local $1) - ;;@ tlsf.ts:173:19 (i32.const 23) ) - (unreachable) - ) - ;;@ tlsf.ts:174:2 - (if - ;;@ tlsf.ts:174:9 - (i32.ge_u - (get_local $2) - ;;@ tlsf.ts:174:19 - (i32.const 32) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 162) + (i32.const 2) + ) + (unreachable) ) - (unreachable) ) - ;;@ tlsf.ts:175:2 (i32.store - ;;@ tlsf.ts:175:15 (i32.add (i32.add (get_local $0) - ;;@ tlsf.ts:175:21 - (i32.const 112) + (i32.const 20) ) - ;;@ tlsf.ts:175:45 (i32.mul - (i32.add - ;;@ tlsf.ts:175:46 - (i32.mul - (get_local $1) - ;;@ tlsf.ts:175:56 - (i32.const 32) - ) - ;;@ tlsf.ts:175:73 - (get_local $2) - ) - ;;@ tlsf.ts:175:84 + (get_local $1) + (i32.const 4) + ) + ) + (get_local $2) + ) + ) + (func $tlsf/control$set_block (; 7 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (if + (i32.ge_u + (get_local $1) + (i32.const 23) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 173) + (i32.const 2) + ) + (unreachable) + ) + ) + (if + (i32.ge_u + (get_local $2) + (i32.const 32) + ) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 174) + (i32.const 2) + ) + (unreachable) + ) + ) + (i32.store + (i32.add + (i32.add + (get_local $0) + (i32.const 112) + ) + (i32.mul + (i32.add + (i32.mul + (get_local $1) + (i32.const 32) + ) + (get_local $2) + ) (i32.const 4) ) ) - ;;@ tlsf.ts:175:101 (get_local $3) ) ) - (func $tlsf/control$construct (; 3 ;) (type $iv) (param $0 i32) + (func $tlsf/control$construct (; 8 ;) (type $iv) (param $0 i32) (local $1 i32) (local $2 i32) - (local $3 i32) - (i32.store - (i32.add - (tee_local $3 - ;;@ tlsf.ts:180:22 - (get_local $0) - ) - (i32.const 8) - ) - (tee_local $1 - ;;@ tlsf.ts:180:27 - (get_local $0) - ) + (call $tlsf/block$set_next_free + (get_local $0) + (get_local $0) ) - (i32.store - (i32.add - (tee_local $3 - ;;@ tlsf.ts:181:22 - (get_local $0) - ) - (i32.const 12) - ) - (tee_local $1 - ;;@ tlsf.ts:181:27 - (get_local $0) - ) + (call $tlsf/block$set_prev_free + (get_local $0) + (get_local $0) ) - (i32.store - (i32.add - (tee_local $1 - ;;@ tlsf.ts:182:24 - (get_local $0) - ) - (i32.const 16) - ) + (call $tlsf/control$set_fl_bitmap + (get_local $0) (i32.const 0) ) (loop $continue|0 (if - ;;@ tlsf.ts:183:31 (i32.lt_u - (get_local $2) - ;;@ tlsf.ts:183:41 + (get_local $1) (i32.const 23) ) (block - (set_local $3 - ;;@ tlsf.ts:184:26 + (call $tlsf/control$set_sl_bitmap (get_local $0) - ) - (if - (i32.ge_u - (tee_local $1 - ;;@ tlsf.ts:184:31 - (get_local $2) - ) - (i32.const 23) - ) - (unreachable) - ) - (i32.store - (i32.add - (i32.add - (get_local $3) - (i32.const 20) - ) - (i32.mul - (get_local $1) - (i32.const 4) - ) - ) + (get_local $1) (i32.const 0) ) - ;;@ tlsf.ts:185:9 - (set_local $1 - ;;@ tlsf.ts:185:30 + (set_local $2 (i32.const 0) ) (loop $continue|1 (if - ;;@ tlsf.ts:185:33 (i32.lt_u - (get_local $1) - ;;@ tlsf.ts:185:43 + (get_local $2) (i32.const 32) ) (block - ;;@ tlsf.ts:186:6 (call $tlsf/control$set_block - ;;@ tlsf.ts:186:24 (get_local $0) - ;;@ tlsf.ts:186:29 - (get_local $2) - ;;@ tlsf.ts:186:38 (get_local $1) - ;;@ tlsf.ts:186:47 + (get_local $2) (get_local $0) ) - ;;@ tlsf.ts:185:59 - (set_local $1 + (set_local $2 (i32.add - ;;@ tlsf.ts:185:61 - (get_local $1) + (get_local $2) (i32.const 1) ) ) @@ -198,11 +193,9 @@ ) ) ) - ;;@ tlsf.ts:183:57 - (set_local $2 + (set_local $1 (i32.add - ;;@ tlsf.ts:183:59 - (get_local $2) + (get_local $1) (i32.const 1) ) ) @@ -211,93 +204,122 @@ ) ) ) - (func $start (; 4 ;) (type $v) - ;;@ tlsf.ts:10:0 + (func $start (; 9 ;) (type $v) (if - ;;@ tlsf.ts:10:7 (i32.ne (call $tlsf/fls - ;;@ tlsf.ts:10:11 (i32.const 0) ) (i32.const -1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 10) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ tlsf.ts:11:0 (if - ;;@ tlsf.ts:11:7 (call $tlsf/fls - ;;@ tlsf.ts:11:11 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 11) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ tlsf.ts:12:0 (if - ;;@ tlsf.ts:12:7 (i32.ne (call $tlsf/fls - ;;@ tlsf.ts:12:11 (i32.const -2147483640) ) - ;;@ tlsf.ts:12:26 (i32.const 31) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 12) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ tlsf.ts:13:0 (if - ;;@ tlsf.ts:13:7 (i32.ne (call $tlsf/fls - ;;@ tlsf.ts:13:11 (i32.const 2147483647) ) - ;;@ tlsf.ts:13:26 (i32.const 30) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 13) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ tlsf.ts:20:0 (if - ;;@ tlsf.ts:20:7 (i32.ne (call $tlsf/ffs - ;;@ tlsf.ts:20:11 (i32.const 0) ) (i32.const -1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 20) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ tlsf.ts:21:0 (if - ;;@ tlsf.ts:21:7 (call $tlsf/ffs - ;;@ tlsf.ts:21:11 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 21) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ tlsf.ts:22:0 (if - ;;@ tlsf.ts:22:7 (i32.ne (call $tlsf/ffs - ;;@ tlsf.ts:22:11 (i32.const -2147483648) ) - ;;@ tlsf.ts:22:26 (i32.const 31) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 22) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ tlsf.ts:190:0 (call $tlsf/control$construct - ;;@ tlsf.ts:190:18 (i32.load - ;;@ tlsf.ts:190:30 (i32.const 4) ) ) diff --git a/tests/compiler/tlsf.wast b/tests/compiler/tlsf.wast index fb5b4aef..c91d48b7 100644 --- a/tests/compiler/tlsf.wast +++ b/tests/compiler/tlsf.wast @@ -1,11 +1,12 @@ (module (type $ii (func (param i32) (result i32))) + (type $iiiiv (func (param i32 i32 i32 i32))) (type $i (func (result i32))) (type $iiv (func (param i32 i32))) (type $iiiv (func (param i32 i32 i32))) - (type $iiiiv (func (param i32 i32 i32 i32))) (type $iv (func (param i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $tlsf/ALIGN_SIZE_LOG2 i32 (i32.const 3)) (global $tlsf/ALIGN_SIZE i32 (i32.const 8)) (global $tlsf/SL_INDEX_COUNT_LOG2 i32 (i32.const 5)) @@ -29,12 +30,13 @@ (global $tlsf/CONTROL$SL_BITMAP_OFFSET i32 (i32.const 20)) (global $tlsf/CONTROL$BLOCKS_OFFSET i32 (i32.const 112)) (global $tlsf/CONTROL$SIZE i32 (i32.const 3056)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 28)) (memory $0 1) + (data (i32.const 8) "\07\00\00\00t\00l\00s\00f\00.\00t\00s\00") (export "control$construct" (func $tlsf/control$construct)) (export "memory" (memory $0)) (start $start) - (func $tlsf/fls (; 0 ;) (type $ii) (param $0 i32) (result i32) + (func $tlsf/fls (; 1 ;) (type $ii) (param $0 i32) (result i32) ;;@ tlsf.ts:7:39 (return ;;@ tlsf.ts:7:9 @@ -61,7 +63,7 @@ ) ) ) - (func $tlsf/ffs (; 1 ;) (type $ii) (param $0 i32) (result i32) + (func $tlsf/ffs (; 2 ;) (type $ii) (param $0 i32) (result i32) ;;@ tlsf.ts:17:35 (return ;;@ tlsf.ts:17:9 @@ -84,7 +86,7 @@ ) ) ) - (func $tlsf/block$set_next_free (; 2 ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $tlsf/block$set_next_free (; 3 ;) (type $iiv) (param $0 i32) (param $1 i32) ;;@ tlsf.ts:89:2 (i32.store ;;@ tlsf.ts:89:15 @@ -97,7 +99,7 @@ (get_local $1) ) ) - (func $tlsf/block$set_prev_free (; 3 ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $tlsf/block$set_prev_free (; 4 ;) (type $iiv) (param $0 i32) (param $1 i32) ;;@ tlsf.ts:97:2 (i32.store ;;@ tlsf.ts:97:15 @@ -110,7 +112,7 @@ (get_local $1) ) ) - (func $tlsf/control$set_fl_bitmap (; 4 ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $tlsf/control$set_fl_bitmap (; 5 ;) (type $iiv) (param $0 i32) (param $1 i32) ;;@ tlsf.ts:153:2 (i32.store ;;@ tlsf.ts:153:13 @@ -123,7 +125,7 @@ (get_local $1) ) ) - (func $tlsf/control$set_sl_bitmap (; 5 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $tlsf/control$set_sl_bitmap (; 6 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) ;;@ tlsf.ts:162:2 (if (i32.eqz @@ -134,7 +136,15 @@ (i32.const 23) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 162) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ tlsf.ts:163:2 (i32.store @@ -156,7 +166,7 @@ (get_local $2) ) ) - (func $tlsf/control$set_block (; 6 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $tlsf/control$set_block (; 7 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) ;;@ tlsf.ts:173:2 (if (i32.eqz @@ -167,7 +177,15 @@ (i32.const 23) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 173) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ tlsf.ts:174:2 (if @@ -179,7 +197,15 @@ (i32.const 32) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 174) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ tlsf.ts:175:2 (i32.store @@ -210,7 +236,7 @@ (get_local $3) ) ) - (func $tlsf/control$construct (; 7 ;) (type $iv) (param $0 i32) + (func $tlsf/control$construct (; 8 ;) (type $iv) (param $0 i32) (local $1 i32) (local $2 i32) ;;@ tlsf.ts:180:2 @@ -315,7 +341,7 @@ ) ) ) - (func $start (; 8 ;) (type $v) + (func $start (; 9 ;) (type $v) ;;@ tlsf.ts:10:0 (if (i32.eqz @@ -333,7 +359,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 10) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ tlsf.ts:11:0 (if @@ -348,7 +382,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 11) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ tlsf.ts:12:0 (if @@ -363,7 +405,15 @@ (i32.const 31) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 12) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ tlsf.ts:13:0 (if @@ -378,7 +428,15 @@ (i32.const 30) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 13) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ tlsf.ts:20:0 (if @@ -397,7 +455,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 20) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ tlsf.ts:21:0 (if @@ -412,7 +478,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 21) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ tlsf.ts:22:0 (if @@ -427,7 +501,15 @@ (i32.const 31) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 22) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ tlsf.ts:29:0 (if @@ -439,7 +521,15 @@ (i32.const 8) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 29) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ tlsf.ts:190:0 (call $tlsf/control$construct @@ -451,102 +541,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: tlsf/fls - FUNCTION_PROTOTYPE: tlsf/ffs - GLOBAL: tlsf/ALIGN_SIZE_LOG2 - GLOBAL: tlsf/ALIGN_SIZE - GLOBAL: tlsf/SL_INDEX_COUNT_LOG2 - GLOBAL: tlsf/FL_INDEX_MAX - GLOBAL: tlsf/SL_INDEX_COUNT - GLOBAL: tlsf/FL_INDEX_SHIFT - GLOBAL: tlsf/FL_INDEX_COUNT - GLOBAL: tlsf/SMALL_BLOCK_SIZE - GLOBAL: tlsf/BLOCK$PREV_PHYS_BLOCK_OFFSET - GLOBAL: tlsf/BLOCK$TAGGED_SIZE_OFFSET - GLOBAL: tlsf/BLOCK$NEXT_FREE_OFFSET - GLOBAL: tlsf/BLOCK$PREV_FREE_OFFSET - GLOBAL: tlsf/BLOCK$SIZE - GLOBAL: tlsf/BLOCK_HEADER_FREE_BIT - GLOBAL: tlsf/BLOCK_HEADER_PREV_FREE_BIT - GLOBAL: tlsf/BLOCK_OVERHEAD - GLOBAL: tlsf/BLOCK_START_OFFSET - GLOBAL: tlsf/BLOCK_SIZE_MIN - GLOBAL: tlsf/BLOCK_SIZE_MAX - FUNCTION_PROTOTYPE: tlsf/block$get_prev_phys_block - FUNCTION_PROTOTYPE: tlsf/block$set_prev_phys_block - FUNCTION_PROTOTYPE: tlsf/block$get_tagged_size - FUNCTION_PROTOTYPE: tlsf/block$set_tagged_size - FUNCTION_PROTOTYPE: tlsf/block_size - FUNCTION_PROTOTYPE: tlsf/block_set_size - FUNCTION_PROTOTYPE: tlsf/block$get_next_free - FUNCTION_PROTOTYPE: tlsf/block$set_next_free - FUNCTION_PROTOTYPE: tlsf/block$get_prev_free - FUNCTION_PROTOTYPE: tlsf/block$set_prev_free - FUNCTION_PROTOTYPE: tlsf/block_is_last - FUNCTION_PROTOTYPE: tlsf/block_is_free - FUNCTION_PROTOTYPE: tlsf/block_set_free - FUNCTION_PROTOTYPE: tlsf/block_set_used - FUNCTION_PROTOTYPE: tlsf/block_is_prev_free - FUNCTION_PROTOTYPE: tlsf/block_set_prev_free - FUNCTION_PROTOTYPE: tlsf/block_set_prev_used - FUNCTION_PROTOTYPE: tlsf/block_from_ptr - FUNCTION_PROTOTYPE: tlsf/block_to_ptr - GLOBAL: tlsf/CONTROL$FL_BITMAP_OFFSET - GLOBAL: tlsf/CONTROL$SL_BITMAP_OFFSET - GLOBAL: tlsf/CONTROL$BLOCKS_OFFSET - GLOBAL: tlsf/CONTROL$SIZE - FUNCTION_PROTOTYPE: tlsf/control$get_fl_bitmap - FUNCTION_PROTOTYPE: tlsf/control$set_fl_bitmap - FUNCTION_PROTOTYPE: tlsf/control$get_sl_bitmap - FUNCTION_PROTOTYPE: tlsf/control$set_sl_bitmap - FUNCTION_PROTOTYPE: tlsf/control$get_block - FUNCTION_PROTOTYPE: tlsf/control$set_block - FUNCTION_PROTOTYPE: tlsf/control$construct -[program.exports] - FUNCTION_PROTOTYPE: tlsf/control$construct -;) diff --git a/tests/compiler/typealias.optimized.wast b/tests/compiler/typealias.optimized.wast index 805881cd..c93932cd 100644 --- a/tests/compiler/typealias.optimized.wast +++ b/tests/compiler/typealias.optimized.wast @@ -6,7 +6,6 @@ (export "memory" (memory $0)) (start $start) (func $typealias/alias (; 0 ;) (type $ii) (param $0 i32) (result i32) - ;;@ typealias.ts:4:9 (get_local $0) ) (func $start (; 1 ;) (type $v) diff --git a/tests/compiler/typealias.wast b/tests/compiler/typealias.wast index 53cd5b19..aa8c74d1 100644 --- a/tests/compiler/typealias.wast +++ b/tests/compiler/typealias.wast @@ -16,52 +16,3 @@ (nop) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - FUNCTION_PROTOTYPE: typealias/alias -[program.exports] - FUNCTION_PROTOTYPE: typealias/alias -;) diff --git a/tests/compiler/unary.optimized.wast b/tests/compiler/unary.optimized.wast index a1139fd3..7c28bb5b 100644 --- a/tests/compiler/unary.optimized.wast +++ b/tests/compiler/unary.optimized.wast @@ -12,86 +12,63 @@ (local $1 i64) (local $2 f32) (local $3 f64) - ;;@ unary.ts:15:0 - (set_global $unary/i - (i32.add - ;;@ unary.ts:15:2 - (get_global $unary/i) - (i32.const 1) - ) - ) - ;;@ unary.ts:16:0 - (set_global $unary/i - (i32.sub - ;;@ unary.ts:16:2 - (get_global $unary/i) - (i32.const 1) - ) - ) - ;;@ unary.ts:17:0 (set_global $unary/i (i32.add (get_global $unary/i) (i32.const 1) ) ) - ;;@ unary.ts:18:0 (set_global $unary/i (i32.sub (get_global $unary/i) (i32.const 1) ) ) - ;;@ unary.ts:20:0 (set_global $unary/i - ;;@ unary.ts:20:4 + (i32.add + (get_global $unary/i) + (i32.const 1) + ) + ) + (set_global $unary/i + (i32.sub + (get_global $unary/i) + (i32.const 1) + ) + ) + (set_global $unary/i (i32.const 1) ) - ;;@ unary.ts:21:0 (set_global $unary/i (i32.const -1) ) - ;;@ unary.ts:22:0 (set_global $unary/i (i32.const 0) ) - ;;@ unary.ts:23:0 (set_global $unary/i (i32.const -2) ) - ;;@ unary.ts:25:0 (set_global $unary/i - ;;@ unary.ts:25:4 (i32.sub (i32.const 0) - ;;@ unary.ts:25:5 (get_global $unary/i) ) ) - ;;@ unary.ts:26:0 (set_global $unary/i - ;;@ unary.ts:26:4 (i32.eqz - ;;@ unary.ts:26:5 (get_global $unary/i) ) ) - ;;@ unary.ts:27:0 (set_global $unary/i - ;;@ unary.ts:27:4 (i32.xor - ;;@ unary.ts:27:5 (get_global $unary/i) (i32.const -1) ) ) - ;;@ unary.ts:28:0 (set_global $unary/i - ;;@ unary.ts:28:4 (block (result i32) (set_global $unary/i (i32.add - ;;@ unary.ts:28:6 (get_global $unary/i) (i32.const 1) ) @@ -99,13 +76,10 @@ (get_global $unary/i) ) ) - ;;@ unary.ts:29:0 (set_global $unary/i - ;;@ unary.ts:29:4 (block (result i32) (set_global $unary/i (i32.sub - ;;@ unary.ts:29:6 (get_global $unary/i) (i32.const 1) ) @@ -113,9 +87,7 @@ (get_global $unary/i) ) ) - ;;@ unary.ts:30:0 (set_global $unary/i - ;;@ unary.ts:30:4 (block (result i32) (set_global $unary/i (i32.add @@ -128,9 +100,7 @@ (get_local $0) ) ) - ;;@ unary.ts:31:0 (set_global $unary/i - ;;@ unary.ts:31:4 (block (result i32) (set_global $unary/i (i32.sub @@ -143,88 +113,65 @@ (get_local $0) ) ) - ;;@ unary.ts:39:0 - (set_global $unary/I - (i64.add - ;;@ unary.ts:39:2 - (get_global $unary/I) - (i64.const 1) - ) - ) - ;;@ unary.ts:40:0 - (set_global $unary/I - (i64.sub - ;;@ unary.ts:40:2 - (get_global $unary/I) - (i64.const 1) - ) - ) - ;;@ unary.ts:41:0 (set_global $unary/I (i64.add (get_global $unary/I) (i64.const 1) ) ) - ;;@ unary.ts:42:0 (set_global $unary/I (i64.sub (get_global $unary/I) (i64.const 1) ) ) - ;;@ unary.ts:44:0 (set_global $unary/I - ;;@ unary.ts:44:4 + (i64.add + (get_global $unary/I) + (i64.const 1) + ) + ) + (set_global $unary/I + (i64.sub + (get_global $unary/I) + (i64.const 1) + ) + ) + (set_global $unary/I (i64.const 1) ) - ;;@ unary.ts:45:0 (set_global $unary/I (i64.const -1) ) - ;;@ unary.ts:46:0 (set_global $unary/I (i64.const 0) ) - ;;@ unary.ts:47:0 (set_global $unary/I (i64.const -2) ) - ;;@ unary.ts:49:0 (set_global $unary/I - ;;@ unary.ts:49:4 (i64.sub (i64.const 0) - ;;@ unary.ts:49:5 (get_global $unary/I) ) ) - ;;@ unary.ts:50:0 (set_global $unary/I - ;;@ unary.ts:50:4 (i64.extend_s/i32 (i64.eqz - ;;@ unary.ts:50:5 (get_global $unary/I) ) ) ) - ;;@ unary.ts:51:0 (set_global $unary/I - ;;@ unary.ts:51:4 (i64.xor - ;;@ unary.ts:51:5 (get_global $unary/I) (i64.const -1) ) ) - ;;@ unary.ts:52:0 (set_global $unary/I - ;;@ unary.ts:52:4 (block (result i64) (set_global $unary/I (i64.add - ;;@ unary.ts:52:6 (get_global $unary/I) (i64.const 1) ) @@ -232,13 +179,10 @@ (get_global $unary/I) ) ) - ;;@ unary.ts:53:0 (set_global $unary/I - ;;@ unary.ts:53:4 (block (result i64) (set_global $unary/I (i64.sub - ;;@ unary.ts:53:6 (get_global $unary/I) (i64.const 1) ) @@ -246,9 +190,7 @@ (get_global $unary/I) ) ) - ;;@ unary.ts:54:0 (set_global $unary/I - ;;@ unary.ts:54:4 (block (result i64) (set_global $unary/I (i64.add @@ -261,9 +203,7 @@ (get_local $1) ) ) - ;;@ unary.ts:55:0 (set_global $unary/I - ;;@ unary.ts:55:4 (block (result i64) (set_global $unary/I (i64.sub @@ -276,73 +216,54 @@ (get_local $1) ) ) - ;;@ unary.ts:62:0 - (set_global $unary/f - (f32.add - ;;@ unary.ts:62:2 - (get_global $unary/f) - (f32.const 1) - ) - ) - ;;@ unary.ts:63:0 - (set_global $unary/f - (f32.sub - ;;@ unary.ts:63:2 - (get_global $unary/f) - (f32.const 1) - ) - ) - ;;@ unary.ts:64:0 (set_global $unary/f (f32.add (get_global $unary/f) (f32.const 1) ) ) - ;;@ unary.ts:65:0 (set_global $unary/f (f32.sub (get_global $unary/f) (f32.const 1) ) ) - ;;@ unary.ts:67:0 (set_global $unary/f - ;;@ unary.ts:67:4 + (f32.add + (get_global $unary/f) + (f32.const 1) + ) + ) + (set_global $unary/f + (f32.sub + (get_global $unary/f) + (f32.const 1) + ) + ) + (set_global $unary/f (f32.const 1.25) ) - ;;@ unary.ts:68:0 (set_global $unary/f (f32.const -1.25) ) - ;;@ unary.ts:69:0 (set_global $unary/i (i32.const 0) ) - ;;@ unary.ts:71:0 (set_global $unary/f - ;;@ unary.ts:71:4 (f32.neg - ;;@ unary.ts:71:5 (get_global $unary/f) ) ) - ;;@ unary.ts:72:0 (set_global $unary/i - ;;@ unary.ts:72:4 (f32.eq - ;;@ unary.ts:72:5 (get_global $unary/f) (f32.const 0) ) ) - ;;@ unary.ts:73:0 (set_global $unary/f - ;;@ unary.ts:73:4 (block (result f32) (set_global $unary/f (f32.add - ;;@ unary.ts:73:6 (get_global $unary/f) (f32.const 1) ) @@ -350,13 +271,10 @@ (get_global $unary/f) ) ) - ;;@ unary.ts:74:0 (set_global $unary/f - ;;@ unary.ts:74:4 (block (result f32) (set_global $unary/f (f32.sub - ;;@ unary.ts:74:6 (get_global $unary/f) (f32.const 1) ) @@ -364,9 +282,7 @@ (get_global $unary/f) ) ) - ;;@ unary.ts:75:0 (set_global $unary/f - ;;@ unary.ts:75:4 (block (result f32) (set_global $unary/f (f32.add @@ -379,9 +295,7 @@ (get_local $2) ) ) - ;;@ unary.ts:76:0 (set_global $unary/f - ;;@ unary.ts:76:4 (block (result f32) (set_global $unary/f (f32.sub @@ -394,75 +308,56 @@ (get_local $2) ) ) - ;;@ unary.ts:83:0 - (set_global $unary/F - (f64.add - ;;@ unary.ts:83:2 - (get_global $unary/F) - (f64.const 1) - ) - ) - ;;@ unary.ts:84:0 - (set_global $unary/F - (f64.sub - ;;@ unary.ts:84:2 - (get_global $unary/F) - (f64.const 1) - ) - ) - ;;@ unary.ts:85:0 (set_global $unary/F (f64.add (get_global $unary/F) (f64.const 1) ) ) - ;;@ unary.ts:86:0 (set_global $unary/F (f64.sub (get_global $unary/F) (f64.const 1) ) ) - ;;@ unary.ts:88:0 (set_global $unary/F - ;;@ unary.ts:88:4 + (f64.add + (get_global $unary/F) + (f64.const 1) + ) + ) + (set_global $unary/F + (f64.sub + (get_global $unary/F) + (f64.const 1) + ) + ) + (set_global $unary/F (f64.const 1.25) ) - ;;@ unary.ts:89:0 (set_global $unary/F (f64.const -1.25) ) - ;;@ unary.ts:90:0 (set_global $unary/I (i64.const 0) ) - ;;@ unary.ts:92:0 (set_global $unary/F - ;;@ unary.ts:92:4 (f64.neg - ;;@ unary.ts:92:5 (get_global $unary/F) ) ) - ;;@ unary.ts:93:0 (set_global $unary/I - ;;@ unary.ts:93:4 (i64.extend_s/i32 (f64.eq - ;;@ unary.ts:93:5 (get_global $unary/F) (f64.const 0) ) ) ) - ;;@ unary.ts:94:0 (set_global $unary/F - ;;@ unary.ts:94:4 (block (result f64) (set_global $unary/F (f64.add - ;;@ unary.ts:94:6 (get_global $unary/F) (f64.const 1) ) @@ -470,13 +365,10 @@ (get_global $unary/F) ) ) - ;;@ unary.ts:95:0 (set_global $unary/F - ;;@ unary.ts:95:4 (block (result f64) (set_global $unary/F (f64.sub - ;;@ unary.ts:95:6 (get_global $unary/F) (f64.const 1) ) @@ -484,9 +376,7 @@ (get_global $unary/F) ) ) - ;;@ unary.ts:96:0 (set_global $unary/F - ;;@ unary.ts:96:4 (block (result f64) (set_global $unary/F (f64.add @@ -499,9 +389,7 @@ (get_local $3) ) ) - ;;@ unary.ts:97:0 (set_global $unary/F - ;;@ unary.ts:97:4 (block (result f64) (set_global $unary/F (f64.sub diff --git a/tests/compiler/unary.wast b/tests/compiler/unary.wast index a8702ff7..59f8c32c 100644 --- a/tests/compiler/unary.wast +++ b/tests/compiler/unary.wast @@ -739,55 +739,3 @@ ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: unary/i - GLOBAL: unary/I - GLOBAL: unary/f - GLOBAL: unary/F -[program.exports] - -;) diff --git a/tests/compiler/while.optimized.wast b/tests/compiler/while.optimized.wast index 2c7f478e..88aedf48 100644 --- a/tests/compiler/while.optimized.wast +++ b/tests/compiler/while.optimized.wast @@ -1,26 +1,26 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $while/n (mut i32) (i32.const 10)) (global $while/m (mut i32) (i32.const 0)) (global $while/o (mut i32) (i32.const 0)) (memory $0 1) + (data (i32.const 8) "\08\00\00\00w\00h\00i\00l\00e\00.\00t\00s") (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $start (; 1 ;) (type $v) (local $0 i32) (loop $continue|0 (if - ;;@ while.ts:4:7 (get_global $while/n) (block - ;;@ while.ts:5:2 (set_global $while/n (i32.sub (get_global $while/n) (i32.const 1) ) ) - ;;@ while.ts:6:2 (set_global $while/m (i32.add (get_global $while/m) @@ -31,45 +31,49 @@ ) ) ) - ;;@ while.ts:8:0 (if - ;;@ while.ts:8:7 (get_global $while/n) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 8) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ while.ts:9:0 (if - ;;@ while.ts:9:7 (i32.ne (get_global $while/m) - ;;@ while.ts:9:12 (i32.const 10) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 9) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ while.ts:11:0 (set_global $while/n - ;;@ while.ts:11:4 (i32.const 10) ) - ;;@ while.ts:12:0 (set_global $while/m - ;;@ while.ts:12:4 (i32.const 0) ) (loop $continue|1 (if - ;;@ while.ts:14:7 (get_global $while/n) (block - ;;@ while.ts:15:2 (set_global $while/n (i32.sub (get_global $while/n) (i32.const 1) ) ) - ;;@ while.ts:16:2 (set_global $while/m (i32.add (get_global $while/m) @@ -78,17 +82,14 @@ ) (loop $continue|2 (if - ;;@ while.ts:17:9 (get_global $while/n) (block - ;;@ while.ts:18:4 (set_global $while/n (i32.sub (get_global $while/n) (i32.const 1) ) ) - ;;@ while.ts:19:4 (set_global $while/o (i32.add (get_global $while/o) @@ -99,65 +100,87 @@ ) ) ) - ;;@ while.ts:21:2 (if - ;;@ while.ts:21:9 (get_global $while/n) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 21) + (i32.const 2) + ) + (unreachable) + ) ) - ;;@ while.ts:22:2 (if - ;;@ while.ts:22:9 (i32.ne (get_global $while/o) - ;;@ while.ts:22:14 (i32.const 9) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 22) + (i32.const 2) + ) + (unreachable) + ) ) (br $continue|1) ) ) ) - ;;@ while.ts:24:0 (if - ;;@ while.ts:24:7 (get_global $while/n) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 24) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ while.ts:25:0 (if - ;;@ while.ts:25:7 (i32.ne (get_global $while/m) - ;;@ while.ts:25:12 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 25) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ while.ts:26:0 (if - ;;@ while.ts:26:7 (i32.ne (get_global $while/o) - ;;@ while.ts:26:12 (i32.const 9) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 26) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ while.ts:28:0 (set_global $while/n - ;;@ while.ts:28:4 (i32.const 1) ) - ;;@ while.ts:29:0 (set_global $while/m - ;;@ while.ts:29:4 (i32.const 0) ) (loop $continue|3 (br_if $continue|3 - ;;@ while.ts:30:7 (if (result i32) (block (result i32) (set_global $while/n @@ -170,11 +193,9 @@ ) (get_local $0) ) - ;;@ while.ts:30:14 (block (result i32) (set_global $while/m (i32.add - ;;@ while.ts:30:16 (get_global $while/m) (i32.const 1) ) @@ -185,24 +206,35 @@ ) ) ) - ;;@ while.ts:31:0 (if - ;;@ while.ts:31:7 (i32.ne (get_global $while/n) (i32.const -1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 31) + (i32.const 0) + ) + (unreachable) + ) ) - ;;@ while.ts:32:0 (if - ;;@ while.ts:32:7 (i32.ne (get_global $while/m) - ;;@ while.ts:32:12 (i32.const 1) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 32) + (i32.const 0) + ) + (unreachable) + ) ) ) ) diff --git a/tests/compiler/while.wast b/tests/compiler/while.wast index 8a061b5d..e4cda033 100644 --- a/tests/compiler/while.wast +++ b/tests/compiler/while.wast @@ -1,13 +1,16 @@ (module + (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) + (import "env" "abort" (func $abort (param i32 i32 i32 i32))) (global $while/n (mut i32) (i32.const 10)) (global $while/m (mut i32) (i32.const 0)) (global $while/o (mut i32) (i32.const 0)) - (global $HEAP_BASE i32 (i32.const 4)) + (global $HEAP_BASE i32 (i32.const 28)) (memory $0 1) + (data (i32.const 8) "\08\00\00\00w\00h\00i\00l\00e\00.\00t\00s\00") (export "memory" (memory $0)) (start $start) - (func $start (; 0 ;) (type $v) + (func $start (; 1 ;) (type $v) (local $0 i32) ;;@ while.ts:4:0 (block $break|0 @@ -47,7 +50,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 8) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ while.ts:9:0 (if @@ -59,7 +70,15 @@ (i32.const 10) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 9) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ while.ts:11:0 (set_global $while/n @@ -131,7 +150,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 21) + (i32.const 2) + ) + (unreachable) + ) ) ;;@ while.ts:22:2 (if @@ -143,7 +170,15 @@ (i32.const 9) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 22) + (i32.const 2) + ) + (unreachable) + ) ) ) (br $continue|1) @@ -161,7 +196,15 @@ (i32.const 0) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 24) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ while.ts:25:0 (if @@ -173,7 +216,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 25) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ while.ts:26:0 (if @@ -185,7 +236,15 @@ (i32.const 9) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 26) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ while.ts:28:0 (set_global $while/n @@ -255,7 +314,15 @@ ) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 31) + (i32.const 0) + ) + (unreachable) + ) ) ;;@ while.ts:32:0 (if @@ -267,58 +334,15 @@ (i32.const 1) ) ) - (unreachable) + (block + (call $abort + (i32.const 0) + (i32.const 8) + (i32.const 32) + (i32.const 0) + ) + (unreachable) + ) ) ) ) -(; -[program.elements] - GLOBAL: NaN - GLOBAL: Infinity - FUNCTION_PROTOTYPE: isNaN - FUNCTION_PROTOTYPE: isFinite - FUNCTION_PROTOTYPE: clz - FUNCTION_PROTOTYPE: ctz - FUNCTION_PROTOTYPE: popcnt - FUNCTION_PROTOTYPE: rotl - FUNCTION_PROTOTYPE: rotr - FUNCTION_PROTOTYPE: abs - FUNCTION_PROTOTYPE: max - FUNCTION_PROTOTYPE: min - FUNCTION_PROTOTYPE: ceil - FUNCTION_PROTOTYPE: floor - FUNCTION_PROTOTYPE: copysign - FUNCTION_PROTOTYPE: nearest - FUNCTION_PROTOTYPE: reinterpret - FUNCTION_PROTOTYPE: sqrt - FUNCTION_PROTOTYPE: trunc - FUNCTION_PROTOTYPE: load - FUNCTION_PROTOTYPE: store - FUNCTION_PROTOTYPE: sizeof - FUNCTION_PROTOTYPE: select - FUNCTION_PROTOTYPE: unreachable - FUNCTION_PROTOTYPE: current_memory - FUNCTION_PROTOTYPE: grow_memory - FUNCTION_PROTOTYPE: changetype - FUNCTION_PROTOTYPE: assert - FUNCTION_PROTOTYPE: abort - FUNCTION_PROTOTYPE: i8 - FUNCTION_PROTOTYPE: i16 - FUNCTION_PROTOTYPE: i32 - FUNCTION_PROTOTYPE: i64 - FUNCTION_PROTOTYPE: u8 - FUNCTION_PROTOTYPE: u16 - FUNCTION_PROTOTYPE: u32 - FUNCTION_PROTOTYPE: u64 - FUNCTION_PROTOTYPE: bool - FUNCTION_PROTOTYPE: f32 - FUNCTION_PROTOTYPE: f64 - FUNCTION_PROTOTYPE: isize - FUNCTION_PROTOTYPE: usize - GLOBAL: HEAP_BASE - GLOBAL: while/n - GLOBAL: while/m - GLOBAL: while/o -[program.exports] - -;) diff --git a/tests/parser.js b/tests/parser.js index a7a191de..d388f404 100644 --- a/tests/parser.js +++ b/tests/parser.js @@ -21,7 +21,7 @@ glob.sync(filter, { cwd: __dirname + "/parser" }).forEach(filename => { var failed = false; var parser = new Parser(); - parser.silentDiagnostics = true; + // parser.silentDiagnostics = true; var sourceText = fs.readFileSync(__dirname + "/parser/" + filename, { encoding: "utf8" }).replace(/\r?\n/g, "\n").replace(/^\/\/.*\r?\n/mg, ""); parser.parseFile(sourceText, filename, true);